Hello All,
I have been using SAS for a very long time but got interested in learning R recently. I am thinking of analyzing data and producing the same table using R that I did using SAS and learn R on the way.
Much of the work in clinical trials involve producing pretty tables to present the data after analyzing the data using some statistical methods. Many tables do not really need much of high level statistics (e.g. demographics, AE) but is presented in a visually attractive way. SAS/PROC REPORT is a fantastic procedure just for that. R do not have similar procedures but recently few developers tried to overcome that limitation (e.g. David Bosak) - made some packages. I am reading many books/articles on R but thought of joining this community to get some help.
Anyway, here is my question - I have few line of codes from SAS below: a very simple task.
libname vis2 "/xxx/xxxx/xxxx/xxxx/xxxx/xxx" access= readonly.
data adslvis;
set vis2.adsl;
if actarmcd="xxxx" then trtn=1;
else if actarmcd="yyyy" then trtn=2;
else delete;
keep usubjid trtn;
run;
The first line is creating a library (basically making a link to a folder where the sas data is located) vis2 .
The second block of codes simply creating a dataset 'adslvis' by getting the dataset 'adsl' from the library vis2, creating a new numeric variable trtn, and keeping just subjid and trtn in the dataset 'adslvis'.
R-version.
I can read sas7bdat data from the folder (after installing packages haven and sas7bdat) using the function read_sas.
vis <- read_sas("J:xxxx/xxxx/xxxx/xxxx/")
How can I accomplish second part and still keep the data name the same? I am sure there are many different ways of doing it using different packages/functions but what is the simplest way? It might be very trivial for R programmers but not yet for me.
Thanks a lot for reading up to this.
Sharif Uddin