I am trying to read the data from this link in R using the following code but I keep getting warning messages and the dataframe doesn't read the data properly.
url <- 'https://onlinecourses.science.psu.edu/stat501/sites/onlinecourses.science.psu.edu.stat501/files/data/leukemia_remission.txt'
df <- read.table(url, sep = '\t',header = F, skip = 2,quote='', comment='')
Can you tell what I need to change to read the data
EDIT
Adding data snippet
REMISS CELL SMEAR INFIL LI BLAST TEMP
1 0.8 0.83 0.66 1.9 1.1 1
1 0.9 0.36 0.32 1.4 0.74 0.99
0 0.8 0.88 0.7 0.8 0.18 0.98
0 1 0.87 0.87 0.7 1.05 0.99
1 0.9 0.75 0.68 1.3 0.52 0.98
0 1 0.65 0.65 0.6 0.52 0.98
1 0.95 0.97 0.92 1 1.23 0.99
0 0.95 0.87 0.83 1.9 1.35 1.02
It is an issue about encoding. Please see this thread for more information (Get "embedded nul(s) found in input" when reading a csv using read.csv()).
url <- 'https://onlinecourses.science.psu.edu/stat501/sites/onlinecourses.science.psu.edu.stat501/files/data/leukemia_remission.txt'
df <- read.table(url, sep = '\t',header = TRUE, fileEncoding = "UTF-16LE")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With