Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Read a sample from sas7bdat file in R

Tags:

r

sas

I have a sas7bdat file of size around 80 GB. Since my pc has a memory of 4 GB the only way I can see is reading some of its rows. I tried using the sas7bdat package in R which gives the error "big endian files are not supported" The read_sas() function in haven seems to work but the function supports reading specific columns only while I need to read any subset of rows with all columns. For example, it will be fine if I can read 1% of the data to understand it. Is there any way to do this? Any package which can work? Later on I plan to read parts of the file and divide it into 100 or so sections

like image 479
Madhur Modi Avatar asked Nov 08 '22 18:11

Madhur Modi


1 Answers

If you have Windows you can use the SAS Universal Viewer, which is free, and export the dataset to CSV. Then you can import the CSV into R in more readable chunks using this method.

like image 193
Craig Srsen Avatar answered Nov 15 '22 07:11

Craig Srsen