if (FALSE) {
project <- osf_create_project("Flower Data")
write.csv(iris, file = "iris.csv")
data_file <- osf_upload(project,"iris.csv")
# Create a new directory to copy our file to
data_dir <- osf_mkdir(project, "data")
# Copy the file to our data directory
data_file <- osf_cp(data_file, to = data_dir)
# Copy directory to new component
data_comp <- osf_create_component(project, title = "data", category = "data")
data_dir %>%
osf_cp(to = data_comp) %>%
osf_open()
}
Run the code above in your browser using DataCamp Workspace