diff --git a/exercises/00_welcome.qmd b/exercises/00_welcome.qmd index 4980138..430e385 100644 --- a/exercises/00_welcome.qmd +++ b/exercises/00_welcome.qmd @@ -42,7 +42,7 @@ The following two code chunks will use the **REDCapR** package to connect to a R ```{r} library(REDCapR) -creds <- retrieve_credential_local("../data-private/credentials.csv", 1) +creds <- retrieve_credential_local(here::here("data-private", "credentials.csv"), 1) uri <- creds$redcap_uri token <- creds$token diff --git a/exercises/01a_redcapr.qmd b/exercises/01a_redcapr.qmd index 6005878..cb45f3c 100644 --- a/exercises/01a_redcapr.qmd +++ b/exercises/01a_redcapr.qmd @@ -20,7 +20,7 @@ We'll discuss token approaches at the end of the deep dive. For now, know that a ```{r} -path_credential <- "../data-private/credentials.csv" +path_credential <- here::here("data-private", "credentials.csv") credential <- REDCapR::retrieve_credential_local(path_credential, 1L) credential ``` diff --git a/exercises/01b_extract_explore.qmd b/exercises/01b_extract_explore.qmd index 3b835cc..600140f 100644 --- a/exercises/01b_extract_explore.qmd +++ b/exercises/01b_extract_explore.qmd @@ -12,7 +12,7 @@ In this exercise, we will download REDCap data using REDCapTidier (as opposed to library(REDCapTidieR) # Load credentials from CSV file -creds <- REDCapR::retrieve_credential_local("../data-private/credentials.csv", 1) +creds <- REDCapR::retrieve_credential_local(here::here("data-private", "credentials.csv"), 1) uri <- creds$redcap_uri token <- creds$token diff --git a/exercises/exercise-1a.R b/exercises/exercise-1a.R index baa6ff4..e8eadf4 100644 --- a/exercises/exercise-1a.R +++ b/exercises/exercise-1a.R @@ -1,6 +1,6 @@ # install.packages("remotes") # remotes::install_github("OuhscBbmc/REDCapR") -path_credential <- "redcapcon_2023_redcap_r_workshop/data-private/credentials.csv" +path_credential <- here::here("data-private", "credentials.csv") credential <- REDCapR::retrieve_credential_local(path_credential, 1L) if (FALSE) { diff --git a/solutions/00_welcome.qmd b/solutions/00_welcome.qmd index 082f189..dcce9a7 100644 --- a/solutions/00_welcome.qmd +++ b/solutions/00_welcome.qmd @@ -29,7 +29,7 @@ The following code chunk will use the **REDCapR** package to connect to a REDCap ```{r} library(REDCapR) -creds <- retrieve_credential_local("../data-private/credentials.csv", 1) +creds <- retrieve_credential_local(here::here("data-private", "credentials.csv"), 1) uri <- creds$redcap_uri token <- creds$token diff --git a/solutions/01b_extract_explore.qmd b/solutions/01b_extract_explore.qmd index be4c577..5864606 100644 --- a/solutions/01b_extract_explore.qmd +++ b/solutions/01b_extract_explore.qmd @@ -12,7 +12,7 @@ In this exercise, we will download REDCap data using REDCapTidier (as opposed to library(REDCapTidieR) # Load credentials from CSV file -creds <- REDCapR::retrieve_credential_local("../data-private/credentials.csv", 1) +creds <- REDCapR::retrieve_credential_local(here::here("data-private", "credentials.csv"), 1) uri <- creds$redcap_uri token <- creds$token diff --git a/solutions/04_recreate_extend.qmd b/solutions/04_recreate_extend.qmd index b602dfc..3a86281 100644 --- a/solutions/04_recreate_extend.qmd +++ b/solutions/04_recreate_extend.qmd @@ -15,7 +15,7 @@ In this section, your challenge is to work with your small group to recreate the library(REDCapR) -creds <- retrieve_credential_local("../data-private/credentials.csv", 1) +creds <- retrieve_credential_local(here::here("data-private", "credentials.csv"), 1) uri <- creds$redcap_uri token <- creds$token