-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Standard Survey Creation #12
Closed
Closed
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
d633275
Begin refactor of standard survey data creation script
jhelsel11 a3f9458
Refactor standard db creation to method library for standardization.
jhelsel11 f433934
Update bespoke survey process
jhelsel11 5696fcf
Update to standard database code
jhelsel11 2fbb38d
Update build standard database
jhelsel11 dc5c04a
Completed first pass through Build Standard Database
jhelsel11 5563ee0
Move standard database path lookup into rmd. New users will need to a…
jhelsel11 ac440f1
Remove legacy decomposition script
jhelsel11 00f3853
Create new decomposition rproject, add new author to metadata.
jhelsel11 d5f6f3b
Refactor decomposition analysis.
jhelsel11 3d5a745
fix path update
jhelsel11 a22e0e2
trying to get rid of decomp analysis in this branch
jhelsel11 8d53617
Merge branch 'refactor_survey' of https://github.com/BayAreaMetro/onb…
jhelsel11 07f0257
Revert "trying to get rid of decomp analysis in this branch"
jhelsel11 ac7e7f0
dave pass at making tidy and easier to read
DavidOry 7c63246
added temp compare script
DavidOry 392a247
Resolve Issue - Save in RDS
jhelsel11 7704659
Create check against levels recorded in survey but dropped from Dicti…
jhelsel11 43a1822
update standard database.
jhelsel11 497e8f4
renamed RDS output, fleshed out compare
DavidOry b34f4ca
start on ac transit to standard
DavidOry 48e635f
initial pass through dictionary
DavidOry c14d8d7
Merge branch 'add-ac-transit-standard-REBASED' into refactor_survey
jhelsel11 a0d9a39
put file reads in alphabetical order.
jhelsel11 12c1415
add AC transit to survey tech csv
jhelsel11 2f742f3
minor adjustments to order of code.
jhelsel11 bdda105
Fixed AC Transit worker code.
jhelsel11 a33460f
Update number_transfers_orig_board and number_transfer_alight_dest fo…
jhelsel11 b7f67d7
remove shuttle from bespoke survey tech
jhelsel11 5fe891a
small changes to build standard database
jhelsel11 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,7 @@ load("~/GitHub/onboard-surveys/Data and Reports/_data Standardized/survey_standa | |
previous_df <- survey.standard %>% | ||
rename(unique_ID = Unique_ID) | ||
|
||
load("~/GitHub/onboard-surveys/Data and Reports/_data Standardized/survey_standard.Rdata") | ||
current_df <- survey_standard | ||
current_df <- readRDS("~/GitHub/onboard-surveys/Data and Reports/_data Standardized/survey_standard.Rdata") | ||
|
||
find_differences <- function(anti_outcomes_df, diffed_df) { | ||
|
||
|
@@ -47,11 +46,26 @@ find_differences <- function(anti_outcomes_df, diffed_df) { | |
|
||
} | ||
|
||
anti_df <- anti_join(previous_df, current_df, by = c("unique_ID")) | ||
diff_df <- find_differences(anti_df, current_df) | ||
# do both ways | ||
anti_previous_df <- anti_join(previous_df, current_df, by = c("unique_ID")) | ||
diff_previous_df <- find_differences(anti_df, current_df) | ||
|
||
relevant_df <- diff_df %>% | ||
filter(!(previous_outcome == "missing" & current_outcome == "NA")) | ||
anti_current_df <- anti_join(current_df, previous_df, by = c("unique_ID")) | ||
diff_current_df <- find_differences(anti_current_df, previous_df) | ||
|
||
table(thin_df$var_name) | ||
# update the Caltrain IDs and do again | ||
update_current_df <- current_df %>% | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jhelsel11: you are correct re: Caltrain bug. When the |
||
mutate(ID = ifelse(str_detect(ID, "S"), str_replace(ID, "S", ""), ID)) %>% | ||
mutate(unique_ID = paste(ID, operator, survey_year, sep = "---")) | ||
|
||
anti_previous_df <- anti_join(previous_df, update_current_df, by = c("unique_ID")) | ||
diff_previous_df <- find_differences(anti_df, current_df) | ||
|
||
anti_current_df <- anti_join(update_current_df, previous_df, by = c("unique_ID")) | ||
diff_current_df <- find_differences(anti_current_df, previous_df) | ||
|
||
# okay they now match | ||
|
||
|
||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jhelsel11: When using saveRDS, we should use the RDS extension, so users know that it's an
RDS
file and not anRdata
file.