r - How to read the data from web -


i import data http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/regression/mg r. dataset contains 1,385 data points featuring 6 independent variables , 1 dependent variable. how can import data file r?

i suppose looking read.table:

read.table("http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/regression/mg") 

if want remove column numbers , colons numeric values, can use gsub:

dat <- read.table("http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/regression/mg",                   stringsasfactors = false)  dat[-1] <- lapply(dat[-1], function(x) as.numeric(gsub(".:", "", x))) 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -