Displaying 20 results from an estimated 4000 matches similar to: "Problem with expand.grid() function"
2007 Nov 16
2
expand.grid overflows?
>cbn<-as.matrix(expand.grid( rep( list(0:1), 50)))
Error in rep.int(rep.int(seq_len(nx), rep.int(rep.fac, nx)), orep) :
invalid 'times' value
In addition: Warning message:
In rep.int(rep.int(seq_len(nx), rep.int(rep.fac, nx)), orep) :
NAs introduced by coercion
But I'm only interested in cbn matrix rows where:
cbn<- cbn[rowSums(cbn)==5,]
Is there a way to evaluate it
2009 Jun 25
2
stringsAsFactors has no impact in expand.grid()?
Hi
I have the feeling, that the argument stringsAsFactors has no impact in the
function expand.grid:
a <- c("PR", "NC", "A2", "BS")
b <- c(1, 0.5, 0.25, 0.125, 0.0625, 0.03125)
class(expand.grid(css, fscs, stringsAsFactors=FALSE)[[1]])
[1] "factor"
class(expand.grid(css, fscs, stringsAsFactors=TRUE)[[1]])
[1] "factor"
Also, when
2005 Oct 13
1
expand.grid problem
Hi all,
I want to make all possible combination from dataset below:
V1 <- c(0,1,2)
V2 <- c(0,1)
V3 <- c(0,1)
V4 <- c(0,1)
V5 <- c(0,1)
V6 <- c(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)
V7 <- c(0,1,2,3,4,5,6)
V8 <- c(0,1)
V9 <- c(0,1)
V10 <- c(0,1)
V11 <- c(0,1)
V12 <- c(0,1)
V13 <- c(0,1)
V14
2017 Jul 13
0
Quadratic function with interaction terms for the PLS fitting model?
> On Jul 13, 2017, at 10:43 AM, Bert Gunter <bgunter.4567 at gmail.com> wrote:
>
> poly(NIR, degree = 2) will work if NIR is a matrix, not a data.frame.
> The degree argument apparently *must* be explicitly named if NIR is
> not a numeric vector. AFAICS, this is unclear or unstated in ?poly.
I still get the same error with:
library(pld)
data(gasoline)
gasTrain <-
2010 Nov 24
1
segfault interest?
in a long program, I ran into
?*** caught segfault ***
address 0xdc3f9b48, cause 'memory not mapped'
Traceback:
?1: rep.int(seq_len(nx), rep.int(rep.fac, nx))
?2: rep.int(rep.int(seq_len(nx), rep.int(rep.fac, nx)), orep)
?3: expand.grid(seq_len(nx), seq_len(ny))
?4: merge.data.frame(d, ss)
?5: merge(d, ss)
?6: valid.range(opt)
?7: eval.with.vis(expr, envir, enclos)
?8: eval.with.vis(ei,
2011 Aug 30
1
"Negative length vector" error in simple merge
Hi,
I'm trying to take a vector (length almost 2,000,000) and merge it with a
data frame of the same length. I'm trying to do it solely based on index,
and not any other factors.
The vector is called "offense", and the data frame is just called "data". I
went with the simplest option:
merge(data,offense)
but it always gives me the same error:
Error in
2008 Feb 07
1
Problems reshaping data with cast()
Hi,
I'm trying to cast() some data, but keep on getting the following error...
> norm.all.melted.height <- transform(all.melted.height,
+ norm.height = value / ave(value,
SNP, Pool, FUN = max)
+ )
Warning messages:
1: In FUN(X[[147L]], ...) :
no non-missing arguments to max; returning -Inf
2: In FUN(X[[147L]],
2009 Oct 12
1
Loading data to Trellis barchart plot.
Dear all,
I have a question about loading the data to barchart plot. I know this could
be a very easy question, but I just can not get my head around.
What I need to do is to create a trellis plots barchart style (horizontal
bar), with levels of one variable (ie. variable “colour” in my example) as
ylab and frequency as xlab on each trellis plot. The trellis plots is
separated based on
2005 Jun 03
1
Need Help - Urgent
Hello,
I am a student and some really urgent help.I am using R software and while
creating a grid with eight elements its showing the error and while if i
do it with seven it says that the memory is not sufficient...
here is the line ...with the error....
> Z<-as.matrix(expand.grid(x,y,x,y,t,s,t,s))
Error in rep.int(rep.int(seq(length = nx), rep.int(rep.fac, nx)), orep) :
cannot
2017 Jul 13
4
Quadratic function with interaction terms for the PLS fitting model?
poly(NIR, degree = 2) will work if NIR is a matrix, not a data.frame.
The degree argument apparently *must* be explicitly named if NIR is
not a numeric vector. AFAICS, this is unclear or unstated in ?poly.
-- 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
2011 May 03
3
Watts Strogatz game
Hi,
I have a erdos-renyi game with 6000 nodes and probability 0.003.
g1 = erdos.renyi.game(6000, 0.003)
How to create a Watts Strogatz game with the same probability.
g1 = watts.strogatz.game(1, 6000, ?, ?)
What should be the third and fourth parameter to this argument.
--
View this message in context: http://r.789695.n4.nabble.com/Watts-Strogatz-game-tp3491922p3491922.html
Sent from the R
2008 Aug 17
1
Allocated Memory Warnings in Vista 32 bit with 4 GB (PR#12557)
Hello
I am running Windows Vista 32 with 4 GB (installed, though Windows of cours=
e only recognizes 3326 MB, as reported by Windows "My Computer")
I am running R 2.7.1
I was trying to read in a comma delimited single column CSV file, assign th=
at file to a variable ("data") and then extract a sample (assigned to "part=
ial"). I was getting memory allocation
2012 Dec 27
0
Suggestion: 'method' slot for expand.grid() (incl. diffs)
Dear expeRts,
The order in which the variables vary in expand.grid() is often unintuitive. I
would like to suggest a 'method' slot for expand.grid() which requires only very
little changes (100% backward compatible) and which allows one to control this
order. Please find attached diffs against R-devel.
Cheers,
Marius
### ./src/library/base/R/expand.grid.R
2008 Aug 18
0
Allocated Memory Warnings in Vista 32 bit with 4 GB (PR#12560)
I see no bug here. R is telling you that you have insufficient memory
available: see also ?"Memory-limits".
See also rw-FAQ Q2.9.
Note that we don't have a reproducible example and in particular have no
idea of how many columns this data frame has.
The 'R Data Import/Export' manual gives you many hints on how to do this
more efficiently, and it is referenced from the
2011 Apr 11
1
plot - kamada.kawai layout without arrows
Hi,
I am plotting a graph with kamada.kawai layout.
But I am getting direction arrows in the graphs.
Please let me know how to avoid this.
g <- watts.strogatz.game(1, 2000, 5, 0.4)
comps <- clusters(g)$membership
colbar <- rainbow(max(comps)+1)
V(g)$color <- colbar[comps+1]
png(filename)
plot(g, layout=layout.kamada.kawai, vertex.size=2, vertex.label=NA)
dev.off()
Please find
2010 Jul 25
1
Equivalent to go-to statement
Dear all,
I'm working with a code that consists of two parts: In Part 1 I'm generating
a random graph using the igraph library (which represents the relationships
between different nodes) and a vector (which represents a certain
characteristic for each node):
library(igraph)
g <- watts.strogatz.game(1,100,5,0.05)
z <- rlnorm(100,0,1)
In Part 2 I'm iteratively changing the
2012 Feb 08
2
Memory allocation problem (again!)
Dear all, I know this problem was discussed many times in forum, however
unfortunately I could not find any way out for my own problem. Here I am
having Memory allocation problem while generating a lot of random number.
Here is my description:
> rnorm(50000*6000)
Error: cannot allocate vector of size 2.2 Gb
In addition: Warning messages:
1: In rnorm(50000 * 6000) :
Reached total allocation
2012 Mar 02
3
Memory issue. XXXX
Hi everyone,
Any ideas on troubleshooting this memory issue:
> d1<-read.csv("arrears.csv")
Error: cannot allocate vector of size 77.3 Mb
In addition: Warning messages:
1: In class(data) <- "data.frame" :
Reached total allocation of 1535Mb: see help(memory.size)
2: In class(data) <- "data.frame" :
Reached total allocation of 1535Mb: see
2009 Jun 15
3
lack of memory for logistic regression in R?
Hi all,
I am getting the following error message:
> mymodel = glm(response ~ . , family=binomial, data=C);
Error: cannot allocate vector of size 734.2 Mb
In addition: Warning messages:
1: In array(0, c(n, n), list(levs, levs)) :
Reached total allocation of 1535Mb: see help(memory.size)
2: In array(0, c(n, n), list(levs, levs)) :
Reached total allocation of 1535Mb: see help(memory.size)
3:
2003 May 04
1
image of expand.grid
Hi all,
It is not clear to me why this cannot be ploted with image. Any help?
> g <- data.frame(expand.grid(x= 1:5, y= 1:5), z= rnorm(25))
> image(g)
Error in image.default(g) : increasing x and y values expected
> is.list(g)
[1] TRUE
> g$x
[1] 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5
> g$y
[1] 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5
>
Thanks in