Displaying 1 result from an estimated 1 matches for "ncolnam".
Did you mean:
ncolnum
2011 Feb 04
1
read.csv trap
...es header=TRUE, fill=TRUE; should be a little more careful
## with comment, quote arguments (possibly explicit)
## ... contains information about quote, comment.char, sep
Read.csv <- function(fn,sep=",",...) {
colnames <- scan(fn,nlines=1,what="character",sep=sep,...)
ncolnames <- length(colnames)
maxcols <- max(count.fields(fn,sep=sep,...))
if (maxcols>ncolnames) {
colnames <- c(colnames,paste("V",(ncolnames+1):maxcols,sep=""))
}
## assumes you don't have any other columns labeled "V[large number]"
read.csv(fn...