To all and sundry, near and far,
Ivan Krylov in particular
(The latter being singled out because he was so helpful the last time I
asked a question on this issue. My apologies to him if I am being a
pest.)
I have again been beset by a "stack smashing" problem when trying
to run R c
> On Jul 27, 2016, at 8:56 AM, Anamika Chaudhuri wrote:
>
>
> Y<-matrix(1:40,ncol=2)
> Y1<-Y/60 # estimates of p
>
> #print(Y1)
>
> sigma2<-
> matrix(c(var(Y1[,1]),cov(Y1[,1],Y1[,2]),cov(Y1[,1],Y1[,2]),var(Y1[,2])),2,2)
> #print(sigma2)
>
> rho<-sigma2[1,2]/sqrt(sigma2[1,1]*sigma2[2,2])
> #
Hi David,
Thanks for your response. rbind doesnot seem to work.
Here is a reproducible example
Y<-matrix(1:40,ncol=2)
Y1<-Y/60 # estimates of p
#print(Y1)
sigma2<-
matrix(c(var(Y1[,1]),cov(Y1[,1],Y1[,2]),cov(Y1[,1],Y1[,2]),var(Y1[,2])),2,2)
#print(sigma2)
rho<-sigma2[1,2]/sqrt(sigma2[1,1]*sigm
> On Jul 26, 2016, at 8:07 PM, Anamika Chaudhuri wrote:
>
> I have 100 datasets with 20 rows and 2 columns in each dataset.
> I am looking for help to produce x and y below as 1000 X 20 matrix and then
> repeat that across 100 datasets using R
>
> library(MASS)
> library(car)
>
I have 100 datasets with 20 rows and 2 columns in each dataset.
I am looking for help to produce x and y below as 1000 X 20 matrix and then
repeat that across 100 datasets using R
library(MASS)
library(car)
set.seed(1234)
library(mixtools)
library(sp)
HI,
Try:
library(reshape2)
melt(data,measure.vars=c("t1","t2"),var="ind")
A.K.
On Sunday, November 24, 2013 9:31 PM, Kristi Glover
wrote:
I was just wondering how to stack values of columns to rows. Would you give me
some idea how I can stack? I just want to stack columns 2 and 3 but not
I was just wondering how to stack values of columns to rows. Would you give me
some idea how I can stack? I just want to stack columns 2 and 3 but not
column1. The column 1 is supposed to be repeated. I was able to stack using
"stack" but I could not repeat the column 1.
For example I have da
On 15.05.2013 17:42, Fabio Berzaghi wrote:
I use to be able to see the layer names of a RasterStack by just typing
its name but now I only get this
class : RasterStack
dimensions : 70, 180, 12600 (nrow, ncol, ncell)
resolution : 0.5, 0.5 (x, y)
extent : -80, 10, 50, 85 (xmin, x
I use to be able to see the layer names of a RasterStack by just typing
its name but now I only get this
class : RasterStack
dimensions : 70, 180, 12600 (nrow, ncol, ncell)
resolution : 0.5, 0.5 (x, y)
extent : -80, 10, 50, 85 (xmin, xmax, ymin, ymax)
coord. ref. : NA
If I do pl
e-
> From: Kevin Burton [mailto:rkevinbur...@charter.net]
> Sent: Thursday, November 10, 2011 7:11 AM
> To: William Dunlap; 'Thomas Lumley'
> Cc: 'r-help'
> Subject: RE: [R] Stack trace?
>
> Will traceback() work in the error routine specified in try
bur...@charter.net
Cc: r-help
Subject: RE: [R] Stack trace?
> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of Thomas Lumley
> Sent: Wednesday, November 09, 2011 1:53 PM
> To: rkevinbur...@charter.net
> Cc: r-help
> Subj
fire, TIBCO Software
> wdunlap tibco.com
>
>> -Original Message-----
>> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
>> Behalf Of William Dunlap
>> Sent: Wednesday, November 09, 2011 3:51 PM
>> To: Bert Gunter
>> Cc: r-help
&
tfire, TIBCO Software
wdunlap tibco.com
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
> Behalf Of William Dunlap
> Sent: Wednesday, November 09, 2011 3:51 PM
> To: Bert Gunter
> Cc: r-help
> Subject: Re: [R] Stack tr
rnings, perhaps by examining the text in conditionMessage(e).
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
From: Bert Gunter [mailto:gunter.ber...@gene.com]
Sent: Wednesday, November 09, 2011 3:40 PM
To: William Dunlap
Cc: r-help
Subject: Re: [R] Stack trace?
To Bill's suggestion
:r-help-boun...@r-project.org]
> On Behalf Of Thomas Lumley
> > Sent: Wednesday, November 09, 2011 1:53 PM
> > To: rkevinbur...@charter.net
> > Cc: r-help
> > Subject: Re: [R] Stack trace?
> >
> > On Thu, Nov 10, 2011 at 10:35 AM, wrote:
> > >
> >
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
> Behalf Of Thomas Lumley
> Sent: Wednesday, November 09, 2011 1:53 PM
> To: rkevinbur...@charter.net
> Cc: r-help
> Subject: Re: [R] Stack trace?
>
> On Th
On Thu, Nov 10, 2011 at 10:35 AM, wrote:
>
> Currently I have a for loop executing functions and at the end I get a
> message like:
>
> There were 50 or more warnings (use warnings() to see the first 50)
>
> If I do what it says and type warnings(), I get 50 messages like:
>
> 2: In !is.na(x) & !
Currently I have a for loop executing functions and at the end I get a
message like:
There were 50 or more warnings (use warnings() to see the first 50)
If I do what it says and type warnings(), I get 50 messages like:
2: In !is.na(x) & !is.na(rowSums(xreg)) :
longer object length is not a
On 2010-04-01 3:53, Ken Knoblauch wrote:
Kenneth Roy Cabrera Torres une.net.co> writes:
Hi R users:
I found that I cannot stack() a data.frame with factors.
db1<-data.frame(replicate(6,factor(sample(c("A","B"),6,replace=TRUE
str(db1)
db2<-stack(db1)
db2
"db2" does not have any row.
How can
Kenneth Roy Cabrera Torres une.net.co> writes:
> Hi R users:
> I found that I cannot stack() a data.frame with factors.
> db1<-data.frame(replicate(6,factor(sample(c("A","B"),6,replace=TRUE
> str(db1)
> db2<-stack(db1)
> db2
> "db2" does not have any row.
> How can I stack them by the variable
Hi R users:
I found that I cannot stack() a data.frame with factors.
db1<-data.frame(replicate(6,factor(sample(c("A","B"),6,replace=TRUE
str(db1)
db2<-stack(db1)
db2
"db2" does not have any row.
How can I stack them by the variables X1,X2,...,X6?
Thank you for your help.
Kenneth
Here is an example using proto based on converting Duncan's example:
library(proto)
Stack <- proto(new = function(.) proto(Stack,
stack = NULL,
push = function(., el) .$stack <- c(list(el), .$stack),
pop = function(.) { stopifnot(length(.$stack) > 0)
out <-
On 01/03/2010 7:56 PM, Worik R wrote:
How can I implement a stack in R?
I want to push and pop. Every thing I push and pop will be the same
type, but not necessarily an atomic type.
Use lexical scoping:
stack <- function() {
store <- list()
push <- function(item) {
store <<- c(list(i
How can I implement a stack in R?
I want to push and pop. Every thing I push and pop will be the same
type, but not necessarily an atomic type.
cheers
Worik
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do re
On 21/01/2010 4:41 AM, Tal Galili wrote:
Hi all,
I just failed in loading a saved wordspace (13MB of size), and received
these errors:
Those messages indicate an internal error in R or a package that it's
using. If you can make such things reproducible, you should report them
as bugs, eithe
For some reason it now loads properly.
I tried it in several ways and wasn't able to reproduce the problem.
Sorry!
Tal
Contact
Details:---
Contact me: tal.gal...@gmail.com | 972-52-7275845
Read me: www.talgalili.com (Hebrew) |
Hi all,
I just failed in loading a saved wordspace (13MB of size), and received
these errors:
Warning: stack imbalance in 'missing', 52 then 51
Warning: stack imbalance in 'if', 50 then 53
Warning: stack imbalance in 'as.environment', 57 then 59
Warning: stack imbalance in 'ls', 54 then 53
Warni
Thanks to Dr. Ripley and Dr. Murdoch for the workaround
and the solution to the problem with sub() and gsub() memory problem.
Now, with the perl=TRUE option added it works perfect (with the full
database)!
alumnos$AL_NUME_ID<-gsub("(^ +)|( +$)","",alumnos$AL_NUME_ID,perl=TRUE)
I am going to test
El mar, 27-10-2009 a las 10:47 -0700, Phil Spector escribió:
> What happens if you type
>
> Sys.setlocale('LC_ALL','C')
>
> before using gsub or grep?
When I do that, R hangs and don't show any message.
>
> - Phil Spector
>
Thank you very much for your interest.
I make this:
x <- as.character(alumnos$AL_NUME_ID)
x <- x[-seq_len(length(x)/2)]
save(x, file="x.RData")
I exit form R, and then restart R and I make this:
load("x.RData")
y <- gsub("(^ +)|( +$)","",x)
It shows me:
Error en gsub("(^ +)|( +$)", "", x) :
On 10/27/2009 1:05 PM, Kenneth Roy Cabrera Torres wrote:
Thank you very much for your interest.
I make this:
x <- as.character(alumnos$AL_NUME_ID)
x <- x[-seq_len(length(x)/2)]
save(x, file="x.RData")
I exit form R, and then restart R and I make this:
load("x.RData")
y <- gsub("(^ +)|( +$)",""
On 10/27/2009 10:46 AM, Kenneth Roy Cabrera Torres wrote:
Dr. Murdoch:
I am puzzled!
As you adviced me I do this:
x <- as.character(alumnos$AL_NUME_ID)
x <- x[-seq_len(length(x)/2)]
Please try the following. After doing the lines above, do
save(x, file="x.RData")
and exit from R. Then re
Dr. Murdoch:
I am puzzled!
As you adviced me I do this:
x <- as.character(alumnos$AL_NUME_ID)
x <- x[-seq_len(length(x)/2)]
y <- gsub("(^ +)|( +$)","",x)
And it fails,
But, trying to locate the problem I do:
x <- as.character(alumnos$AL_NUME_ID)
x <- x[-seq_len(length(x)/2)]
x <- x[seq_len(len
On 10/27/2009 8:15 AM, Kenneth Roy Cabrera Torres wrote:
Hi R developers:
Congratulations for the new R 2.10.0 version.
It is a huge effort! Thank you for your work and dedication.
I just want to ask how to make this "strip blank" function
to work again (it works on R.2.9.2).
alumnos$AL_NUME_
Hi R developers:
Congratulations for the new R 2.10.0 version.
It is a huge effort! Thank you for your work and dedication.
I just want to ask how to make this "strip blank" function
to work again (it works on R.2.9.2).
alumnos$AL_NUME_ID<-sub("(^ +)|( +$)","",alumnos$AL_NUME_ID),)
"alumnos" i
sebed1110-div...@yahoo.fr wrote:
Dear all,
I can't load my workspace of 25Mo on R version 2.9.2, because of a stack
overflow. But I saved it normally (save.image()), and I didn't get any
notification...
Does anyone know what that can be due to? Is there any limitation of number of
objects (
Dear all,
I can't load my workspace of 25Mo on R version 2.9.2, because of a stack
overflow. But I saved it normally (save.image()), and I didn't get any
notification...
Does anyone know what that can be due to? Is there any limitation of number of
objects (+/-63000)?
Thanks
Edwige Polus.
perhaps,
unlist(d, use.names=F)
baptiste
On 1 Apr 2009, at 22:15, oscar linares wrote:
Dear Rxperts
I have a data.frame as follows
ABCD
14 710
25 811
36 912
I want to convert it to a data frame with a single row (i.e., stack
the
columns w
Dear Rxperts
I have a data.frame as follows
ABCD
14 710
25 811
36 912
I want to convert it to a data frame with a single row (i.e., stack the
columns without the heading)
1
2
3
4
5
6
7
8
9
10
11
12
Any suggestions please.
Thanks in advance!
--
Hi All,
I'm generating 10 different data sets with 1 and 0 in a matrix form and writing
the output in separate files. Now I need to stack all these data sets in one
vector and I know that stack only operates on list or data frame however I got
these data sets by converting list to a matrix so c
Is this what you want:
> x <- matrix(1:16,4)
> rownames(x) <- colnames(x) <- LETTERS[1:4]
> x
A B C D
A 1 5 9 13
B 2 6 10 14
C 3 7 11 15
D 4 8 12 16
> require(reshape)
> # create single list
> z <- melt(x)
> z
X1 X2 value
1 A A 1
2 B A 2
3 C A 3
4 D A 4
5 A B
Heja,
I've some bigger distance-matrices like this:
num [1:3231, 1:3231] 0.000 0.176 0.176 0.176 0.176 ...
- attr(*, "dimnames")=List of 2
..$ : chr [1:3231] "A" "B" "C" "D" ...
..$ : chr [1:3231] A" "B" "C" "D" .
I actually want to convert them into a 2 column dataframe like this:
data.f
Thanks Jim!
On 12/31/07, jim holtman <[EMAIL PROTECTED]> wrote:
>
> To make the charts the same size, try setting the top and bottom
> margins to be the same; e.g.,
>
> layout(rbind(1,2))
> par(mar=c(0,4,4,2))
> plot(rnorm(1:3),xaxt="n",xlab="")
> par(mar=c(4,4,0,2))
> plot(rnorm(1:3))
>
> On Dec
Sorry Gabor, you are right, using mar= alone is enough to do the stacking. I
was wrong.
On 12/31/07, tom soyer <[EMAIL PROTECTED]> wrote:
>
> Thanks Gabor. mar= and oma= by themselves won't be able to do it. layout()
> is necessary per Jim's post. But now I am stuck with another problem when I
> t
To make the charts the same size, try setting the top and bottom
margins to be the same; e.g.,
layout(rbind(1,2))
par(mar=c(0,4,4,2))
plot(rnorm(1:3),xaxt="n",xlab="")
par(mar=c(4,4,0,2))
plot(rnorm(1:3))
On Dec 31, 2007 1:16 PM, tom soyer <[EMAIL PROTECTED]> wrote:
> Thanks Jim! It seems layout(
Thanks Gabor. mar= and oma= by themselves won't be able to do it. layout()
is necessary per Jim's post. But now I am stuck with another problem when I
tried to define the height of each chart:
layout(rbind(1,2))
par(mar=c(0,4,4,2),pin=c(4,2))
plot(rnorm(1:3),xaxt="n",xlab="")
par(mar=c(5,4,0,2),pi
Check out:
http://research.stowers-institute.org/efg/R/Graphics/Basics/mar-oma/index.htm
On Dec 31, 2007 11:53 AM, tom soyer <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I tried to stack two charts on top of each other using the following
> R functions:
>
> par(mfrow=c(2,1))
> plot(rnorm(1:3),xaxt="n",xla
Thanks Jim! It seems layout() is necessary in addition to mar=. I have a
follow up question: is there a way to specify the height of each chart so
that all the charts have the same height? I tried pin=, but it created more
space (if the height is set to a small value) between the charts, although
i
See ?par and its argument "mar"
Uwe Ligges
tom soyer wrote:
> Hi,
>
> I tried to stack two charts on top of each other using the following
> R functions:
>
> par(mfrow=c(2,1))
> plot(rnorm(1:3),xaxt="n",xlab="")
> plot(rnorm(1:3))
>
> This created two charts, one on top of the other, but the
try this to get them to butt up against each other:
layout(rbind(1,2))
par(mar=c(0,4,3,2))
plot(rnorm(1:3),xaxt="n",xlab="")
par(mar=c(4,4,0,2))
plot(rnorm(1:3))
On Dec 31, 2007 11:53 AM, tom soyer <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I tried to stack two charts on top of each other using the fol
Hi,
I tried to stack two charts on top of each other using the following
R functions:
par(mfrow=c(2,1))
plot(rnorm(1:3),xaxt="n",xlab="")
plot(rnorm(1:3))
This created two charts, one on top of the other, but there is too much
space between them. Does anyone know how to elimiate the space in bet
51 matches
Mail list logo