Displaying 20 results from an estimated 2000 matches similar to: "Memory usage and limit"
2011 Apr 04
2
reading from text file that have different rowlength and create a data frame
Hi R-experts
I have many text files to read and combined them into one into R that are
output from other programs. My textfile have unbalanced number of rows for
example:
;this is example
; r help
Var1 Var2 Var3 Var4 Var5
0 0.05 0.01 12
1 0.04 0.06 18 A
2 0.05 0.08 14
3 0.01 0.06
2017 Jun 04
1
nmax parameter in factor function
I'll go just a bit "fer-er." It appears the anomaly -- I hesitate to
call it a bug -- is in the C code for duplicated.default():
> duplicated(letters[1:10],nmax=10)
[1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
> duplicated(letters[1:10],nmax=9)
[1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
> duplicated(letters[1:10],nmax=8) ## for
2017 Jun 04
0
nmax parameter in factor function
Well, you won't like this, but it is kind of wimpily (is that a word?)
documented:
If you check the code of factor(), you will see that nmax appears as
an argument in a call to unique(). ?unique says for nmax, "... see
duplicated" . And ?duplicated says:
"If nmax is set too small there is liable to be an error: nmax = 1 is
silently ignored."
So sometimes you get an error
2017 Jun 04
2
nmax parameter in factor function
I have been trying to understand how the argument 'nmax' works in
'factor' function. R-Documentation states - "Since factors typically
have quite a small number of levels, for large vectors x it is helpful
to supply nmax as an upper bound on the number of unique values."
In the code below what is the reason for error when value of nmax is
24. Why did the same error not
2010 Jun 18
3
Use of .Fortran
I have no experience with incorporating Fortran code and am probably
doing something pretty stupid.
I want to use the following Fortran subroutine (not written by me) in
the file SSFcoef.f
subroutine SSFcoef(nmax,nu,A,nrowA,ncolA)
implicit double precision(a-h,o-z)
implicit integer (i-n)
integer l,i,nmax
double precision nu,A(0:nmax,0:nmax)
A(0,0) =
2010 Jun 18
3
Use of .Fortran
I have no experience with incorporating Fortran code and am probably
doing something pretty stupid.
I want to use the following Fortran subroutine (not written by me) in
the file SSFcoef.f
subroutine SSFcoef(nmax,nu,A,nrowA,ncolA)
implicit double precision(a-h,o-z)
implicit integer (i-n)
integer l,i,nmax
double precision nu,A(0:nmax,0:nmax)
A(0,0) =
2013 Oct 30
1
unique(1:3,nmax=1) freezes R
Dear all,
I was playing around with factor contrasts, and found the argument nmax on function factor. When using nmax=1, R froze completely, and I had to close it from task manager. After some debugging, I found that the problem is actually in unique-function, where the internal unique function is called:
.Internal(unique(x, incomparables, fromLast, nmax))
More generally, it looks like
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,
2012 Nov 12
2
how to enter a string value
hi,
I want to know just enter a string value
entering a numeric value is make with the function scan () or scan (nmax =
..)
but it does not work for string
my goal is to enter three string: name and surname and date of birth
I try with this code but it shows me errors
print ("enter the name")
name <- scan (nmax = 1)
print ("enter the first name")
firstName <- scan
2011 Mar 19
2
problem running a function
Dear people,
I'm trying to do some analysis of a data using the models by Royle & Donazio
in their fantastic book, particular the following function:
http://www.mbr-pwrc.usgs.gov/pubanalysis/roylebook/panel4pt1.fn
that applied to my data and in the console is as follows:
> `desman.y` <- structure(c(3L,4L,3L,2L,1L), .Names = c("1", "2", "3",
2005 Jun 13
1
memory allocation problem under linux
I have some compiled code that works under winXp but not under linux (kernel
2.6.10-5). I'm also using R 2.1.0
After debugging, I've discovered that in this code:
#define NMAX 256
long **box;
...
box = (long **)R_alloc(NMAX, sizeof(long *)); //<---HERE THE SIGSEGV
for (i=0; i<NMAX; i++) box[i] = (long *) R_alloc(NMAX, sizeof(long));
inside the *first* call to the
2005 Jun 12
1
memory allocation problem under linux
I have some compiled code that works under winXp but not under linux (kernel
2.6.10-5). I'm also using R 2.1.0
After debugging, I've discovered that this code:
#define NMAX 256
long **box;
...
box = (long **)R_alloc(NMAX, sizeof(long *));
gives a null pointer, so subsequent line:
for (i=0; i<NMAX; i++) box[i] = (long *) R_alloc(NMAX, sizeof(long));
gives a SIGSEGV signal.
2011 Nov 10
2
performance of adaptIntegrate vs. integrate
Dear list,
[cross-posting from Stack Overflow where this question has remained
unanswered for two weeks]
I'd like to perform a numerical integration in one dimension,
I = int_a^b f(x) dx
where the integrand f: x in IR -> f(x) in IR^p is vector-valued.
integrate() only allows scalar integrands, thus I would need to call
it many (p=200 typically) times, which sounds suboptimal. The
2012 Feb 29
1
Replace back slashes with forward slashes?
Hello, All:
What can people tell me about converting back slashes to forward
slashes in character strings?
Several years ago, Prof. Ripley provided a solution, which I lost
and have not been able to find.
Below please find a function to do this. I do not find this very
satisfactory, however, because it uses "scan" and therefore operates on
an input not a
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 Feb 08
2
Applying lm to data with combn
http://www.nabble.com/file/p15359204/test.data.csv
http://www.nabble.com/file/p15359204/test.data.csv test.data.csv
Hi,
I have used apply to have certian combinations, but when I try to use these
combinations I get the error
[Error in eval(expr, envir, enclos) : object "X.GDAXI" not found]. being a
novice I donot understand that after applying combination to the data I cant
access
2012 Jun 10
1
Convert "\" to "/"?
Hello, All:
I have for years copied an address like "C:\Program
Files\R\R-2.15.0\library\MASS\scripts" from Windows Explorer into R,
then manually replaced "\" with "/". I have a function to automate this
added to the development version of "sos". However, it generates a
warning in "R CMD check" ("parse error: unexpected
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 <-
2006 Jul 13
1
writeForeignSAS and potential extensions
Dear R-devel,
I've made some potential extensions to writeForeignSAS
in 'foreign' that I wanted to pass along if anyone is
interested. I've attached the diff -u output against
the version found in foreign_0.8-15 and an .R file
with my changes. (In this .R file, the function is named
writeForeignSAS7 to simplify testing/comparisons.)
I've tried to alter the current