Displaying 20 results from an estimated 2000 matches similar to: "error in scan(..."
2011 Aug 31
1
Error in setwd(dir) : cannot change working directory
Hello, I got some of the R source code and not being able to Run it in
RStudio.
I get the error:
Error in setwd("dir") :
cannot change working directory
I have gone through forums but nothing seemed relevant to my issue.
What bugs me the most is the ("dir") that the error shows, is of those who
wrote the source code and not mine(it still sees the directory of their
2012 Dec 02
6
Warning message: In scan(file, what, nmax...)
Dear R-users,
When i try -
Data1<-read.table("/Users/kama/Analysis/GDP10.csv",header=TRUE,sep=";") i
am getting this error: Warning message: In scan(file, what, nmax, sep, dec,
quote, skip, nlines, na.strings, :
number of items read is not a multiple of the number of columns
I wonder what Iam doing wrong. i guess it is something simple, however, i do
not understand
1999 Nov 24
2
scan error (PR#342)
It seems to me the following should work (in fact, it comes from
someone's SPlus file). Instead, it reads the first 8 lines and then
spits out syntax errors. Using nlines=36 works. Using nmax does not.
Intel RH5.2 with R90.0. Debugging shows it must be internal. Jim
junk <- scan(file="",list(i=0,r1=0,r2=0,lull="",day=""),n=5*36)
1 3 5 no 1
2 1
2023 Feb 11
1
scan(..., skip=1e11): infinite loop; cannot interrupt
On Fri, 10 Feb 2023 23:38:55 -0600
Spencer Graves <spencer.graves at prodsyse.com> wrote:
> I have a 4.54 GB file that I'm trying to read in chunks using
> "scan(..., skip=__)". It works as expected for small values of
> "skip" but goes into an infinite loop for "skip=1e11" and similar
> large values of skip: I cannot even interrupt it; I
2012 Feb 09
1
scan() doesn't like '1.#IND'
Hi,
Since C++ code compiled with g++ 4.6.3 on Windows (the version included
in latest Rtools) now can produce things like '1.#IND' when writing
doubles to a file (using the << operator), I wonder whether scan()
shouldn't support those things. Right now (with recent R devel and
latest Rtools) we get errors like:
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines,
2010 Oct 04
1
Error message with scan() function
Hi Everyone,
I am new R user and am trying to learn by reading the online manual "An
Introduction to R" from the R web site. I am trying to practice using the
scan() function as explained in the manual. For this I first created three
vectors (one a character vector and two numeric one) and saved file
"input.dat" in my working directory as:
> label <- c("Bill",
2009 Nov 10
3
Error: cannot allocate vector of size...
I'm trying to import a table into R the file is about 700MB. Here's my first
try:
> DD<-read.table("01uklicsam-20070301.dat",header=TRUE)
Error: cannot allocate vector of size 15.6 Mb
In addition: Warning messages:
1: In scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, :
Reached total allocation of 1535Mb: see help(memory.size)
2: In scan(file, what,
2004 May 01
5
skip lines on a connection
Hi,
I am looking for an efficient way of skipping big chunks of lines on a
connection (not necessarily at the beginning of the file). One way is to
use read lines, e.g. readLines(1e6), but a) this incurs the overhead of
construction of the return char vector and b) has a (fairly remote)
potential to blow up the memory.
Another way would be to use scan(), e.g.
scan(con, skip=1e6, nmax=0)
2008 Aug 29
1
scan after seek in text files (PR#12640)
Full_Name: Dr. Alex Sheppard
Version: 2.7.1
OS: Linux Debian Lenny
Submission from: (NULL) (79.73.224.62)
After scanning from an open (text) connection, then seeking, then scanning
again, the second scan returns incorrect result. It looks like the first byte
scanned was from the pre-seek file position, then it continues to read from the
post-seek file position.
To reproduce:
#Put 3x3 matrix
2008 Sep 04
1
read.table error
Dear all,
I have a tab-delimited text (.txt) file which I'm trying to read into R. This file is of column format - there are in fact 3 columns and 259201 rows (including the column headers). I've been using the following commands, but receive an error each time which prevents the data from being read in:
> Jan <- read.table("JanuaryAvBurntArea.txt", header=TRUE)
Error in
2008 Jul 30
2
problem with read.table()
Hello R-User
I have a table as tab-delimited textfile (291 rows, 83 columns).
The first row are labels and the first line the variable names.
I used the following code several times with different similar tables and it
always worked.
But now:
setClass("of")
setAs("character", "of", function(from) as.ordered(from))
Classe82<-cclasses <-
2007 Mar 11
1
using scan to record user's input
I'm using scan in a script to record a series of responses of the user as
a function
of some graphs that I put up on the screen. A toy version would be,
y <- rep(NA, 3)
for (ix in seq( length(y) ) ) {
y[ix] <- scan( n = 1 )
}
However, if I include any code after this loop, for example,
y <- rep(NA, 3)
for (ix in seq( length(y) ) ) {
y[ix] <- scan( n = 1 )
}
y
I get an error
2008 Nov 04
1
Problems with scan
I have been having problems with using scan(). I searched the archives
and found someone with the same problem several years ago, but did not
find a solution.
I want to prompt the user for input, scan in that input, and then go on
to use it as a variable.
The simplest version of my program is
cat("enter m","\n")
m <- scan(n = 1, quiet = T)
m
If I enter these lines one
2008 Sep 19
4
Novice question about getting data into R
I found it easy to use R when typing data manually into it. Now I need to
read data from a file, and I get the following errors:
> refdata =
> read.table("K:\\MerchantData\\RiskModel\\refund_distribution.csv", header
> = TRUE)
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,
:
line 1 did not have 42 elements
> refdata =
>
2007 Sep 06
2
problems in read.table
Dear R-users,
I have encountered the following problem every now and then. But I was
dealing with a very small dataset before, so it wasn't a problem (I
just edited the dataset in Openoffice speadsheet). This time I have to
deal with many large datasets containing commuting flow data. I
appreciate if anyone could give me a hint or clue to get out of this
problem.
I have a .dat file
2012 May 04
2
Can't import this 4GB DATASET
Dear Experienced R Practitioners,
I have 4GB .txt data called "dataset.txt" and have attempted to use *ff,
bigmemory, filehash and sqldf *packages to import it, but have had no
success. The readLines output of this data is:
readLines("dataset.txt",n=20)
[1] " "
2014 Mar 12
2
Lectura de texto
Hola Jorge,
Algo pasa con el fichero...
He abierto el link de Dropbox, y he salvado el texto como "txt.txt" en
local.
Pruebo a abrirlo en R y...:
> scan(file="txt.txt")Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, :
scan() expected 'a real', got 'ÿþM'> getwd()[1] "C:/Users/xIs12136/Downloads"
Pruebo a abrirlo
2010 Aug 18
1
About scan
Hi folks,
I followed an online example to input data;
> x = scan(1,2,3,4,5)
Error in scan(1, 2, 3, 4, 5) :
either specify 'nmax' or 'n', but not both.
It can't work.
> x = c(1,2,3,4,5)
> x
[1] 1 2 3 4 5
It works.
Whether "scan" is replaced with "c" ?
> ?c
.....
Usage:
c(..., recursive=FALSE)
TIA
B.R.
Stephen L
2014 Mar 12
2
Lectura de texto
Hola.
Con r <- scan(txt, character(0)) creo que debiera montarse el texto carácter a carácter.
He comprobado que funciona pero no he validado la importación del texto.
Igual es un camino que lleva a alguna parte....
Un Saludo,
Miguel.
-----Mensaje original-----
De: r-help-es-bounces en r-project.org [mailto:r-help-es-bounces en r-project.org] En nombre de Carlos Ortega
Enviado el:
2014 Mar 12
3
Lectura de texto
Hola a todos,
Me gustaria leer el texto que se encuentra en
http://dl.dropboxusercontent.com/u/9601860/txt.txt
He intentado
txt <- 'http://dl.dropboxusercontent.com/u/9601860/txt.txt'
r <- scan(txt)
#Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,
:
# invalid multibyte string at '<ff><fe>M'
r <- read.table(txt, header = FALSE)