I'm trying to read a file which uses ::
as the column seperator:
userID::MovieID::Rating::Timestamp
1::1193::5::978300760
1::661::3::978302109
1::914::3::978301968
1::3408::4::978300275
Here is my code
tr = read.table("/home/user/ml-1m/ratings.dat",sep = ":" )
print(tr)
the result is :
V1 V2 V3 V4 V5 V6 V7
1 2 NA 318 NA 5 NA 978298413
2 2 NA 1207 NA 4 NA 978298478
3 2 NA 1968 NA 2 NA 978298881
4 2 NA 3678 NA 3 NA 978299250
5 2 NA 1244 NA 3 NA 978299143
6 2 NA 356 NA 5 NA 978299686
7 2 NA 1245 NA 2 NA 978299200
I don't want the NA
value.
But if I set sep="::"
,there is error invalid 'sep' value: must be one byte
How can I fixed this?