Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importing WPS output (.wpd) tables in R

Tags:

import

r

I can't find anything on importing .wpd files (the WPS SAS tables) into R. Does anyone know how to import these tables in R?

I know you can use the foreign and Hmisc libraries to import sas7bdat files but so far I haven't found anything for .wpd.

Thanks.

like image 870
Al OLoughlin Avatar asked Oct 19 '22 15:10

Al OLoughlin


1 Answers

I have come across one solution which whilst not elegant it seems to work from wps to r studio.

Output your data set using the libname. The file will then be called mydataset.sas7bdat. You can continue to use this dataset in said format in wps.

libname out sas7bdat 'path to folder';

data out.mydataset;
set dataset;
run;

Then if you use the package haven

install.packages("haven")
library(haven)
Haven <- read_sas("filepath/dataset.sas7bdat")

You will be able to see your dataset and use it. I'm sure there are a couple of other work arounds, I just find this quickest.

Also proc r is pretty good on wps using import nowadays.

like image 97
Lace Rogers Avatar answered Oct 22 '22 21:10

Lace Rogers