Displaying 20 results from an estimated 1000 matches similar to: "textConnection taking a long time to open a big string"
2008 Dec 16
0
socket server, textConnection and readLines
Hello;
This is bit long email but hope someone can guide me.
I have questions regarding socket, readLines and textConnection. I am
not sure if my code is efficient (due to textConnection) and how to
handle client disconnect and restart of the socket server in R.
I have a huge(3.5+G) text file on machine 'A', which I want to process
on machine 'B' using read.table (one line or a
2011 Mar 10
1
about textConnection
I need read a table in a string with special format. I used read.csv and textConnection function.
But i am confuse about textConnection by follow code.
case A: It is OK£¡
str0 <- '{"abc",{"def","X,1&Y,2&Z,3"}}'
str1 <- strsplit(str0,'"')[[1]][6]
str2 <- gsub("&","\n", str1)
con <-
2014 Feb 04
0
capture.output(): Using a rawConnection() [linear] instead of textConnection() [exponential]?
I've noticed that the processing time for the default capture.output()
grows exponentially in the number of characters outputted/captured.
The default settings sinks to a temporary textConnection(). When
instead sinking to a rawConnection(), the processing time becomes
linear. See below example and attached PNG figure [also at
2010 Aug 16
2
when to use textConnection ??
Hello.
I don't uderstant when to use textConnection and when not.
Some examples do it, some not.
I've even seen something like
con <- textConnection(rev(rev(ReadLines('data.txt'))[-(1:2]))
data <- read.table(con)
close(con)
--
View this message in context: http://r.789695.n4.nabble.com/when-to-use-textConnection-tp2327132p2327132.html
Sent from the R help mailing list
2010 May 19
1
apparent problems with the textConnection command
Dear list,
In my experiments in reading in text data, I have?obtained some peculiar results.?I would appreciate any help in understanding these results. Consider the following code :
## Reading in text data from a text file
### the first line of file f1.txt contains the text :??? c:\Rtools\bin;c:\Rtools\perl\bin;c:\Rtools\MinGW\bin;
f1<-file("C:\\Ex\\f1.txt")
c1<-readLines(f1,1)
2002 Jun 21
1
textConnection appears to be slow
I was trying to read in a file and delete lines that did not have the
correct
number of fields on them. I was reading the file as one character vector
per line
using 'scan' with sep='\n'. I was then using 'count.fields' with
'textConnection' to the object I just read in.
I thought at first the system was locked up, but further testing showed
that the
2007 May 15
3
textConnection
hello,
I don't understand what's happen just before the textConnection function runs good but now it doesn't run
> Line[1]
[1] "if C325=. then C743=(C152/C103)*100| else C743=(C152/C325)*100"
> textConnection(Line[1])
Erreur dans textConnection(Line[1]) : toutes les connexions sont utilisées
why R display that?
2017 Aug 08
0
Problem with serialization via readRDS() on a textConnection()
Hi All,
I had working code under R v3.2 that serialized an object, stored the
serialized object in a database, and then successfully retrieved and
hydrated that object.
I recently updated to R v3.4.1 and the same code now fails.
Here is the code in question (simplified), and the resulting error:
> zz = textConnection('tempConnection', 'wb')
> saveRDS(c("a",
2017 Aug 09
1
Problem with serialization via readRDS() on a textConnection()
(Sorry for not linking to your message; I accidentally deleted the
original copy of your message.)
Your code
> zz = textConnection('tempConnection', 'wb')
> saveRDS(c("a", "b", "c"), zz, ascii = TRUE)
> serialized_obj = paste(textConnectionValue(zz), collapse='\n')
> readRDS(textConnection(serialized_obj))
Error in
2005 Mar 22
1
I modify my question in "textconnection output"
dear ALL-R-helper:
I modify my question in "textconnection output":
I wrote one function in Rgui:
output <- function(y){
x <- textConnection("foo","w")
sink(x)
a <-5
b <-6
z <-a*b
z
e <-"spss"
h <-c(1,2,3)
ls()
r<-c("s","p","s","s")
p<-list(1:10)
p
y <- foo
sink()
2001 Nov 01
1
textConnection
List Members,
I am using R 1.3.1 for windows and trying to capture the output of some
summaries using textConnection. I then want to incorporate the text with
summary graphics output. The code below works (captures the output) when it is
not used in a loop or function. When placed in a loop or function, the cat
outputs are captured to 'foo' but the summary outputs are not. The
2008 Oct 12
2
proper use of textConnection
Colleagues,
Using R2.7.0 in OS X, I am having trouble understanding the command
textConnection. My situation is as follows:
1. I am trying to read a lengthy file (45000 lines) that has headers
~ every 1000 lines. read.table (or its variants) fail because of the
recurrent headers.
2. My present approach is the following:
a. use readLines to read the file, save as an array
b. use grep
2009 Oct 19
1
source and textConnection
Is this warning given on purpose?
> myconn<-textConnection("print(11*11)")
> source(myconn)
[1] 121
Warning message:
In source(myconn) : argument 'encoding = "native.enc"' will be ignored
Could it be omitted, since the docs state that encoding is only use if
the corresponding argument is a file name or url?
--
Erich Neuwirth, University of Vienna
2008 Apr 29
2
reproducible segmentation fault caused by textConnection()
Dear all,
It seems that textConnection() can trigger a segmentation fault. The
following script (using two large loops) makes this bug reproducible:
for (i in 1:10000) {
z=textConnection(NULL,open='w')
for (j in 1:100) {
write(runif(1)*1e6,file=z)
write('\n',file=z)
}
close(z)
}
The bug could be reproduced on R-2.6.1, R-2.7.0 and on the latest
R-devel
2009 May 12
3
What's the best way to tell a function about relevant fields in data frames
Hi list,
I have a function that detects saccadic eye movements in a time series
of eye positions sampled at a rate of 250Hz. This function needs
three vectors: x-coordinate, y-coordinate, trial-id. This information
is usually contained in a data frame that also has some other fields.
The names of the fields are not standardized.
> head(eyemovements)
time x y trial
51
2005 Nov 23
1
smbldap-useradd.pl -a -w '%m' questions
I am still trying to troubleshoot my problem of not being able to join
computers to the domain.
I have found this comment by John Terpstra:-
>Newsgroups: linux.samba
>From: John H Terpstra <j...@samba.org> - Find messages by this author
>Date: Wed, 14 Jan 2004 00:00:17 +0100
>Curtis,
>Do not set the UID of Administrator to 0, it will break winbind use.
>Instead, use the
2004 Oct 20
0
Win XP unable to print to Linux Server
Hello, I'm running SuSE 9.1 Linux, with Samba 3.04. All of the computers are able to print to this one printer, except for this one computer. I can't seem to resolve the problem, and I'm pretty sure it's not Win XP SP2, because another computer at my workplace has the same exact setup, and is able to print.
Any help is really appreciated, thank you.
Aizat Faiz
Oct 20 12:37:09
2010 Nov 23
2
Plot two zoo object with different indexes
Dear R community, I have the following two zoo objects:
MONTHLY CPI
> plot(z)
> par("usr")
[1] 1977.76333 2011.15333 70.39856 227.03744
> z=zooreg(cpius$Value,as.yearmon("1979-11"),frequency=12)
> str(z)
?zooreg? series from Nov 1979 to Oct 2010
Data: num [1:372] 76.2 77 77.8 78.5 79.5 80.3 81.1 82 82 82.6 ...
Index: Class 'yearmon' num [1:372]
2023 Feb 17
1
[PATCH] ocfs2: fix defrag path triggering jbd2 ASSERT
code path:
ocfs2_ioctl_move_extents
ocfs2_move_extents
ocfs2_defrag_extent
__ocfs2_move_extent
+ ocfs2_journal_access_di
+ ocfs2_split_extent //sub-paths call jbd2_journal_restart
+ ocfs2_journal_dirty //crash by jbs2 ASSERT
crash stacks:
PID: 11297 TASK: ffff974a676dcd00 CPU: 67 COMMAND: "defragfs.ocfs2"
#0 [ffffb25d8dad3900] machine_kexec at ffffffff8386fe01
2012 Dec 31
3
cut ()
Hello List,
My goal is to create a 5 category variable (p1_st_data$ob_mrj_cat), based on the p1_st_data$obt_mrj_p variable, using the following code for 50 States and District of Columbia (N=51).
p1_st_data$ob_mrj_cat <- cut (p1_st_data$obt_mrj_p, quantile (p1_st_data$obt_mrj_p, (0:5/5), include.lowest=TRUE))
The issue is that, for Utah, I am getting an <NA> instead of (42,48.7] in