In order to get started with SAS7BDAT file, it requires a basic installation of the package. Once it is installed, the following steps are implemented:
Step 1: Get the data of SAS7BDAT source with the command:
Step 2: The console window will contain the link of the file to be downloaded.
Step 3: The file should be in the working directory.
Step 4: Insert the code in the console window:
>depressdata<-read.sas7bdat(“depress.sas7bdat”) >class(depressdata) >head(depress data)
Q. Can we use any other SAS file instead of depress?
Yes. In order to do that we can go to the command line:
This will have the files that can be downloaded and tried.
Using R Commander
For example the file ‘Life Expectancy’ is uploaded which has details of the average life expectancy of countries.
Here are the steps followed for executing through R Commander
Step 1) Type the code in the command line
Step 2) This will open up R Commander window
Step 3) Import Data by going to Data>Import Data
Step 4) We can enter the name of the dataset
Step 5) No variable name in the file is assigned.
Step 6) Missing data Indicator is NA.
Step 7) Location of data file is local file system
Step 8) A field is being separated between a comma or a tab.
Step 9) It then reads the table. The read.table command is more generic.
Step 10) Once the dataset is read, we can view the dataset.
Step 11) The pop up with the dataset helps the user edit as well.
Got a question for us?? Please mention them in the comments section and we will get back to you.