From the course: SAS Programming for R Users, Part 1

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Demo: Importing data

Demo: Importing data

- [Instructor] In this section, I'll read in delimited raw data files with both DATA and PROC steps. Here, I'm creating a new data set called all_names in my sp4r library. The names are going to be the same names as before. First name, last name, and also, I'm going to read in age and height. I'll change the length of the first name and last name variables as well because they're a character. In my infile statement, I'll specify the path to the data file, and I want to read in the allnames.csv data file. And the dlm= option, I'll specify the comma for the CSV file type. The allnames.csv file has the original five names to be read in from the previous demonstration, as well as 195 other names. So of course, I wouldn't want to type those out by hand, so I'll just save those in my CSV and read them in with a data step. So let's run this. And again, we have 200 observations and the same 4 columns. Here are the first five names from before, and my 195 other ones that you can scroll…

Contents