Day 6: Multiple Linear Regression: Predicting House Prices
-
-
prlpzb 9 years ago I agree that using read.delim o read.table is a lot easier than reading lines and then trying to build vectors and frames. The trick is to read the whole imput as a data frame an then slice it to get the problem data.
Example:
tot=read.table(file="stdin",header=FALSE,fill=TRUE,sep=" ")
f=tot$V1[1]
n=tot$V2[1]
origen=tot[2:(n+1),]
t=tot$V1[n+2]
desti=tot[(n+3):(n+2+t),]
-
Easy to read data with
read.delim(file="stdin", header = FALSE, sep = " ")
Add Reply Preview cancel