I have a tab delimited text file:
0730000 John 1 01 225 000 000
and when i read it into R
stud_stats <- read.delim("student.txt", header=FALSE, sep="\t", fileEncoding="UTF-8")
and viewed the dataframe, the value that is displayed is:
730000|John|1|1|225|0|0
The numeric values with zeroes in the initial text file have been altered in the dataframe. How do i preserve the numeric value to retain the zeroes when reading into the R dataframe?
I want the following exact value in the dataframe, just like the text file.
0730000|John|1|01|225|000|000
data <- read.table("student.txt", colClasses=c("character", "character", "character", "character", "character", "character", "character"), sep = "\t", ...)readrpackage functionread_tsv("student.txt", col_names = F).