Displaying 20 results from an estimated 1000 matches similar to: "Memory problems when using ifelse"
2009 Aug 18
2
Embedding lists in matrices and matrices in lists
Hi,
I'm new to programming, new to R and even new to mailing lists so please
be patient with me. I need to manage many matrices generated by an R
program. These matrices have different dimensions and I'd like to group
them somehow. The best way would be to have a big matrix (let's call it
database) where every element database[x,y] consists of a list of
matrices that all have the
2009 Oct 15
4
Subset returning unexpected result
Dear all,
I am attempting to subset a data frame based on a range of latitude values. I want to extract the values of 'interception' where latitude ranges between 50 and 60. I am doing this using the following code, yet it doesn't return the results I expected:
> test <- subset(int1901, Latitude>=50 & Latitude <60, select=c(Latitude, Interception))
> head(test)
2013 Feb 23
2
assign index to colnames(matrix)
Hello, I’m trying to follow the syntax of a script from a journal website. In order to create a regression formula used later in the script, the regression matrix must have column names “X1”, “X2”, etc. I have tried to assign these column names to my matrix ScoutRSM.mat using a for loop, but I don’t know how to interpret the error message. Suggestions? Thanks, Paul
2009 Oct 12
1
Using diff, ifelse on zoo object
Hi,
I'm having an issue when using diff and ifelse on a zoo object.....
x.Date <- as.Date("2003-02-01") + c(1, 3, 7, 9, 14) - 1
x <- zoo(rnorm(5), x.Date)
x.POS <- c(0,0,0,1,1)
x<- merge(x,x.POS)
x
x x.POS
2003-02-01 -0.1858136 0
2003-02-03 -1.3188533 0
2003-02-07 0.2709794 0
2003-02-09 -1.4915262 1
2003-02-14
2018 May 15
0
Systemfit
... and the mailing list is picky about attachments... whatever you attached did not conform to the stringent requirements mentioned in the Posting Guide. Pasting the code right into the email is usually safest, though you DO have to post using plain text (as the Posting Guide indicates) or your code may get mangled by the automatic html format removal.
On May 15, 2018 7:04:31 AM PDT, Bert Gunter
2012 Jun 23
9
[PATCH 0/5] btrfs: lz4/lz4hc compression
WARNING: This is not compatible with the previous lz4 patchset. If you''re using
experimental compression that isn''t in mainline kernels, be prepared to backup
and restore or decompress before upgrading, and have backups in case it eats
data (which appears not to be a problem any more, but has been during
development).
These patches add lz4 and lz4hc compression
2006 Jun 09
1
X'W in Matrix
Hi!
I have used the Matrix package (Version: 0.995-10) successfully
to obtain the OLS solution for a problem where the design matrix X is
44000x6000. X is very sparse (about 80000 non-zeros elements).
Now I want to do WLS: (X'WX)^-1X'Wy
I tried W=Diagonal(length(w),w) and
wX=solve(X,W)
but after various minutes R gives a not enough
memory error (Im using a 64bit machine with 16Gigs
2018 May 15
1
Systemfit
Unless there is good reason not to, always cc the list -- there are lots of
smarter folks than I on it who can help.
I may or may not have time to look at this. Hopefully someone else will.
-- Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip
2010 Apr 05
3
Creating R packages, passing by reference and oo R.
Dear All,
I would like some advice on creating R packages, passing by reference and oo R.
I have created a package that is neither elegant nor extensible and rather cumbersome (it works). I would like to re write the code to make the package distributable (should it be of interest) and easy to maintain.
The package is for Bayesian model determination via a reversible jump algorithm and has
2005 Nov 15
1
cannot.allocate.memory.again and 32bit<--->64bit
hello!
------
i use 32bit.Linux(SuSe)Server, so i'm limited with 3.5Gb of memory
i demonstrate, that there is times to times a problem with allocating of
objects of large size, for example
0.state (no objects yet created)
------------------------------------
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 162070 4.4 350000 9.4 350000
2006 May 16
2
Large database help
Hello all.
I have a large .txt file whose variables are fixed-columns,
ie, variable V1 goes from columns 1 to 7, V2 from 8 to 23 etc.
This is a 60GB file with 90 variables and 60 million observations.
I'm working with a Pentium 4, 1GB RAM, Windows XP Pro.
I tried the following code just to see if I could work with 2 variables
but it seems not possible:
R : Copyright 2005, The R Foundation
2007 Mar 28
2
Suggestion for memory optimization and as.double() with friends
Hi,
when doing as.double() on an object that is already a double, the
object seems to be copied internally, doubling the memory requirement.
See example below. Same for as.character() etc. Is this intended?
Example:
% R --vanilla
> x <- double(1e7)
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 234019 6.3 467875 12.5 350000 9.4
Vcells 10103774 77.1
2005 Dec 14
2
The fastest way to select and execute a few selected functions inside a function
Dear useRs?
I have the following problem! I have a function that calls one or more
functions, depending on the input parameters. I am searching for the fastest
way to select and execute the selected functions and return their results in
a list. The number of possible functions is 10, however usually only 2 are
selected (although sometimes more, even all).
For examples, if I have function
2008 Mar 24
1
Cannot allocate large vectors (running out of memory?)
Hi.
As shown in the simplified example below, I'm having trouble allocating
memory for large vectors, even though it would appear that there is more
than enough memory available. That is, even with a memory limit of 1500 MB,
R 2.6.1 (Win) will allocate memory for a first vector of 285 MB, but not for
a second vector of the same size. Forcing garbage collection does not seem
2011 Jan 17
1
isoreg memory leak?
I believe there is a memory leak in isoreg in the current version of R,
as I believe the following shows
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 120405 3.3 350000 9.4 350000 9.4
Vcells 78639 0.6 786432 6.0 392463 3.0
> for(k in 1:100) {
+
+ y <- runif(10000)
+ isoreg(x,y)
+ }
> rm(x)
> rm(y)
> gc()
used (Mb) gc
2005 Jul 12
1
allocation of large matrix failing
Hello, this is probably something silly which I am doing, but I cannot
understand why this allocation is not happening.
Here is a my C code which tries to allocate a list of size 333559, and
then a matrix of size 8*333559
I thought I might be running into memory problems, but R is not even
using that much (I start R with
more memory and it stays constant) Also, I start R as I normally do and
I
2006 May 05
1
converting code into a function - seperating a data frame with n columns into n individual vectors
I have many very large dataframes with 20 columns
each.
In order to conserve memory, I wish to separate the
data frame into 20 vectors, each named the name of the
dataframe followed by .1,.2,.3
.20.
(For example purposes, one data frame is named
?testa?.)
e.g. testa.1, testa.2, testa.3
I have written the code to do this (see below). I am
trying to convert this into a function that I can
reuse.
2008 Oct 04
3
environment and scoping
I haven't quite figured out how I can change the environment of a function.
I have a main function and want to use different auxillary functions, which I supply as parameter (or names). What I want to do is something like this:
main.fun=function(aux.fun,dat){
x <- 1
fun.dat()
}
aux.fun.one=function(){
mean(dat)+x
}
aux.fun.one=function(){
median(dat)-x
}
I don't want to
2008 Jul 20
2
Erro: cannot allocate vector of size 216.0 Mb
Please,
I have a 2GB computer and a huge time-series to embedd, and i tried
increasing memory.limit() and memory.size(max=TRUE), but nothing.
Just before the command:
> memory.size(max=TRUE)
[1] 13.4375
> memory.limit()
[1] 1535.875
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 209552 5.6 407500 10.9 350000 9.4
Vcells 125966 1.0 786432 6.0 496686 3.8
2006 Jan 26
1
maximizing available memory under windows XP
I have always been using ebitbin to set the 3GB switch in the windows
binary, but version 2.2.1 has this set as default (which I verified using
dumpbin). However, when I generate junk data to fill up my memory and read
the memory usage using gc(), it seems that I am not getting as good results
with 2.2.1 patched as I was with 2.2.0 after I edited the header. Under R
2.2.0 I was able to use over