search for: writeline

Displaying 20 results from an estimated 89 matches for "writeline".

Did you mean: writelines
2017 Dec 29
Writing text files out of a dataset
Hello, I am trying to run the following syntax for all cases within the dataframe "data" d1 <- data[1,c("material")] fileConn<-file("TESTI/d1.txt") writeLines(d1, fileConn) close(fileConn) I am trying to use the for function: for (i in 1:nrow(data)){ d[i] <- data[i,c("material")] fileConn<-file("TESTI/d[i].txt") writeLines(d[i], fileConn) close(fileConn) } but I get the error: Object "d" not found An...
2005 Jul 26
Dial using URI(web) or using FORM(web)
Hello! I have an Asterisk@home instalation with 7 users working OK, and I'ld like to implement either a -- Web dial feature, where the user would fill one form field with a phone number and a connection would be created between his extention and the entered number. OR -- Dial using an URI (callto:xxxxx link in a web page), having AstTapi installed and configured in all workstations.
2013 Jul 17
writing multiple lines to a file
HI, May be this helps: printer1<- file("out1.txt","w") write(sprintf("This is line %d.\n",1),printer1,append=TRUE) write("This is line 2",printer1,append=TRUE) close(printer1) #or ?printer1<- file("out1.txt","w") writeLines("This is line",con=printer1,sep="\n") writeLines("This is line 2",con=printer1) ?close(printer1) A.K. Hello, I am trying to wrote multiple lines to a file, but I only seem to be able to write the last line. printer = file("out.txt") write(sprintf("...
2017 Dec 29
Writing text files out of a dataset
...elps, Rui Barradas On 12/29/2017 2:31 PM, Luca Meyer wrote: > Hello, > > I am trying to run the following syntax for all cases within the dataframe > "data" > > d1 <- data[1,c("material")] > fileConn<-file("TESTI/d1.txt") > writeLines(d1, fileConn) > close(fileConn) > > I am trying to use the for function: > > for (i in 1:nrow(data)){ > d[i] <- data[i,c("material")] > fileConn<-file("TESTI/d[i].txt") > writeLines(d[i], fileConn) > close(fileConn) > } &g...
2009 Apr 14
Controlling widths in write.fwf()
Is there a way to handle the widths of values being written to a file using wrtite.fwf() ? For example, I used read.fwf(file, width.vector) to read a file. After making the necessary data manipulation, I want to write the data to a new file in the same width.vector format. Is there a way to specify this? Thanks in Advance Aparna [[alternative HTML version deleted]]
2004 Jun 03
printing tabular data nicely
Hi R-heplers, I would like to print various matrices, dataframes, tables, etc to files, preferably nicely formatted postscript for import into papers. Is there a way to do this? I know ?cat, ?writeLines, ?format, ?paste. But I am not sure of a good combination of these in order to get a nice looking table of information. Any ideas? I guess I want (almost) publication ready output, just like you get for "plot"... (I *don't* want to print to the console, btw) Thx again. W
2003 Nov 06
Summary: How to represent pure linefeeds chr(10) under R for Windows use "binary" connection mode (will not replace \n by \r\n) and explicit specification of line ending as "\r\n". Testing with these gave the following results: ## write.table / read.table: a bit inconsistent: need text connection to read and binary connection to write ## writeLines / readLines: readLines misses a sep= parameter to properly read in such data ## writeChar / readChar: OK Thanks again and Best regards Jens Oehlsch?gel ## Details filename <- "c:/tmp/c2.csv" ## write.table / read.table: a bit inconsistent: need binary conn...
2010 Apr 15
Add header line to large text file
...dLines portion takes quite a long time. Is there a way around reading the lines? I'm working on Windows XP. Zev input<-readLines("c:/junk/forR.csv") input<-c(c('"a", "b", "c", "d", "e", "f"'), input) writeLines(input, "c:/junk/forRfix.csv") -- Zev Ross ZevRoss Spatial Analysis 120 N Aurora, Suite 3A Ithaca, NY 14850 607-277-0004 (phone) 866-877-3690 (fax, toll-free) zev at
2008 Aug 18
use expression() in a loop
Hi all, I want to do plot() in a loop to make 10 graphs, so I have some code like for (i in 1:10) { plot(... ... , xlab = expression(g[i]) ) } I expect g_1, g_2, and so on appear on x labels, but it simply prints g_i for each graph. Does anybody know how to get around this problem? Thanks. NL
2013 Oct 23
interrupting Sweave leaves open sink connection
...eave()ing.", "", "<<>>=", "for (i in seq_len(1e6)) {", " if (i %% 1000 == 0) print(sprintf(\"%i\", i))", " Sys.sleep(0.5)", "}", "@", "", "\\end{document}") f <- tempfile() writeLines(txt, f) Sweave(f) ## 2) ## now no printed output is seen print(1) ## sink(NULL) ## now it's back print(1) ## [1] 1 ## tidy up ## unlink(f) -- Michael Sumner Hobart, Australia e-mail: mdsumner at
2006 Feb 17
A unique 'click to call' project - Could use some advice
Hello List, I work for an IP communication provider in upstate NY as the engineer assisting our technical support team. We provide a number of different Telco systems to residential subscribers; and in an effort to more effectively trouble shoot termination problems I came up with the idea of creating a click to call system that will allow our agents to effortlessly place test calls. On a
2008 Jan 11
communicate from Rterm
...9;t ''----- execute the command line directly, so I create a .bat exestr = "Rterm --restore --save --args " & ds & " < > out.txt" Set fs = CreateObject("Scripting.FileSystemObject") Set a = fs.CreateTextFile("rpcd.bat", True) a.writeline (exestr) a.Close ret = Shell("rpcd.bat") MsgBox ("wait for about 5 seconds as the script runs asynchronously") End Sub ************************** ds=commandArgs(T)[1] ans=f.repo(ds) q("yes")
2012 Jan 18
use of UTF-8 \uxxxx escape sequences in function arguments
While preparing a function that contained non-ASCII characters for inclusion into a package, I replaced all non-ASCII characters with UTF-8 escape sequences (using \uxxxx) in order to make the package portable (and adhere to "R CMD check"). What I didn't expect: when one uses UTF-8 escape sequences in function arguments, one needs to use UTF-8 escape sequences when calling the
2020 Oct 20
write.csv covert Åland to <c5>land
You don't say, but I'd guess you're using Windows. In your code page, the character ? is probably not representable. At some point in the sequence of operations involved in printing the dataframe R puts the string into the native encoding, and since that's impossible on your system, it substitutes the <c5> instead. The fact that you can sometimes display it is because
2012 Nov 04
what is the function naming convention?
...ackages" states that it depends on the classes and instances. I couldn't find more hints. And there's more: - using underscore characters: check_tzones, Cstack_info, R_system_version (etc) - using interCapping: closeAllConnections, rawToChar, rowSums, toString, tryCatch, writeLines (etc) - using dots and intercapping: as.Date, julian.Date, toString.default (etc) So, an entire zoo of function names. Did I miss a system, or is it arbitrary (within the set of accepted characters) ? What is the best way to name one's own functions? Thanks in advance, Franklin...
2009 Dec 11
Creating bibtex file of all installed packages?
Hi is there an easy and fast way, to generate a BibTeX file of all installed / loaded packages and R? I know about toBibtex(citation()) to extract the BibTeX for a single package, but how can I generate a file containg citations for all installed / loaded packages? Cheers, Rainer -- NEW GERMAN FAX NUMBER!!! Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
2017 Sep 06
post_processor in rmarkdown not working
...etitle", text) #nolint text <- c( text[1:(maketitle - 1)], "\\begin{fmtext}", text[(maketitle + 1):(end_first_page - 1)], "\\end{fmtext}", "\\maketitle", text[(end_first_page + 1):length(text)] ) writeLines(enc2utf8(text), output_file, useBytes = TRUE) } output_file } output_format( knitr = knitr_options( opts_knit = list( width = 60, concordance = TRUE ), opts_chunk = opts_chunk, knit_hooks = knit_hooks ), pandoc = pandoc_options(...
2008 Oct 10
Creating a new connection type
Hello. I have an instrument, actually a step motor indexer that I want to drive from R. It uses an RS-232 connection. I already have a few C subroutines that I access from R but I would like to be able use R's connection related functions - readLines, writeLines, cat, read.table, etc - directly. Does any one have any suggestions on how a I should proceed to create a new connection type? Is it even possible without going down to R's guts? Thanks for any help Paulo Jabardo Novos endere?os, o Yahoo! que voc? conhece. Crie um email novo com a su...
2006 Jun 27
reading a matrix from a file
Hello everyone, I'm writting a little script that will read a matrix from a file i.e. 0,.11,.22,.4 .11,0,.5,.3 .22,.5,0,.7 anb so on and will then calculate some standard stats for nets (i.e. centralization, degree, etc). So far I have opened the file and read the contents, however I' m using readLines(filename) to read the file and it returns it as
2007 Apr 06
regular expression
Dear R-List, I have a great many files in a directory and I would like to replace in every file the character " by the character ' and in the same time, I have to change ' by '' (i.e. the character ' twice and not the unique character ") when the character ' is embodied in "....." So, "....." becomes '.....' and