Name: Anonymous 2013-02-02 9:12
Hey /prog/,
Has anyone here studied the R programming language, and if so could you help me with a trivial problem?
#################################################
twr2 <- function() {
#making the vector and storing in y
y <- c(1,3,45,6,7)
#pasting the vector into txt so we can write to file
txt = paste(y,sep="")
#txt is now ready to be written to file, so here we go:
fileConn= file("c:\\r\\writeTest.fis")
writeLines(txt, fileConn)
close(fileConn)
}
#################################################
The above code creates a vector, and then stores it in a file. The problem is the file contents are
on individual lines, how can I separate them with a comma, or just a spac etc. instead of a new line?
Any help would be much appreciated (I'm also aware of the general consesus on R, and I agree with it but I'm being forced to use it)
Has anyone here studied the R programming language, and if so could you help me with a trivial problem?
#################################################
twr2 <- function() {
#making the vector and storing in y
y <- c(1,3,45,6,7)
#pasting the vector into txt so we can write to file
txt = paste(y,sep="")
#txt is now ready to be written to file, so here we go:
fileConn= file("c:\\r\\writeTest.fis")
writeLines(txt, fileConn)
close(fileConn)
}
#################################################
The above code creates a vector, and then stores it in a file. The problem is the file contents are
on individual lines, how can I separate them with a comma, or just a spac etc. instead of a new line?
Any help would be much appreciated (I'm also aware of the general consesus on R, and I agree with it but I'm being forced to use it)