Displaying 8 results from an estimated 8 matches for "fileconn".
2017 Dec 29
3
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 e...
2017 Dec 29
0
Writing text files out of a dataset
...- numeric(nrow(data))
Only then comes the loop.
Hope this helps,
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...
2011 Jul 04
1
writeLines + foreach/doMC
...llapsing the locations of each
unique sequence and write the results to a file (as storing that in a table
will require 10GB mem at least)
so I wrote a function that, given a sequence id, provide the needed line to
be stored
library(doMC) # load library
registerDoMC(12) # assign the Number of CPU
fileConn<-file(paste(fq_file,"_SeqID.txt",sep=""),open = "at") # open
connection
writeLines(paste("ReadID","Freq","Seq","LOC_UG","Nb_UG_Seq",sep="\t"),
fileConn) # write header
foreach(i=1:length(uniq.Seq)) %dopar%...
2011 Apr 24
2
help with "\" in strings
...ld like to create a "\%" that can be written to a file as I am writing
a procedure to output to latex.
I can't create a "\%" and it is driving me crazy.
--------------------------------------
x = "This is a test % string"
gsub ("%", "\\%", x)
fileConn<-file("c:/biostats/test.txt")
writeLines(x, fileConn)
close(fileConn)
--------------------------------------
Any suggestions?
Thanks in advance.
--
View this message in context: http://r.789695.n4.nabble.com/help-with-in-strings-tp3470964p3470964.html
Sent from the R help mailin...
2007 Aug 27
1
fix for broken largefile seek() on 32-bit linux (PR#9883)
...d(HAVE_FSEEKO)
#define f_seek fseeko
#define f_tell ftello
#else
Index: src/include/Rconnections.h
===================================================================
--- src/include/Rconnections.h (revision 42664)
+++ src/include/Rconnections.h (working copy)
@@ -63,7 +63,7 @@
typedef struct fileconn {
FILE *fp;
-#if defined(HAVE_OFF_T) && defined(HAVE_SEEKO)
+#if defined(HAVE_OFF_T) && defined(HAVE_FSEEKO)
off_t rpos, wpos;
#else
#ifdef Win32
Index: src/main/connections.c
===================================================================
--- src/main/connections.c...
2012 Jan 06
6
cbind alternate
I have two one dimensional list of elements and want to perform cbind and
then write into a file. The number of entries are more than a million in
both lists. R is taking a lot of time performing this operation.
Is there any alternate way to perform cbind?
x = table1[1:1000000,1]
y = table2[1:1000000,5]
z = cbind(x,y) //hanging the machine
write.table(z,'out.txt)
--
-------------
2005 May 19
1
problems with truncate() with files > 2Gb under Windows (possibly (PR#7879)
...ion.
Inspecting the code, I wonder whether the lines
#if defined(HAVE_OFF_T) && defined(__USE_LARGEFILE)
off_t pos = f_tell(fp);
#else
long pos = f_tell(fp);
#endif
in the definition of file_seek() in main/connections.c should be more
along the lines of the code defining struct fileconn in
include/Rconnections.h:
#if defined(HAVE_OFF_T) && defined(__USE_LARGEFILE)
off_t rpos, wpos;
#else
#ifdef Win32
off64_t rpos, wpos;
#else
long rpos, wpos;
#endif
#endif
I compiled and tested a version of R devel 2.2.0 with the appropriate
simple change to file_seek() in...
2005 May 19
0
problems with truncate() with files > 2Gb under Windows (PR#7880)
...er the lines
>
> #if defined(HAVE_OFF_T) && defined(__USE_LARGEFILE)
> off_t pos = f_tell(fp);
> #else
> long pos = f_tell(fp);
> #endif
>
> in the definition of file_seek() in main/connections.c should be more
> along the lines of the code defining struct fileconn in
> include/Rconnections.h:
>
> #if defined(HAVE_OFF_T) && defined(__USE_LARGEFILE)
> off_t rpos, wpos;
> #else
> #ifdef Win32
> off64_t rpos, wpos;
> #else
> long rpos, wpos;
> #endif
> #endif
>
> I compiled and tested a version of R deve...