library(synapser) ## ## TERMS OF USE NOTICE: ## When using Synapse, remember that the terms and conditions of use require that you: ## 1) Attribute data contributors when discussing these data or results from these data. ## 2) Not discriminate, identify, or recontact individuals or groups represented by the data. ## 3) Use and contribute only data de-identified to HIPAA standards. ## 4) Redistribute data only under these same terms of use. synLogin() ## NULL # Create a new project # use hex_digits to generate random string hex_digits <- c(as.character(0:9), letters[1:6]) projectName <- sprintf("My unique project %s", paste0(sample(hex_digits, 32, replace = TRUE), collapse = "")) project <- Project(projectName) project <- synStore(project) # Create a file file_path <- tempfile("testUpload.txt") connection <- file(file_path) writeChar("this is the content of the file", connection, eos = NULL) close(connection) file <- File(path = file_path, parent = project) file <- synStore(file) file_id <- file$properties$id