I'm trying to import 100k+ data from atsv file into data frame. I used read.csv.raw from iotools package in R for faster execution as the normal ones are taking too much time. It worked like a charm and I was able to read the data within a sec. Later, I observed that some column had data in the database but while importing it is showing as NA.

Can anyone help explain why this is happening?

There are 32 columns with 100k+ rows (just naming it with an alias because I could not copy the whole data as it's huge).

Student Roll NO Student Name    Student Total  Marks    Students Marks English  Students Marks Maths    Students Marks Science  FinalYearProjectMarks   FinalYearProjectName
1   ABC 20  24  23  12  98  Smart City
2   DEF 20  21  22  15  56  City as a Wifi Hub
3   GHI 18  8   21  23  73  Oil And Gas
4   XYZ 15  10  10  23  72  Mobile Pro and cons
5   SEW 20  25  11  25  85  Smart City 2
library(iotools)
 refdata <- read.csv.raw("D:\\Final Report\\Students_all.tsv", header=TRUE, sep="\t",quote = "")
 names(refdata)
[1] "Student_Roll_No"                "Students_Name"                  "Student_Total_Marks"           
 [4] "Students_Marks_English"         "Students_Marks_Maths"           "Students_Marks_Science"        
 [7] "Students_Marks_History"         "Students_Marks_Geography"       "Students_Marks_Social_Work"    
[10] "FinalYearProjectName"        "FinalYearProjectMarks"       "Students_Address"              
[13] "Students_Admission_Date"        "Students_Enrollment_No"         "Student_Ethinic"               
[16] "Students_Parents_Enrollment_No" "Contact_No"                     "Review_Performace_Grade"       
[19] "X"                              "Last_Years_Grade"               "Current_Years_Grade"           
[22] "Last_Years_Marks"               "Percentage"                     "Grade_Review"                  
[25] "Performace_Remark"              "Date_of_Issue"          

Now after the import of the table we can see the refdata$FinalYearProjectName,

Actual
FinalYearProjectName:-
NA,
NA,
NA,
NA,
NA,

It is clearly showing NA instead of the actual data.

Expected

FinalYearProjectName:-
Smart City,
City as a Wifi Hub,
Oil And Gas,
Mobile Pro and cons,
Smart City 2,

0 Answers