Dear All, I have data of the format shown in the link http://www.data.jma.go.jp/gmd/env/data/radiation/data/geppo/201004/DR201004_sap.txt that I need to read. I have downloaded all the data from the link and I have it on my computer. I used the following script (got it from web) and was able to read the data. But, it is not in the format that I wanted it to be. I want it a data frame and clean numbers. asNumeric <- function(x) as.numeric(as.character(x)) factorsNumeric <- function(data) modifyList(data, lapply(data[, sapply(data, is.logical)],asNumeric))
data=read.fwf(filename, widths=c(c1),skip=18, header=FALSE) data$V2<-as.numeric(gsub(" ","", as.character(data$V2) , fixed=TRUE)) f <- factorsNumeric(data) Any help is appreciated. Best, Alemu [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.