From f0a2ba883340b3b1fb57eca41999f5b91e46e332 Mon Sep 17 00:00:00 2001 From: Dhirendra Singh Date: Tue, 16 Mar 2021 12:43:30 +1100 Subject: [PATCH] Updated step5 to work with updated outputs of steps upstream (test still to be fixed); #4 --- R/locateParallel.R | 6 +++--- tests/testthat/testLocateParallel.R | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/R/locateParallel.R b/R/locateParallel.R index fcb6b1b..dffce86 100644 --- a/R/locateParallel.R +++ b/R/locateParallel.R @@ -1,8 +1,8 @@ locatePlans <- function(censuscsv, vistacsv, matchcsv, outdir, outcsv, rseed = NULL) { # example inputs # censuscsv<-'../output/2.sample/sample.csv.gz' - # vistacsv<-'../output/3.plan/plan.csv' - # matchcsv<-'../output/4.match/match.csv.gz' + # vistacsv<-'../output/4.plan/plan.csv' + # matchcsv<-'../output/4.plan/plan2agent2group.csv' # outdir<-'../output/5.locate' # outcsv<-'../output/5.locate/plan.csv' # planGroup=1 @@ -206,7 +206,7 @@ matches<-read.csv(gz1, header=T, stringsAsFactors=F, strip.white=T) close(gz1) # set.seed(20200406) # for when we want to have the same LocationType each time -plans<-origplans %>% +plans<-origplans[,c("PlanId","Activity","StartBin","EndBin")] %>% # Remove all plans that are not matched filter(PlanId %in% matches$PlanId) %>% # Assign matched PersonId (very fast since we assume row number equals Id number) diff --git a/tests/testthat/testLocateParallel.R b/tests/testthat/testLocateParallel.R index c57ba71..6eddc6a 100644 --- a/tests/testthat/testLocateParallel.R +++ b/tests/testthat/testLocateParallel.R @@ -8,12 +8,12 @@ source("../../R/locateParallel.R") test_that("Assigning SA1s to activities works", { - skip('TODO: This test is to be updated to use matched groups') + skip("FIXME: skipping because the test run produces errors") rseed<-12345 set.seed(rseed) censuscsv<-'./tests/expected/2.sample/sample.csv.gz' - vistacsv<-'./tests/expected/3.plan/plan.csv' - matchcsv<-'./tests/expected/4.match/match.csv.gz' + vistacsv<-'./tests/expected/4.plan/plan.csv' + matchcsv<-'./tests/expected/4.plan/plan2agent2group.csv' outdir<-'./tests/actual/5.locate' outcsv<-'./tests/actual/5.locate/plan.csv' dir.create(outdir, showWarnings = FALSE, recursive=TRUE)