Import multiple files

Hello all ,

I have couple of .xpt files that I am trying to import into my R data directory package folder
I am getting the List of all the files ( by doing below ) . I am not able to get individual files loaded into /data folder . See below . Please suggest me what is that I am missing

Following the example available at

this SAVE and LOAD are creating one big file instead of Individual files

save it to the folder with your custom functions

save(import.multiple.xpt.files,file="C:/Users/xxx/OneDrive/Desktop/clinic/data/import.multiple.xpt.files.RData")

load it like this whenever you need it in another script with

load("C:/Users/xxx/OneDrive/Desktop/clinic/data/import.multiple.xpt.files.RData")

My Purpose is to
#1 is to read .xpt file
library(Hmisc)
setwd("C:/Users/yyy/OneDrive/Desktop/aaa/adam/")
adae <- sasxport.get("adae.xpt")

#2 Copy it to my R- package as .Rda file
setwd("C:/Users/yyy/OneDrive/Desktop/aaa/bbb")
usethis:: use_data (adae , compress = "xz" )

#3 Copy it my R- package data-raw/inst/extdata as .csv files
setwd("C:/Users/yyy/OneDrive/Desktop/aaa/bbb/data-raw/")

readr::write_csv(adae , path= "inst/extdata/adae.csv")

There are good number of datasets , so want to repeat this reading and saving process

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.