Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

R "programming"

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)

Name: Anonymous 2013-02-03 22:24


                   _  _   _                                                   __
  _ __           _| || |_| | __ _ _ __   __ _ _   _  __ _  __ _  ___    ___  / _|
 | '__|  _____  |_  ..  _| |/ _` | '_ \ / _` | | | |/ _` |/ _` |/ _ \  / _ \| |_
 | |    |_____| |_      _| | (_| | | | | (_| | |_| | (_| | (_| |  __/ | (_) |  _|
 |_|              |_||_| |_|\__,_|_| |_|\__, |\__,_|\__,_|\__, |\___|  \___/|_| 
     __     __       _     _ _ _        |___/             |___/                 
    / / __ / /__  __| | __| (_) |_                                              
   / / '__/ / _ \/ _` |/ _` | | __|                                             
  / /| | / /  __/ (_| | (_| | | |_                                              
 /_/ |_|/_/ \___|\__,_|\__,_|_|\__|                                             
                                                                                

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List