Displaying 20 results from an estimated 30000 matches similar to: "errors handling"
2007 Sep 17
1
Importing a dataset
? stato filtrato un testo allegato il cui set di caratteri non era
indicato...
Nome: non disponibile
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20070917/f6d8d606/attachment.pl
2005 Oct 21
2
read data from pdf file
Hi, I'm trying to read data from a PDF file.Is it possible to do it with R? Thanks, Marco
[[alternative HTML version deleted]]
2005 Apr 02
2
Amount of memory under different OS
Hi,
I have a problem: I need to perform a very tough analysis, so I would like
to buy a new computer with about 16 GB of RAM. Is it possible to use all
this memory under Windows or have I to install other OS?
Thanks,
Marco
2005 Oct 26
1
replacement in a dataframe
Hi,I want to replace some elements of a dataframe "a", using 2 index vectors ("x" and "y") and a vector of replacement ("z") of the same length of "x" and "y".
I've tried a[cbind(x,y)]<-z, but it doesn't work.How can I do it in a simply way?Thanks,
2011 Dec 24
2
readLines errors
Hi All,
I met a problem using readLines function to return the data from Google
maps.
readLines(url("
http://ditu.google.cn/maps/geo?q=+qianshuichong,+guichi+anhui,+CN&output=csv&key=ABQIAAAAq8Fnd_oUka-7RdS6BrD7GBTqeABoQuNTXS36G_rkiwQnKRW6GBTkns8JpKz6y6dScgB8827dlddUlg"),
n=1, warn=FALSE)
[1] "200,4,30.6528380,117.4872250"
The above code is ok because the
2009 May 11
1
R errors when trying to read a file
Colleagues,
I have encountered a problem in version 2.9 of R, running in both
Vista and OS X. My code is quite lengthy but the critical line is:
if (file.exists(FILENAME)) readLines(FILENAME))
This triggers the error:
Error in file(con, "r") : cannot open the connection
Calls: readLines -> file
Execution halted
The file that it is reading is being created on the fly, then
2009 Jan 23
2
Write to multiple connections or multiple text files
Hi all,
I want to modify a large number of text files (ca 4000) by replacing a
value found on a particular line in them with a value from an R object.
For a single file I would normally use:
con<-file ("foo.txt", open="r+")
content<-readLines(con)
content[n]<-"test"
writeLines(content,con)
close(con)
For repeating this for several files I can
2008 Nov 20
1
extracting data from a list of unformatted text files
Hi,
I want to extract information from a number of text files in a folder. The files are named as : 82534.txt, 82555.txt, 8282787.txt etc.
I give below a sample of the kind of the information in the text file :
########
#(a lot of preceding text)
2008-10-01????? 06:30:12??? ??? ??? ??? 2 of 3
page
#(some lines of text - varies from file to file)
sekvens??? 890
# lines of text
sNo???? start???
2007 Dec 19
1
unexpected behavior from gzfile and unz
I get unexpected behavior from "readLines()" and
"scan()" depending on how the file is opened with
"gzfile" or "unz". More specifically:
> file <- gzfile("file.gz")
> readLines(file,1)
[1] "a\tb\tc"
> readLines(file,1)
[1] "a\tb\tc"
> close(file)
It seems that the stream is rewound between calls to
readLines.
2018 May 26
2
Buffering in R 3.5 connections causes incorrect data in readChar
I noticed an issue where readChar does not return the correct value after a
call to readline. It appears that readChar is not aware of the buffering,
so it reads from the end of the buffer, rather than the current position in
the file. This is a significant change of behavior from R-3.4.4.
Below is a test case that I used to home in on the problem.
---
p<-"test2.txt"
2008 Nov 21
1
capturing stderr/stdout
Hi,
I have an application in perl that prints some output to either stderr
or stdout.
Here's an example:
# tmp.pl
print STDERR "starting iterator\n";
for(my $i = 0; $i < 1000000; $i++) {
print $i . "\n";
}
# tmp.R
con <- pipe("perl tmp.pl")
r <- readLines(con, n = -1)
close(con)
However, the second line stalls until the perl for-loop finishes.
2004 Jan 12
1
ReadLines does not give results with urls
Hello,
I am using R version 1.8.1 on a linux machine (Suse 8.2.).
I have problems to use readLines() with urls.
This seems to be a problem with our proxy-server.
Downloading files work with download.file() with wget but not without:
> download.file(url = "http://cran.r-project.org/src/contrib/PACKAGES", destfile = "test.txt", method = "wget", cacheOK = FALSE)
2011 Oct 03
2
file input with readLines
I am using readLines to read a fairly large ASCII file. readLines reads
a fixed number of lines, then other R code processes the data, then
readLines reads the same number of lines again, then other R code
processes the data, then ....
Sort of like:
conn<-file('filename','r')
for (chunk in 1:100000) {
Lines<-readLines(conn,n=25)
# process "Lines"
}
2018 May 29
1
Buffering in R 3.5 connections causes incorrect data in readChar
Tomas,
Thank you for the explanation. I see in the documentation: "These functions
are intended to be used with binary-mode connections." So I see how using
it on a text connection is undefined, and not a bug. An error or warning
when attempting to use a it on a text connection would be helpful
considering how the behavior has changed in R-3.5.
On Tue, May 29, 2018 at 3:09 AM, Tomas
2015 May 14
2
Reading exit code of pipe()
The difference in the return value of close(pipeConnectionObject)
seems to depend on whether the pipe connection was opened via
the pipe() or open() functions (close() returns NULL)
> con <- pipe("ls")
> open(con, "r")
> readLines(con, n=1)
[1] "1032.R"
> print(close(con))
NULL
> con <- pipe("ls", "r")
2024 Oct 25
1
readLines() and unz() and non-empty final line
Hi again,
The unz connection is non-blocking by default. I checked do_unz which calls
R_newunz which calls init_con and the only place in any of those functions
that sets 'blocking' is init_con which sets it to FALSE:
https://github.com/wch/r-source/blob/0c26529e807a9b1dd65f7324958c17bf72e1de1a/src/main/connections.c#L713
I'll open an issue on R-bugzilla and see if they're
2018 May 10
2
readLines() behaves differently for gzfile connection
When I read a .gz file with readLines() in 3.4.3, it returns text (and a
warning). In 3.5.0, it gives a warning, but no text. Is this expected
behavior or a bug?
3.4.3:
> source_file = "1k_annotation.gz"
> readfile_con <- gzfile(source_file, "r")
> readLines(readfile_con, n = 5)
[1] "#chr\tpos\tref\talt\t
<truncated output here>
Warning message:
In
2018 Apr 26
2
readLines() for non-blocking pipeline behaves differently in R 3.5
The issue is that readLines() tries to seek (for reasons I don't
understand) in the non-blocking case, but silently fails for "stdin"
since it's a stream. This confused the buffering logic. The fix is to
mark "stdin" as unable to seek, but I do wonder why readLines() is
seeking in the first place.
Anyway, I'll get this into patched ASAP. Thanks for the report.
2018 Jun 04
2
encoding argument of source() in 3.5.0
On R 3.5.0 (Mac)
The issue appears when using the default (libcurl) method and specifying the encoding
Note that using method='internal' causes a segfault if used in conjunction with encoding. (and works when encoding is not set)
urlR <- "http://home.versanet.de/~s-berman/source2.R"
# works
url_default <- url(urlR)
scan(url_default, "")
# Read 7 items
# [1]
2003 Jul 11
2
unz()
I am having problems getting the unz() function to work as a connection to
start reading a file...
z <- unz("c:/temp/stoxx.zip", "close_tmi_components.txt", "r")
readLines(z,2)
yields the following problems:
> z <- unz("c:/temp/stoxx.zip", "close_tmi_components.txt", "r")
Error in unz("c:/temp/stoxx.zip",