Reputation: 361
I used fread
to load csv file as the following line.
data_startle <- fread('Materials/data/1/1.EMG.csv')
Figure 1 is what it looked like after loading into R and figure 2 is what it looked like in the file.
Can I make it the same in R as in EXCEL? All numbers in the last few columns should be integer.
Upvotes: 0
Views: 632
Reputation: 196
The fread
function has an argument colClasses
which you can use to specify data types of specific columns, e.g.:
data_startle <- fread('Materials/data/1/1.EMG.csv', colClasses=list(integer=c("practise","acq")))
See also this post for more details.
Upvotes: 2