Skip to content

Commit

Permalink
Merge pull request #27 from DominikGuentensperger/main
Browse files Browse the repository at this point in the history
Redcap_import_recode
  • Loading branch information
aghaynes authored Nov 18, 2024
2 parents 74dcc61 + 856cebe commit aa185b1
Show file tree
Hide file tree
Showing 24 changed files with 3,100 additions and 618 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
inst/doc
redcap_select_rename_code.txt
redcap_select_rename_overview.csv
redcap_import_recode.txt
10 changes: 6 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: redcaptools
Type: Package
Title: Tools for exporting and working with REDCap data
Version: 0.4.0
Version: 0.5.0
Authors@R:
c(
person(given = "Alan G.", family = "Haynes", role = "cre",
Expand All @@ -13,9 +13,8 @@ Description: Tools for exporting and working with REDCap data (e.g. adding label
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.0
RoxygenNote: 7.3.1
Suggests:
knitr,
rmarkdown,
testthat (>= 3.0.0)
VignetteBuilder: knitr
Expand All @@ -27,5 +26,8 @@ Imports:
lubridate,
magrittr,
stringr,
tidyr
tidyr,
knitr,
tidyselect,
stringdist
Config/testthat/edition: 3
17 changes: 16 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ export(multichoice_opts)
export(rc_dates)
export(rc_datetimes)
export(rc_prep)
export(redcap_dates)
export(redcap_export_batch)
export(redcap_export_byform)
export(redcap_export_meta)
export(redcap_export_tbl)
export(redcap_import_dates)
export(redcap_import_datetime)
export(redcap_import_recode)
export(redcap_import_select)
export(redcap_import_times)
export(redcap_prep)
export(redcap_prep_dates)
export(redcap_prep_datetimes)
Expand All @@ -29,10 +31,13 @@ importFrom(crayon,red)
importFrom(crayon,underline)
importFrom(dplyr,across)
importFrom(dplyr,bind_rows)
importFrom(dplyr,case_when)
importFrom(dplyr,everything)
importFrom(dplyr,filter)
importFrom(dplyr,if_else)
importFrom(dplyr,matches)
importFrom(dplyr,mutate)
importFrom(dplyr,na_if)
importFrom(dplyr,pull)
importFrom(dplyr,select)
importFrom(dplyr,slice)
Expand All @@ -43,15 +48,25 @@ importFrom(httr2,req_perform)
importFrom(httr2,request)
importFrom(httr2,resp_body_string)
importFrom(httr2,resp_status)
importFrom(knitr,kable)
importFrom(labelled,"var_label<-")
importFrom(labelled,var_label)
importFrom(lubridate,as_date)
importFrom(lubridate,dmy)
importFrom(lubridate,hm)
importFrom(lubridate,hms)
importFrom(lubridate,mdy)
importFrom(lubridate,ms)
importFrom(lubridate,ymd)
importFrom(lubridate,ymd_hm)
importFrom(magrittr,"%>%")
importFrom(stringdist,stringsim)
importFrom(stringr,str_detect)
importFrom(stringr,str_extract)
importFrom(stringr,str_split)
importFrom(tidyr,fill)
importFrom(tidyr,separate)
importFrom(tidyselect,everything)
importFrom(utils,read.csv)
importFrom(utils,str)
importFrom(utils,write.table)
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# redcaptools 0.5.0

* finalizing `redcap_import_recode` with user-friendly introduction, more useful output, automated options and tests
* improving `redcap_import_dates` to prepare dates for import
* addition of `redcap_import_times` and `redcap_import_datetime` to prepare time or date-time values for import

# redcaptools 0.4.0

* some data preparation functions have been renamed to improve consistency and clarity. The old functions remain to work, but issue a warning about deprecation.
Expand Down
12 changes: 12 additions & 0 deletions R/input_checks.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,15 @@ check_forms <- function(x) {
check_data <- function(x) {
if(!is.data.frame(x)) stop("import data should be a data frame")
}

check_missing_codes <- function(x) {

if(!is.data.frame(x) |
length(x) != 2 |
names(x)[1] != "code" |
names(x)[2] != "label" |
any(is.na(x))) {
stop("missing codes could not be parsed correctly")
}

}
91 changes: 0 additions & 91 deletions R/redcap_dates.R

This file was deleted.

Loading

0 comments on commit aa185b1

Please sign in to comment.