diff --git a/DESCRIPTION b/DESCRIPTION index 48500f1..5e9c268 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: dsUpload Title: Upload Functions for DataSHIELD Backends -Version: 4.6.0 +Version: 4.6.1 Authors@R: c(person(given = "Mariska", family = "Slofstra", diff --git a/R/reshape.R b/R/reshape.R index b1ca8c9..0f9ced0 100755 --- a/R/reshape.R +++ b/R/reshape.R @@ -32,19 +32,19 @@ du.reshape <- function(upload = TRUE, project, data_version, input_format, dict_ nonrep_data <- du.reshape.generate.non.repeated( data, dict_kind ) - if (exists("nonrep_data")) { + if (!is.null(nonrep_data)) { write_csv(nonrep_data, paste0(getwd(), "/", file_name_nonrep, ".csv"), na = "") } yearlyrep_data <- du.reshape.generate.yearly.repeated( data, dict_kind ) - if (exists("yearlyrep_data")) { + if (!is.null(yearlyrep_data)) { write_csv(yearlyrep_data, paste0(getwd(), "/", file_name_yearly, ".csv"), na = "") } monthlyrep_data <- du.reshape.generate.monthly.repeated( data, dict_kind ) - if (exists('monthlyrep_data')) { + if (!is.null(monthlyrep_data)) { write_csv(monthlyrep_data, paste0(getwd(), "/", file_name_monthly, ".csv"), na = "") } @@ -53,7 +53,7 @@ du.reshape <- function(upload = TRUE, project, data_version, input_format, dict_ weeklyrep_data <- du.reshape.generate.weekly.repeated( data, dict_kind ) - if (exists("weeklyrep_data")) { + if (!is.null(weeklyrep_data)) { write_csv(weeklyrep_data, paste0(getwd(), "/", file_name_weekly, ".csv"), na = "") weeklyrep_metadata <- du.retrieve.full.dict(du.enum.table.types()$WEEKLY, dict_kind) weeklyrep_data <- du.add.metadata(weeklyrep_data, weeklyrep_metadata) @@ -75,7 +75,7 @@ du.reshape <- function(upload = TRUE, project, data_version, input_format, dict_ trimester_data <- du.reshape.generate.trimesterly.repeated( data, dict_kind ) - if (exists("trimester_data")) { + if (!is.null(trimester_data)) { write_csv(trimester_data, paste0(getwd(), "/", file_name_trimester, ".csv"), na = "") trimester_metadata <- du.retrieve.full.dict(du.enum.table.types()$TRIMESTER, dict_kind) trimester_data <- du.add.metadata(trimester_data, trimester_metadata) @@ -94,9 +94,9 @@ du.reshape <- function(upload = TRUE, project, data_version, input_format, dict_ if (upload) { if (ds_upload.globals$login_data$driver == du.enum.backends()$OPAL) { - if (exists("nonrep_data")) du.opal.upload(dict_kind, file_name_nonrep) - if (exists("yearlyrep_data")) du.opal.upload(dict_kind, file_name_yearly) - if (exists("monthlyrep_data")){ du.opal.upload(dict_kind, file_name_monthly) } + if (!is.null(nonrep_data)) du.opal.upload(dict_kind, file_name_nonrep) + if (!is.null(yearlyrep_data)) du.opal.upload(dict_kind, file_name_yearly) + if (!is.null(monthlyrep_data)){ du.opal.upload(dict_kind, file_name_monthly) } } if (ds_upload.globals$login_data$driver == du.enum.backends()$ARMADILLO) { if (!is.null(nonrep_data)) { diff --git a/R/reshape_helpers.R b/R/reshape_helpers.R index a45e56c..20a4d47 100644 --- a/R/reshape_helpers.R +++ b/R/reshape_helpers.R @@ -46,13 +46,17 @@ du.read.source.file <- function(input_path, input_format) { #' #' @noRd du.data.frame.remove.all.na.rows <- function(dataframe) { - df <- dataframe[-c(1)] + if(ncol(dataframe) >= 1) { + df <- dataframe[-c(1)] - naLines <- df %>% - is.na() %>% - apply(MARGIN = 1, FUN = all) + naLines <- df %>% + is.na() %>% + apply(MARGIN = 1, FUN = all) - return(df[!naLines, ]) + return(df[!naLines, ]) + } else { + return(list(0,0)) + } } #' #' Matched the columns in the source data. @@ -204,7 +208,7 @@ du.reshape.generate.yearly.repeated <- function(data, dict_kind) { matched_columns <- du.match.columns(colnames(data), variables_yearly_repeated_dict$name) yearly_repeated_measures <- data[matched_columns] - if (nrow(du.data.frame.remove.all.na.rows(yearly_repeated_measures)) <= 0) { + if (ncol(yearly_repeated_measures) <= 0 || nrow(du.data.frame.remove.all.na.rows(yearly_repeated_measures)) <= 0) { message("[WARNING] No yearly-repeated measures found in this set") return() } @@ -276,7 +280,7 @@ du.reshape.generate.monthly.repeated <- function(data, dict_kind) { matched_columns <- du.match.columns(colnames(data), variables_monthly_repeated_dict$name) monthly_repeated_measures <- data[, matched_columns] - if (nrow(du.data.frame.remove.all.na.rows(monthly_repeated_measures)) <= 0) { + if (ncol(monthly_repeated_measures) <= 0 || nrow(du.data.frame.remove.all.na.rows(monthly_repeated_measures)) <= 0) { message("[WARNING] No monthly-repeated measures found in this set") return() } @@ -350,7 +354,7 @@ du.reshape.generate.weekly.repeated <- function(data, dict_kind) { matched_columns <- du.match.columns(colnames(data), variables_weekly_repeated_dict$name) weekly_repeated_measures <- data[, matched_columns] - if (nrow(du.data.frame.remove.all.na.rows(weekly_repeated_measures)) <= 0) { + if (ncol(weekly_repeated_measures) <= 0 || nrow(du.data.frame.remove.all.na.rows(weekly_repeated_measures)) <= 0) { message("[WARNING] No weekly-repeated measures found in this set") return() } @@ -429,7 +433,7 @@ du.reshape.generate.trimesterly.repeated <- function(data, dict_kind) { matched_columns <- du.match.columns(colnames(data), variables_trimesterly_repeated_dict$name) trimesterly_repeated_measures <- data[, matched_columns] - if (nrow(du.data.frame.remove.all.na.rows(trimesterly_repeated_measures)) <= 0) { + if (ncol(trimesterly_repeated_measures) <= 0 || nrow(du.data.frame.remove.all.na.rows(trimesterly_repeated_measures)) <= 0) { message("[WARNING] No trimesterly-repeated measures found in this set") return() } diff --git a/docs/404.html b/docs/404.html index df8f70c..955bbf5 100644 --- a/docs/404.html +++ b/docs/404.html @@ -32,7 +32,7 @@ dsUpload - 4.5.1 + 4.6.1 @@ -45,7 +45,7 @@ Reference
  • Opal
  • -

    You can install the package by executing the following command:

    +

    You can install the package by executing the following commands:

    +

    Step 1: install devtools

    -install.packages("dsUpload", repos=c('https://registry.molgenis.org/repository/R/', 'https://cran.datashield.org'), dependencies = TRUE)
    -

    When you want to use it you need to load it.

    +install.packages("devtools") +

    Step 2: load devtools and install ds-upload

    -# load the package
    -library(dsUpload)
    -#> Loading required package: DSI
    -#> Loading required package: progress
    -#> Loading required package: R6
    +library(devtools) +devtools::install_github("lifecycle-project/ds-upload") +

    When you want to use it you need to load it.

    +
    +# load the package
    +library(dsUpload)
    +#> Loading required package: DSI
    +#> Loading required package: progress
    +#> Loading required package: R6

    Troubleshooting

    -

    Check: troubleshooting guide

    +

    Check: troubleshooting +guide

    Usage

    -

    To simplify the upload and importing of data dictionaries this package is written to import and upload the data dictionaries and data in one run. When running the package, you need to specify the data dictionary version and the data input file. When you use data formats other than CSV use need to specify the data format as well

    +

    To simplify the upload and importing of data dictionaries this +package is written to import and upload the data dictionaries and data +in one run. When running the package, you need to specify the data +dictionary version and the data input file. When you use data formats +other than CSV use need to specify the data format as well

    Prerequisites

    Using Armadillo

    -

    Please following the instruction below to upload the core and outcome variables in the Aramdillo.

    -
    -login_data <- data.frame(
    -  server = "https://armadillo.test.molgenis.org", 
    -  storage = "https://armadillo-minio.test.molgenis.org", 
    -  driver = "ArmadilloDriver")
    +

    Please following the instruction below to upload the core and outcome +variables in the Aramdillo.

    -# login to the Armadillo server
    -du.login(login_data = login_data)
    -#> ***********************************************************************************
    -#>   [WARNING] You are not running the latest version of the dsUpload-package.
    -#>   [WARNING] If you want to upgrade to newest version : [ 4.0.6 ],
    -#>   [WARNING] Please run 'install.packages("dsUpload", repos = "https://registry.molgenis.org/repository/R/")'
    -#>   [WARNING] Check the release notes here: https://github.com/lifecycle-project/analysis-protocols/releases/tag/4.0.6
    -#> ***********************************************************************************
    -#>   Login to: "https://armadillo.test.molgenis.org"
    -#> [1] "We're opening a browser so you can log in with code GFL6Q6"
    -#>   Logged on to: "https://armadillo.test.molgenis.org"
    -
    # upload the data into the DataSHIELD backend
    -# these are the core variables
    -# be advised the default input format is 'CSV'
    -# you can use STATA, SPSS, SAS, CSV's or R as source files
    -du.upload(
    -  cohort_id = 'gecko', 
    -  dict_version = '2_1', 
    -  dict_kind = 'core', 
    -  data_version = '1_0', 
    -  data_input_format = 'CSV',
    -  data_input_path = 'https://github.com/lifecycle-project/ds-upload/blob/master/inst/examples/data/WP1/data/all_measurements_v1_2.csv?raw=true',
    -  run_mode = "non_interactive"
    -)
    -#> ***********************************************************************************
    -#>   [WARNING] You are not running the latest version of the dsUpload-package.
    -#>   [WARNING] If you want to upgrade to newest version : [ 4.0.6 ],
    -#>   [WARNING] Please run 'install.packages("dsUpload", repos = "https://registry.molgenis.org/repository/R/")'
    -#>   [WARNING] Check the release notes here: https://github.com/lifecycle-project/analysis-protocols/releases/tag/4.0.6
    -#> ***********************************************************************************
    -#> ######################################################
    -#>   Start upload data into DataSHIELD backend
    -#> ------------------------------------------------------
    -#>  * Create temporary workdir
    -#> ######################################################
    -#>   Start download dictionaries
    -#> ------------------------------------------------------
    -#> * Download: [ 2_1_monthly_rep.xlsx ]
    -#> * Download: [ 2_1_non_rep.xlsx ]
    -#> * Download: [ 2_1_trimester_rep.xlsx ]
    -#> * Download: [ 2_1_yearly_rep.xlsx ]
    -#>   Successfully downloaded dictionaries
    -#> ######################################################
    -#>   Start importing data dictionaries
    -#> ######################################################
    -#>  * Check released dictionaries
    -#> * Project : gecko already exists
    -#> ######################################################
    -#>   Start converting and uploading data
    -#> ######################################################
    -#> * Setup: load data and set output directory
    -#> ------------------------------------------------------
    -#> [WARNING] This is an unmatched column, it will be dropped : [ art ].
    -#> * Generating: non-repeated measures
    -#> * Generating: yearly-repeated measures
    -#> Aggregate function missing, defaulting to 'length'
    -#> * Generating: monthly-repeated measures
    -#> Aggregate function missing, defaulting to 'length'
    -#> * Generating: trimesterly-repeated measures
    -#> Aggregate function missing, defaulting to 'length'
    -#> * Start importing: 2_1_core_1_0 into project: gecko
    -#> Compressing...
    -#> 
    -  |                                                                              
    -  |                                                                        |   0%
    -  |                                                                              
    -  |========================================================================| 100%
    -#> Uploaded 2_1_core_1_0/trimester
    -#> * Import finished successfully
    -#> * Start importing: 2_1_core_1_0 into project: gecko
    -#> Compressing...
    -#> 
    -  |                                                                              
    -  |                                                                        |   0%
    -  |                                                                              
    -  |==========                                                              |  15%
    -  |                                                                              
    -  |=====================                                                   |  29%
    -  |                                                                              
    -  |===============================                                         |  44%
    -  |                                                                              
    -  |==========================================                              |  58%
    -  |                                                                              
    -  |====================================================                    |  73%
    -  |                                                                              
    -  |===============================================================         |  87%
    -  |                                                                              
    -  |========================================================================| 100%
    -#> Uploaded 2_1_core_1_0/non_rep
    -#> * Import finished successfully
    -#> * Start importing: 2_1_core_1_0 into project: gecko
    -#> Compressing...
    -#> 
    -  |                                                                              
    -  |                                                                        |   0%
    -  |                                                                              
    -  |========================================================================| 100%
    -#> Uploaded 2_1_core_1_0/yearly_rep
    -#> * Import finished successfully
    -#> * Start importing: 2_1_core_1_0 into project: gecko
    -#> Compressing...
    -#> 
    -  |                                                                              
    -  |                                                                        |   0%
    -  |                                                                              
    -  |========================================================================| 100%
    -#> Uploaded 2_1_core_1_0/monthly_rep
    -#> * Import finished successfully
    -#> ######################################################
    -#>   Converting and import successfully finished
    -#> ######################################################
    -#>  * Reinstate default working directory
    -#>  * Cleanup temporary directory
    -
    # upload the outcome variables
    -du.upload(
    -  cohort_id = 'gecko', 
    -  dict_version = '1_1', 
    -  dict_kind = 'outcome', 
    -  data_version = '1_0', 
    -  data_input_format = 'CSV',
    -  data_input_path = 'https://github.com/lifecycle-project/ds-upload/blob/master/inst/examples/data/WP6/nd_data_wp6.csv?raw=true',
    -  run_mode = "non_interactive"
    -)
    -#> ***********************************************************************************
    -#>   [WARNING] You are not running the latest version of the dsUpload-package.
    -#>   [WARNING] If you want to upgrade to newest version : [ 4.0.6 ],
    -#>   [WARNING] Please run 'install.packages("dsUpload", repos = "https://registry.molgenis.org/repository/R/")'
    -#>   [WARNING] Check the release notes here: https://github.com/lifecycle-project/analysis-protocols/releases/tag/4.0.6
    -#> ***********************************************************************************
    -#> ######################################################
    -#>   Start upload data into DataSHIELD backend
    -#> ------------------------------------------------------
    -#>  * Create temporary workdir
    -#> ######################################################
    -#>   Start download dictionaries
    -#> ------------------------------------------------------
    -#> * Download: [ 1_1_monthly_rep.xlsx ]
    -#> * Download: [ 1_1_non_rep.xlsx ]
    -#> * Download: [ 1_1_weekly_rep.xlsx ]
    -#> * Download: [ 1_1_yearly_rep.xlsx ]
    -#>   Successfully downloaded dictionaries
    -#> ######################################################
    -#>   Start importing data dictionaries
    -#> ######################################################
    -#>  * Check released dictionaries
    -#> * Project : gecko already exists
    +login_data <- data.frame(
    +  server = "https://armadillo.test.molgenis.org", 
    +  storage = "https://armadillo-minio.test.molgenis.org", 
    +  driver = "ArmadilloDriver")
    +
    +# login to the Armadillo server
    +du.login(login_data = login_data)
    +#> ***********************************************************************************
    +#>   [WARNING] You are not running the latest version of the dsUpload-package.
    +#>   [WARNING] If you want to upgrade to newest version : [ 4.0.6 ],
    +#>   [WARNING] Please run 'install.packages("dsUpload", repos = "https://registry.molgenis.org/repository/R/")'
    +#>   [WARNING] Check the release notes here: https://github.com/lifecycle-project/analysis-protocols/releases/tag/4.0.6
    +#> ***********************************************************************************
    +#>   Login to: "https://armadillo.test.molgenis.org"
    +#> [1] "We're opening a browser so you can log in with code GFL6Q6"
    +#>   Logged on to: "https://armadillo.test.molgenis.org"
    +
    # upload the data into the DataSHIELD backend
    +# these are the core variables
    +# be advised the default input format is 'CSV'
    +# you can use STATA, SPSS, SAS, CSV's or R as source files
    +du.upload(
    +  cohort_id = 'gecko', 
    +  dict_version = '2_1', 
    +  dict_kind = 'core', 
    +  data_version = '1_0', 
    +  data_input_format = 'CSV',
    +  data_input_path = 'https://github.com/lifecycle-project/ds-upload/blob/master/inst/examples/data/WP1/data/all_measurements_v1_2.csv?raw=true',
    +  run_mode = "non_interactive"
    +)
    +#> ***********************************************************************************
    +#>   [WARNING] You are not running the latest version of the dsUpload-package.
    +#>   [WARNING] If you want to upgrade to newest version : [ 4.0.6 ],
    +#>   [WARNING] Please run 'install.packages("dsUpload", repos = "https://registry.molgenis.org/repository/R/")'
    +#>   [WARNING] Check the release notes here: https://github.com/lifecycle-project/analysis-protocols/releases/tag/4.0.6
    +#> ***********************************************************************************
    +#> ######################################################
    +#>   Start upload data into DataSHIELD backend
    +#> ------------------------------------------------------
    +#>  * Create temporary workdir
    +#> ######################################################
    +#>   Start download dictionaries
    +#> ------------------------------------------------------
    +#> * Download: [ 2_1_monthly_rep.xlsx ]
    +#> * Download: [ 2_1_non_rep.xlsx ]
    +#> * Download: [ 2_1_trimester_rep.xlsx ]
    +#> * Download: [ 2_1_yearly_rep.xlsx ]
    +#>   Successfully downloaded dictionaries
    +#> ######################################################
    +#>   Start importing data dictionaries
     #> ######################################################
    -#>   Start converting and uploading data
    -#> ######################################################
    -#> * Setup: load data and set output directory
    -#> ------------------------------------------------------
    -#> * Generating: non-repeated measures
    -#> * Generating: yearly-repeated measures
    -#> * Generating: monthly-repeated measures
    -#> * Generating: weekly-repeated measures
    -#> * Start importing: 1_1_outcome_1_0 into project: gecko
    -#> Compressing...
    -#> 
    -  |                                                                              
    -  |                                                                        |   0%
    -  |                                                                              
    -  |========================================================================| 100%
    -#> Uploaded 1_1_outcome_1_0/weekly_rep
    -#> * Import finished successfully
    -#> * Start importing: 1_1_outcome_1_0 into project: gecko
    -#> Compressing...
    -#> 
    +#>  * Check released dictionaries
    +#> * Project : gecko already exists
    +#> ######################################################
    +#>   Start converting and uploading data
    +#> ######################################################
    +#> * Setup: load data and set output directory
    +#> ------------------------------------------------------
    +#> [WARNING] This is an unmatched column, it will be dropped : [ art ].
    +#> * Generating: non-repeated measures
    +#> * Generating: yearly-repeated measures
    +#> Aggregate function missing, defaulting to 'length'
    +#> * Generating: monthly-repeated measures
    +#> Aggregate function missing, defaulting to 'length'
    +#> * Generating: trimesterly-repeated measures
    +#> Aggregate function missing, defaulting to 'length'
    +#> * Start importing: 2_1_core_1_0 into project: gecko
    +#> Compressing...
    +#> 
    +  |                                                                              
    +  |                                                                        |   0%
       |                                                                              
    -  |                                                                        |   0%
    -  |                                                                              
    -  |========================================================================| 100%
    -#> Uploaded 1_1_outcome_1_0/non_rep
    -#> * Import finished successfully
    -#> * Start importing: 1_1_outcome_1_0 into project: gecko
    -#> Compressing...
    -#> 
    +  |========================================================================| 100%
    +#> Uploaded 2_1_core_1_0/trimester
    +#> * Import finished successfully
    +#> * Start importing: 2_1_core_1_0 into project: gecko
    +#> Compressing...
    +#> 
    +  |                                                                              
    +  |                                                                        |   0%
       |                                                                              
    -  |                                                                        |   0%
    +  |==========                                                              |  15%
       |                                                                              
    -  |======                                                                  |   8%
    +  |=====================                                                   |  29%
       |                                                                              
    -  |===========                                                             |  16%
    +  |===============================                                         |  44%
       |                                                                              
    -  |=================                                                       |  24%
    +  |==========================================                              |  58%
       |                                                                              
    -  |=======================                                                 |  31%
    +  |====================================================                    |  73%
       |                                                                              
    -  |============================                                            |  39%
    +  |===============================================================         |  87%
       |                                                                              
    -  |==================================                                      |  47%
    -  |                                                                              
    -  |========================================                                |  55%
    -  |                                                                              
    -  |=============================================                           |  63%
    -  |                                                                              
    -  |===================================================                     |  71%
    -  |                                                                              
    -  |=========================================================               |  79%
    -  |                                                                              
    -  |==============================================================          |  86%
    -  |                                                                              
    -  |====================================================================    |  94%
    -  |                                                                              
    -  |========================================================================| 100%
    -#> Uploaded 1_1_outcome_1_0/yearly_rep
    -#> * Import finished successfully
    -#> * Start importing: 1_1_outcome_1_0 into project: gecko
    -#> Compressing...
    -#> 
    -  |                                                                              
    -  |                                                                        |   0%
    -  |                                                                              
    -  |========================================================================| 100%
    -#> Uploaded 1_1_outcome_1_0/monthly_rep
    -#> * Import finished successfully
    -#> ######################################################
    -#>   Converting and import successfully finished
    -#> ######################################################
    -#>  * Reinstate default working directory
    -#>  * Cleanup temporary directory
    + |========================================================================| 100% +#> Uploaded 2_1_core_1_0/non_rep +#> * Import finished successfully +#> * Start importing: 2_1_core_1_0 into project: gecko +#> Compressing... +#> + | + | | 0% + | + |========================================================================| 100% +#> Uploaded 2_1_core_1_0/yearly_rep +#> * Import finished successfully +#> * Start importing: 2_1_core_1_0 into project: gecko +#> Compressing... +#> + | + | | 0% + | + |========================================================================| 100% +#> Uploaded 2_1_core_1_0/monthly_rep +#> * Import finished successfully +#> ###################################################### +#> Converting and import successfully finished +#> ###################################################### +#> * Reinstate default working directory +#> * Cleanup temporary directory
    +
    # upload the outcome variables
    +du.upload(
    +  cohort_id = 'gecko', 
    +  dict_version = '1_1', 
    +  dict_kind = 'outcome', 
    +  data_version = '1_0', 
    +  data_input_format = 'CSV',
    +  data_input_path = 'https://github.com/lifecycle-project/ds-upload/blob/master/inst/examples/data/WP6/nd_data_wp6.csv?raw=true',
    +  run_mode = "non_interactive"
    +)
    +#> ***********************************************************************************
    +#>   [WARNING] You are not running the latest version of the dsUpload-package.
    +#>   [WARNING] If you want to upgrade to newest version : [ 4.0.6 ],
    +#>   [WARNING] Please run 'install.packages("dsUpload", repos = "https://registry.molgenis.org/repository/R/")'
    +#>   [WARNING] Check the release notes here: https://github.com/lifecycle-project/analysis-protocols/releases/tag/4.0.6
    +#> ***********************************************************************************
    +#> ######################################################
    +#>   Start upload data into DataSHIELD backend
    +#> ------------------------------------------------------
    +#>  * Create temporary workdir
    +#> ######################################################
    +#>   Start download dictionaries
    +#> ------------------------------------------------------
    +#> * Download: [ 1_1_monthly_rep.xlsx ]
    +#> * Download: [ 1_1_non_rep.xlsx ]
    +#> * Download: [ 1_1_weekly_rep.xlsx ]
    +#> * Download: [ 1_1_yearly_rep.xlsx ]
    +#>   Successfully downloaded dictionaries
    +#> ######################################################
    +#>   Start importing data dictionaries
    +#> ######################################################
    +#>  * Check released dictionaries
    +#> * Project : gecko already exists
    +#> ######################################################
    +#>   Start converting and uploading data
    +#> ######################################################
    +#> * Setup: load data and set output directory
    +#> ------------------------------------------------------
    +#> * Generating: non-repeated measures
    +#> * Generating: yearly-repeated measures
    +#> * Generating: monthly-repeated measures
    +#> * Generating: weekly-repeated measures
    +#> * Start importing: 1_1_outcome_1_0 into project: gecko
    +#> Compressing...
    +#> 
    +  |                                                                              
    +  |                                                                        |   0%
    +  |                                                                              
    +  |========================================================================| 100%
    +#> Uploaded 1_1_outcome_1_0/weekly_rep
    +#> * Import finished successfully
    +#> * Start importing: 1_1_outcome_1_0 into project: gecko
    +#> Compressing...
    +#> 
    +  |                                                                              
    +  |                                                                        |   0%
    +  |                                                                              
    +  |========================================================================| 100%
    +#> Uploaded 1_1_outcome_1_0/non_rep
    +#> * Import finished successfully
    +#> * Start importing: 1_1_outcome_1_0 into project: gecko
    +#> Compressing...
    +#> 
    +  |                                                                              
    +  |                                                                        |   0%
    +  |                                                                              
    +  |======                                                                  |   8%
    +  |                                                                              
    +  |===========                                                             |  16%
    +  |                                                                              
    +  |=================                                                       |  24%
    +  |                                                                              
    +  |=======================                                                 |  31%
    +  |                                                                              
    +  |============================                                            |  39%
    +  |                                                                              
    +  |==================================                                      |  47%
    +  |                                                                              
    +  |========================================                                |  55%
    +  |                                                                              
    +  |=============================================                           |  63%
    +  |                                                                              
    +  |===================================================                     |  71%
    +  |                                                                              
    +  |=========================================================               |  79%
    +  |                                                                              
    +  |==============================================================          |  86%
    +  |                                                                              
    +  |====================================================================    |  94%
    +  |                                                                              
    +  |========================================================================| 100%
    +#> Uploaded 1_1_outcome_1_0/yearly_rep
    +#> * Import finished successfully
    +#> * Start importing: 1_1_outcome_1_0 into project: gecko
    +#> Compressing...
    +#> 
    +  |                                                                              
    +  |                                                                        |   0%
    +  |                                                                              
    +  |========================================================================| 100%
    +#> Uploaded 1_1_outcome_1_0/monthly_rep
    +#> * Import finished successfully
    +#> ######################################################
    +#>   Converting and import successfully finished
    +#> ######################################################
    +#>  * Reinstate default working directory
    +#>  * Cleanup temporary directory

    Using Opal

    A video guiding you through the process can be found here:

    -

    Check youtube channel: upload data dictionaries and data into Opal

    +

    Check youtube channel: upload +data dictionaries and data into Opal

    Alternatively, execute these commands in your R-console:

    -
    -login_data <- data.frame(
    -  server = "https://opal.edge.molgenis.org", 
    -  user = "administrator", 
    -  password = "ouf0uPh6",
    -  driver = "OpalDriver")
    -# login to the DataSHIELD backend
    -du.login(login_data = login_data)
    -#> ***********************************************************************************
    -#>   [WARNING] You are not running the latest version of the dsUpload-package.
    -#>   [WARNING] If you want to upgrade to newest version : [ 4.0.6 ],
    -#>   [WARNING] Please run 'install.packages("dsUpload", repos = "https://registry.molgenis.org/repository/R/")'
    -#>   [WARNING] Check the release notes here: https://github.com/lifecycle-project/analysis-protocols/releases/tag/4.0.6
    -#> ***********************************************************************************
    -#>   Login to: "https://opal.edge.molgenis.org"
    -#>   Logged on to: "https://opal.edge.molgenis.org"
    +login_data <- data.frame( + server = "https://opal.edge.molgenis.org", + user = "administrator", + password = "ouf0uPh6", + driver = "OpalDriver")
    -# upload the data into the DataSHIELD backend
    -# these are the core variables
    -# be advised the default input format is 'CSV'
    -# you can use STATA, SPSS, SAS and CSV's as source files
    -du.upload(
    -  cohort_id = 'gecko', 
    -  dict_version = '2_1', 
    -  dict_kind = 'core', 
    -  data_version = '1_0', 
    -  data_input_format = 'CSV',
    -  data_input_path = 'https://github.com/lifecycle-project/ds-upload/blob/master/inst/examples/data/WP1/data/all_measurements_v1_2.csv?raw=true',
    -  run_mode = "non_interactive"
    -)
    -#> ***********************************************************************************
    -#>   [WARNING] You are not running the latest version of the dsUpload-package.
    -#>   [WARNING] If you want to upgrade to newest version : [ 4.0.6 ],
    -#>   [WARNING] Please run 'install.packages("dsUpload", repos = "https://registry.molgenis.org/repository/R/")'
    -#>   [WARNING] Check the release notes here: https://github.com/lifecycle-project/analysis-protocols/releases/tag/4.0.6
    -#> ***********************************************************************************
    -#> ######################################################
    -#>   Start upload data into DataSHIELD backend
    -#> ------------------------------------------------------
    -#>  * Create temporary workdir
    -#> ######################################################
    -#>   Start download dictionaries
    -#> ------------------------------------------------------
    -#> * Download: [ 2_1_monthly_rep.xlsx ]
    -#> * Download: [ 2_1_non_rep.xlsx ]
    -#> * Download: [ 2_1_trimester_rep.xlsx ]
    -#> * Download: [ 2_1_yearly_rep.xlsx ]
    -#>   Successfully downloaded dictionaries
    -#> ######################################################
    -#>   Start importing data dictionaries
    -#> ######################################################
    -#>  * Check released dictionaries
    -#> ------------------------------------------------------
    -#>   Start creating project: [ lc_gecko_core_2_1 ]
    -#> * Project: [ lc_gecko_core_2_1 ] already exists
    -#> ------------------------------------------------------
    -#>   Start importing dictionaries
    -#> * Table: [ 1_0_monthly_rep ] already exists
    -#> * Import variables into: [ 1_0_monthly_rep ]
    -#> * Table: [ 1_0_non_rep ] already exists
    -#> * Matched categories for table: [ 1_0_non_rep ]
    -#> * Import variables into: [ 1_0_non_rep ]
    -#> * Table: [ 1_0_trimester_rep ] already exists
    -#> * Matched categories for table: [ 1_0_trimester_rep ]
    -#> * Import variables into: [ 1_0_trimester_rep ]
    -#> * Table: [ 1_0_yearly_rep ] already exists
    -#> * Matched categories for table: [ 1_0_yearly_rep ]
    -#> * Import variables into: [ 1_0_yearly_rep ]
    -#>   All dictionaries are populated correctly
    -#> ######################################################
    -#>   Start converting and uploading data
    -#> ######################################################
    -#> * Setup: load data and set output directory
    -#> ------------------------------------------------------
    -#> [WARNING] This is an unmatched column, it will be dropped : [ art ].
    -#> * Generating: non-repeated measures
    -#> * Generating: yearly-repeated measures
    -#> Aggregate function missing, defaulting to 'length'
    -#> * Generating: monthly-repeated measures
    -#> Aggregate function missing, defaulting to 'length'
    -#> * Generating: trimesterly-repeated measures
    -#> Aggregate function missing, defaulting to 'length'
    -#> * Upload: [ 2021-01-29_11-40-58_1_0_trimester_repeated_measures.csv ] to directory [ core ]
    -#> * Upload: [ 2021-01-29_11-40-58_1_0_non_repeated_measures.csv ] to directory [ core ]
    -#> * Upload: [ 2021-01-29_11-40-58_1_0_yearly_repeated_measures.csv ] to directory [ core ]
    -#> * Upload: [ 2021-01-29_11-40-58_1_0_monthly_repeated_measures.csv ] to directory [ core ]
    -#> ######################################################
    -#>   Converting and import successfully finished
    -#> ######################################################
    -#>  * Reinstate default working directory
    -#>  * Cleanup temporary directory
    +# login to the DataSHIELD backend +du.login(login_data = login_data) +#> *********************************************************************************** +#> [WARNING] You are not running the latest version of the dsUpload-package. +#> [WARNING] If you want to upgrade to newest version : [ 4.0.6 ], +#> [WARNING] Please run 'install.packages("dsUpload", repos = "https://registry.molgenis.org/repository/R/")' +#> [WARNING] Check the release notes here: https://github.com/lifecycle-project/analysis-protocols/releases/tag/4.0.6 +#> *********************************************************************************** +#> Login to: "https://opal.edge.molgenis.org" +#> Logged on to: "https://opal.edge.molgenis.org"
    -# upload the outcome variables
    -du.upload(
    -  cohort_id = 'gecko', 
    -  dict_version = '1_1', 
    -  dict_kind = 'outcome', 
    -  data_version = '1_0', 
    -  data_input_format = 'CSV',
    -  data_input_path = 'https://github.com/lifecycle-project/ds-upload/blob/master/inst/examples/data/WP6/nd_data_wp6.csv?raw=true',
    -  run_mode = "non_interactive"
    -)
    -#> ***********************************************************************************
    -#>   [WARNING] You are not running the latest version of the dsUpload-package.
    -#>   [WARNING] If you want to upgrade to newest version : [ 4.0.6 ],
    -#>   [WARNING] Please run 'install.packages("dsUpload", repos = "https://registry.molgenis.org/repository/R/")'
    -#>   [WARNING] Check the release notes here: https://github.com/lifecycle-project/analysis-protocols/releases/tag/4.0.6
    -#> ***********************************************************************************
    -#> ######################################################
    -#>   Start upload data into DataSHIELD backend
    -#> ------------------------------------------------------
    -#>  * Create temporary workdir
    -#> ######################################################
    -#>   Start download dictionaries
    -#> ------------------------------------------------------
    -#> * Download: [ 1_1_monthly_rep.xlsx ]
    -#> * Download: [ 1_1_non_rep.xlsx ]
    -#> * Download: [ 1_1_weekly_rep.xlsx ]
    -#> * Download: [ 1_1_yearly_rep.xlsx ]
    -#>   Successfully downloaded dictionaries
    -#> ######################################################
    -#>   Start importing data dictionaries
    -#> ######################################################
    -#>  * Check released dictionaries
    -#> ------------------------------------------------------
    -#>   Start creating project: [ lc_gecko_outcome_1_1 ]
    -#> * Project: [ lc_gecko_outcome_1_1 ] already exists
    -#> ------------------------------------------------------
    -#>   Start importing dictionaries
    -#> * Table: [ 1_0_monthly_rep ] already exists
    -#> * Matched categories for table: [ 1_0_monthly_rep ]
    -#> * Import variables into: [ 1_0_monthly_rep ]
    -#> * Table: [ 1_0_non_rep ] already exists
    -#> * Matched categories for table: [ 1_0_non_rep ]
    -#> * Import variables into: [ 1_0_non_rep ]
    -#> * Table: [ 1_0_weekly_rep ] already exists
    -#> * Import variables into: [ 1_0_weekly_rep ]
    -#> * Table: [ 1_0_yearly_rep ] already exists
    -#> * Matched categories for table: [ 1_0_yearly_rep ]
    -#> * Import variables into: [ 1_0_yearly_rep ]
    -#>   All dictionaries are populated correctly
    -#> ######################################################
    -#>   Start converting and uploading data
    -#> ######################################################
    -#> * Setup: load data and set output directory
    -#> ------------------------------------------------------
    -#> * Generating: non-repeated measures
    -#> * Generating: yearly-repeated measures
    -#> * Generating: monthly-repeated measures
    -#> * Generating: weekly-repeated measures
    -#> * Upload: [ 2021-01-29_11-41-21_1_0_weekly_repeated_measures.csv ] to directory [ outcome ]
    -#> * Upload: [ 2021-01-29_11-41-21_1_0_non_repeated_measures.csv ] to directory [ outcome ]
    -#> * Upload: [ 2021-01-29_11-41-21_1_0_yearly_repeated_measures.csv ] to directory [ outcome ]
    -#> * Upload: [ 2021-01-29_11-41-21_1_0_monthly_repeated_measures.csv ] to directory [ outcome ]
    -#> ######################################################
    -#>   Converting and import successfully finished
    -#> ######################################################
    -#>  * Reinstate default working directory
    -#>  * Cleanup temporary directory
    +# upload the data into the DataSHIELD backend +# these are the core variables +# be advised the default input format is 'CSV' +# you can use STATA, SPSS, SAS and CSV's as source files +du.upload( + cohort_id = 'gecko', + dict_version = '2_1', + dict_kind = 'core', + data_version = '1_0', + data_input_format = 'CSV', + data_input_path = 'https://github.com/lifecycle-project/ds-upload/blob/master/inst/examples/data/WP1/data/all_measurements_v1_2.csv?raw=true', + run_mode = "non_interactive" +) +#> *********************************************************************************** +#> [WARNING] You are not running the latest version of the dsUpload-package. +#> [WARNING] If you want to upgrade to newest version : [ 4.0.6 ], +#> [WARNING] Please run 'install.packages("dsUpload", repos = "https://registry.molgenis.org/repository/R/")' +#> [WARNING] Check the release notes here: https://github.com/lifecycle-project/analysis-protocols/releases/tag/4.0.6 +#> *********************************************************************************** +#> ###################################################### +#> Start upload data into DataSHIELD backend +#> ------------------------------------------------------ +#> * Create temporary workdir +#> ###################################################### +#> Start download dictionaries +#> ------------------------------------------------------ +#> * Download: [ 2_1_monthly_rep.xlsx ] +#> * Download: [ 2_1_non_rep.xlsx ] +#> * Download: [ 2_1_trimester_rep.xlsx ] +#> * Download: [ 2_1_yearly_rep.xlsx ] +#> Successfully downloaded dictionaries +#> ###################################################### +#> Start importing data dictionaries +#> ###################################################### +#> * Check released dictionaries +#> ------------------------------------------------------ +#> Start creating project: [ lc_gecko_core_2_1 ] +#> * Project: [ lc_gecko_core_2_1 ] already exists +#> ------------------------------------------------------ +#> Start importing dictionaries +#> * Table: [ 1_0_monthly_rep ] already exists +#> * Import variables into: [ 1_0_monthly_rep ] +#> * Table: [ 1_0_non_rep ] already exists +#> * Matched categories for table: [ 1_0_non_rep ] +#> * Import variables into: [ 1_0_non_rep ] +#> * Table: [ 1_0_trimester_rep ] already exists +#> * Matched categories for table: [ 1_0_trimester_rep ] +#> * Import variables into: [ 1_0_trimester_rep ] +#> * Table: [ 1_0_yearly_rep ] already exists +#> * Matched categories for table: [ 1_0_yearly_rep ] +#> * Import variables into: [ 1_0_yearly_rep ] +#> All dictionaries are populated correctly +#> ###################################################### +#> Start converting and uploading data +#> ###################################################### +#> * Setup: load data and set output directory +#> ------------------------------------------------------ +#> [WARNING] This is an unmatched column, it will be dropped : [ art ]. +#> * Generating: non-repeated measures +#> * Generating: yearly-repeated measures +#> Aggregate function missing, defaulting to 'length' +#> * Generating: monthly-repeated measures +#> Aggregate function missing, defaulting to 'length' +#> * Generating: trimesterly-repeated measures +#> Aggregate function missing, defaulting to 'length' +#> * Upload: [ 2021-01-29_11-40-58_1_0_trimester_repeated_measures.csv ] to directory [ core ] +#> * Upload: [ 2021-01-29_11-40-58_1_0_non_repeated_measures.csv ] to directory [ core ] +#> * Upload: [ 2021-01-29_11-40-58_1_0_yearly_repeated_measures.csv ] to directory [ core ] +#> * Upload: [ 2021-01-29_11-40-58_1_0_monthly_repeated_measures.csv ] to directory [ core ] +#> ###################################################### +#> Converting and import successfully finished +#> ###################################################### +#> * Reinstate default working directory +#> * Cleanup temporary directory +
    +# upload the outcome variables
    +du.upload(
    +  cohort_id = 'gecko', 
    +  dict_version = '1_1', 
    +  dict_kind = 'outcome', 
    +  data_version = '1_0', 
    +  data_input_format = 'CSV',
    +  data_input_path = 'https://github.com/lifecycle-project/ds-upload/blob/master/inst/examples/data/WP6/nd_data_wp6.csv?raw=true',
    +  run_mode = "non_interactive"
    +)
    +#> ***********************************************************************************
    +#>   [WARNING] You are not running the latest version of the dsUpload-package.
    +#>   [WARNING] If you want to upgrade to newest version : [ 4.0.6 ],
    +#>   [WARNING] Please run 'install.packages("dsUpload", repos = "https://registry.molgenis.org/repository/R/")'
    +#>   [WARNING] Check the release notes here: https://github.com/lifecycle-project/analysis-protocols/releases/tag/4.0.6
    +#> ***********************************************************************************
    +#> ######################################################
    +#>   Start upload data into DataSHIELD backend
    +#> ------------------------------------------------------
    +#>  * Create temporary workdir
    +#> ######################################################
    +#>   Start download dictionaries
    +#> ------------------------------------------------------
    +#> * Download: [ 1_1_monthly_rep.xlsx ]
    +#> * Download: [ 1_1_non_rep.xlsx ]
    +#> * Download: [ 1_1_weekly_rep.xlsx ]
    +#> * Download: [ 1_1_yearly_rep.xlsx ]
    +#>   Successfully downloaded dictionaries
    +#> ######################################################
    +#>   Start importing data dictionaries
    +#> ######################################################
    +#>  * Check released dictionaries
    +#> ------------------------------------------------------
    +#>   Start creating project: [ lc_gecko_outcome_1_1 ]
    +#> * Project: [ lc_gecko_outcome_1_1 ] already exists
    +#> ------------------------------------------------------
    +#>   Start importing dictionaries
    +#> * Table: [ 1_0_monthly_rep ] already exists
    +#> * Matched categories for table: [ 1_0_monthly_rep ]
    +#> * Import variables into: [ 1_0_monthly_rep ]
    +#> * Table: [ 1_0_non_rep ] already exists
    +#> * Matched categories for table: [ 1_0_non_rep ]
    +#> * Import variables into: [ 1_0_non_rep ]
    +#> * Table: [ 1_0_weekly_rep ] already exists
    +#> * Import variables into: [ 1_0_weekly_rep ]
    +#> * Table: [ 1_0_yearly_rep ] already exists
    +#> * Matched categories for table: [ 1_0_yearly_rep ]
    +#> * Import variables into: [ 1_0_yearly_rep ]
    +#>   All dictionaries are populated correctly
    +#> ######################################################
    +#>   Start converting and uploading data
    +#> ######################################################
    +#> * Setup: load data and set output directory
    +#> ------------------------------------------------------
    +#> * Generating: non-repeated measures
    +#> * Generating: yearly-repeated measures
    +#> * Generating: monthly-repeated measures
    +#> * Generating: weekly-repeated measures
    +#> * Upload: [ 2021-01-29_11-41-21_1_0_weekly_repeated_measures.csv ] to directory [ outcome ]
    +#> * Upload: [ 2021-01-29_11-41-21_1_0_non_repeated_measures.csv ] to directory [ outcome ]
    +#> * Upload: [ 2021-01-29_11-41-21_1_0_yearly_repeated_measures.csv ] to directory [ outcome ]
    +#> * Upload: [ 2021-01-29_11-41-21_1_0_monthly_repeated_measures.csv ] to directory [ outcome ]
    +#> ######################################################
    +#>   Converting and import successfully finished
    +#> ######################################################
    +#>  * Reinstate default working directory
    +#>  * Cleanup temporary directory
    -

    IMPORTANT: You can run this package for the core variables and for the outcome variables. Each of them requires changing some parameters in the function call. So dict_kind specific ‘core’ or ‘outcome’ variables and dict_version specifies the data dictionary version (check the changelogs here: https://github.com/lifecycle-project/ds-dictionaries/tree/master/changelogs).

    +

    IMPORTANT: You can run this package for the core +variables and for the outcome variables. Each of them requires changing +some parameters in the function call. So dict_kind specific ‘core’ or +‘outcome’ variables and dict_version specifies the data dictionary +version (check the changelogs here: https://github.com/lifecycle-project/ds-dictionaries/tree/master/changelogs).

    -

    IMPORTANT You can specify your upload format! So you do not have to export to CSV first. Supported upload formats are: ‘SPSS’, ‘SAS’, ‘STATA’ and ‘CSV’.

    +

    IMPORTANT You can specify your upload format! So you +do not have to export to CSV first. Supported upload formats are: +‘SPSS’, ‘SAS’, ‘STATA’ and ‘CSV’.

    Import the data
    -

    If you run these commands, your data will be uploaded to the DataSHIELD backend. If you use Opal, you can now import these data into the tables manually.

    +

    If you run these commands, your data will be uploaded to the +DataSHIELD backend. If you use Opal, you can now import these data into +the tables manually.

    A video guiding you through the process can be found here: import data into Opal

    Alternatively, execute these actions for Opal:

      @@ -562,15 +594,21 @@
      Import the dataSelect “lc_#cohort#_#dict_kind#_x_x”
    1. Select “Import”
    2. Choose the CSV-file
    3. -
    4. Select the target table (depending on your choice regarding the file you have chosen)
    5. +
    6. Select the target table (depending on your choice regarding the file +you have chosen)
    7. Click on “Next”
    8. Click on “Next”
    9. -
    10. Determine that you all variables are matched, otherwise you need to fix your source-data first
    11. +
    12. Determine that you all variables are matched, otherwise you need to +fix your source-data first
    -

    IMPORTANT: make sure no NEW variables are introduce 11. Click on “Finish” 12. Check the “Task logs” (on the left side of the screen, in the icon bar)

    +

    IMPORTANT: make sure no NEW variables are introduce +11. Click on “Finish” 12. Check the “Task logs” (on the left side of the +screen, in the icon bar)

    -

    It will match your data dictionary and determine which variables are matched or not. You can re-upload the source files as often as needed.

    +

    It will match your data dictionary and determine which variables are +matched or not. You can re-upload the source files as often as +needed.

    @@ -589,12 +627,12 @@
    Import the data

    -

    Site built with pkgdown 2.0.2.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/articles/index.html b/docs/articles/index.html index 1625b02..3f1cc29 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -17,7 +17,7 @@ dsUpload - 4.5.1 + 4.6.1 @@ -29,7 +29,7 @@ Reference