Re: [R] value.labels

2011-08-11 Thread David Winsemius
On Aug 11, 2011, at 10:27 AM, Uwe Ligges wrote: On 11.08.2011 19:22, David Winsemius wrote: Hmm, when you want to add a level without changing the class of the factor object, you will have to add the level at first and then assign the level to the elements of the object. I'd probably rebui

[R] current.panel.limits() of lattice returning NaN limits - why?

2011-08-11 Thread Fredrik Karlsson
Hi, I need a custom axis function for a plot, but it seems that current.panel.limits() sometimes returns NaN limits for the plot, which it much harder to calculate anything sensible. An illustration: Given this axis function: vs.axis <- function(...){ xlim <- current.panel.limits()$xlim y

Re: [R] Details of subassignment (for vectors and data frames)

2011-08-11 Thread Jeff Newmiller
My mental model is that the left hand side forms a sort of "virtual vector" where each element really points to an element in the vector being modified. Then the right hand side scalar is extended in the usual repetitious way (if necessary) until it is a vector just as long as the "virtual vecto

Re: [R] Can R handle a matrix with 8 billion entries?

2011-08-11 Thread Łukasz Ręcławowicz
W dniu 12 sierpnia 2011 05:19 u¿ytkownik Chris Howden < ch...@trickysolutions.com.au> napisa³: > Thanks for the suggestion, I'll look into it > It seems to work! :) library(multiv) data(iris) iris <- as.matrix(iris[,1:4]) h <- hierclust(iris, method=2) d<- dist(iris) hk<-hclust(d) >str(hk) List

[R] Mixed Logit model mlogit error

2011-08-11 Thread FJProenza
I am new to R but I have managed to use mlogit to run multivariate logit models successfully. My data violates the Independence of Irrelevant Alternatives assumption and now I would like to run a mixed logit model. It is a "wide" data set with 9 independent (individual) variables and three choices

[R] Details of subassignment (for vectors and data frames)

2011-08-11 Thread Al Roark
Hi All: I'm looking to find out a bit more about how subassignment actually works and am hoping someone with knowledge of the details can fill me in (I've looked at the source code, but my knowledge of C is lacking). In the case of vectors, my reading of ?"[" would indicate that for a vector,

Re: [R] sapply( ) a loop function

2011-08-11 Thread R. Michael Weylandt
The previous two posters basically covered everything, but since I'm on the train with not too much to do, here's a more detailed response building on what they said. The following code is "shovel-ready" and can be pasted directly to your command line if you have your main data frame called "d" ava

Re: [R] value.labels

2011-08-11 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Rolf Turner > Sent: Thursday, August 11, 2011 5:24 PM > To: Heinz Tuechler > Cc: Zeki Çatav; r-help@r-project.org; Uwe Ligges > Subject: Re: [R] value.labels > > On 12/08/11 12:5

Re: [R] value.labels

2011-08-11 Thread Rolf Turner
On 12/08/11 12:53, Heinz Tuechler wrote: At 12.08.2011 11:05 +1200, Rolf Turner wrote: On 12/08/11 11:34, Heinz Tuechler wrote: At 12.08.2011 09:11 +1200, Rolf Turner wrote: On 12/08/11 09:59, Heinz Tuechler wrote: At 11.08.2011 21:50 +0300, Zeki Çatav wrote: PrÅŸ, 2011-08-11 tarihinde 19:27

Re: [R] value.labels

2011-08-11 Thread Heinz Tuechler
At 12.08.2011 01:53 +0100, Heinz Tuechler wrote: At 12.08.2011 11:05 +1200, Rolf Turner wrote: On 12/08/11 11:34, Heinz Tuechler wrote: At 12.08.2011 09:11 +1200, Rolf Turner wrote: On 12/08/11 09:59, Heinz Tuechler wrote: At 11.08.2011 21:50 +0300, Zeki Çatav wrote: Prş, 2011-08-11 tarihin

Re: [R] sapply( ) a loop function

2011-08-11 Thread Dennis Murphy
Hi: samp_func() doesn't return anything. Either (1) type test as the last line of the function body or (2) don't assign the last sum to an object. HTH, Dennis On Thu, Aug 11, 2011 at 1:59 PM, Sean Bignami wrote: > Hello R-universe... > > I am having trouble writing a function which contains a l

Re: [R] value.labels

2011-08-11 Thread Heinz Tuechler
At 12.08.2011 11:05 +1200, Rolf Turner wrote: On 12/08/11 11:34, Heinz Tuechler wrote: At 12.08.2011 09:11 +1200, Rolf Turner wrote: On 12/08/11 09:59, Heinz Tuechler wrote: At 11.08.2011 21:50 +0300, Zeki Çatav wrote: Prş, 2011-08-11 tarihinde 19:27 +0200 saatinde, Uwe Ligges yazdı: > > On

[R] Reduce the space under legend title

2011-08-11 Thread Amelia McNamara
I would like to know if there is a way to reduce the space between the legend title and the first line of the legend, without reducing all the vertical space using y.intersp. Because of lack of space, I would like to differentiate my title by bolding it, and reduce the vertical space under the titl

Re: [R] Sample size AUC for ROC curves

2011-08-11 Thread Karl Knoblick
Thanks. Actually I thought of something like Hanley JA, McNeil BJ. A method of comparing the areas under receiver operating characteristic curves derived from the same cases. Radiology. 1983; 148: 839–843. http://radiology.rsna.org/content/148/3/839.full.pdf+html   Has anybody R-code for this or

Re: [R] value.labels

2011-08-11 Thread Rolf Turner
On 12/08/11 11:34, Heinz Tuechler wrote: At 12.08.2011 09:11 +1200, Rolf Turner wrote: On 12/08/11 09:59, Heinz Tuechler wrote: At 11.08.2011 21:50 +0300, Zeki Çatav wrote: PrÅŸ, 2011-08-11 tarihinde 19:27 +0200 saatinde, Uwe Ligges yazdı: > > On 11.08.2011 19:22, David Winsemius wrote: > > >

Re: [R] Mixed effect models

2011-08-11 Thread Daniel Malter
I am afraid this is one of these posts where I have to quote David Winsemius: "The advancement of science would be safer if you knew what you were doing." Moreover, these are questions best addressed to your local statistician rather than the R-help list. With exceptions, the R-help list helps to s

Re: [R] Removing all duplicate row except by one

2011-08-11 Thread Rolf Turner
On 12/08/11 07:37, m.marcinmichal wrote: Hi, It's my problem, supppose that we have a data.frame: t a b c 1 1 1 1 2 0 1 1 3 1 1 1 4 0 0 0 5 1 0 1 6 0 1 0 7 1 1 1 8 0 1 0 I need extract duplicat row i.e i nedd frame like this a b c 3 1 1 1 8 0 1 0 I try use subset(t, duplicated(t)) and t

Re: [R] value.labels

2011-08-11 Thread Heinz Tuechler
At 12.08.2011 09:11 +1200, Rolf Turner wrote: On 12/08/11 09:59, Heinz Tuechler wrote: At 11.08.2011 21:50 +0300, Zeki Çatav wrote: Prş, 2011-08-11 tarihinde 19:27 +0200 saatinde, Uwe Ligges yazdı: > > On 11.08.2011 19:22, David Winsemius wrote: > > > > On Aug 11, 2011, at 11:42 AM, Uwe Ligge

[R] a senior level statistician opening

2011-08-11 Thread Wensui Liu
it is in the consumer risk modeling team in Cincinnati ohio. pls send resume to wensui@53.com if interested. thx [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

[R] attribute name argument for getAttrib()

2011-08-11 Thread Wei Hao
Hi all: Having browsed Rinternals.h, it's a little unclear to me how to get attributes that aren't in the "Symbol Table Shortcuts" section of that file. In particular, I would like to extract the attribute "scaled:center" from a SEXP. Thanks [[alternative HTML version deleted]]

Re: [R] sapply( ) a loop function

2011-08-11 Thread Daniel Malter
I am not sure what purpose the while loop has. However, the main problem seems to be that you need to put: i<-sample(1:(n-40),1) #This sample from 1 to n-40 rather than i<-sample(1:n-40,1) #this samples one 1:n and then subtracts 40 Otherwise, you may get negative index values Best, Daniel

Re: [R] Removing all duplicate row except by one

2011-08-11 Thread Justin
m.marcinmichal gmail.com> writes: > > Hi, > It's my problem, supppose that we have a data.frame: > -snip- You should avoid using t as a variable name since its an important R function! > I need extract duplicat row i.e i nedd frame like this > > a b c > 3 1 1 1 > 8 0 1 0 > not sure if t

Re: [R] Cv.glment question -- why giving me an error

2011-08-11 Thread Patrick Breheny
On 08/11/2011 01:01 PM, Andra Isan wrote: Hi All, I am trying to run cv.glmnet(x,y,family="multinomial", nfolds =4) and I only have 8 observations and the number of features I have is 1000, so my x matrix is 8 by 1000 and when I run the following, I get this error, I am not sure what is causing

Re: [R] value.labels

2011-08-11 Thread Rolf Turner
On 12/08/11 09:59, Heinz Tuechler wrote: At 11.08.2011 21:50 +0300, Zeki Çatav wrote: PrÅŸ, 2011-08-11 tarihinde 19:27 +0200 saatinde, Uwe Ligges yazdı: > > On 11.08.2011 19:22, David Winsemius wrote: > > > > On Aug 11, 2011, at 11:42 AM, Uwe Ligges wrote: > > > >> > >> > >> On 11.08.2011 16:10

[R] Mixed effect models

2011-08-11 Thread Eleanor Spratt
I am using two mixed effect models. Firstly, what I am trying to do is to compare green roofs abundance with brownfield, green roof with green space abundance, and finally green space with brownfield abundance. I am unsure if I have done the correct model. I have to use a mixed effect model because

[R] Removing all duplicate row except by one

2011-08-11 Thread m.marcinmichal
Hi, It's my problem, supppose that we have a data.frame: t a b c 1 1 1 1 2 0 1 1 3 1 1 1 4 0 0 0 5 1 0 1 6 0 1 0 7 1 1 1 8 0 1 0 I need extract duplicat row i.e i nedd frame like this a b c 3 1 1 1 8 0 1 0 I try use subset(t, duplicated(t)) and t[duplicated(t), ] but this command return

[R] sapply( ) a loop function

2011-08-11 Thread Sean Bignami
Hello R-universe... I am having trouble writing a function which contains a loop so I can sapply() it to a list of data frames Each data frame has 241 observations of 15 variables. My loop takes a random sample of one row until the 40 consecutive rows after the sample have a d2p(variable) sum

Re: [R] value.labels

2011-08-11 Thread Heinz Tuechler
At 11.08.2011 21:50 +0300, Zeki Çatav wrote: Prş, 2011-08-11 tarihinde 19:27 +0200 saatinde, Uwe Ligges yazdı: > > On 11.08.2011 19:22, David Winsemius wrote: > > > > On Aug 11, 2011, at 11:42 AM, Uwe Ligges wrote: > > > >> > >> > >> On 11.08.2011 16:10, zcatav wrote: > >>> Hello R people, > >>

Re: [R] convert 'list' to 'vector'?

2011-08-11 Thread Liviu Andronic
On Wed, Aug 10, 2011 at 11:39 PM, David Winsemius wrote: >> is.vector(x) > [1] TRUE > > You probably didn't realize that lists _are_ vectors before this. > Nice to know. > Hopefully this expected invitation to grilling will not result in severe > burns. I note that one of the *apply family would

Re: [R] 2-dim density plot

2011-08-11 Thread annie Zhang
Thank you so much, Michael and Duncan. It worked. Annie On Thu, Aug 11, 2011 at 2:23 PM, Duncan Murdoch wrote: > On 11/08/2011 3:11 PM, annie Zhang wrote: > >> Hi All, >> >> I have a 2-dim density defined on 0> formula of the density. How can I visualize it? What plot functions can I >> use? >>

Re: [R] help with loops

2011-08-11 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of R. Michael > Weylandt > Sent: Thursday, August 11, 2011 10:09 AM > To: Srinivas Iyyer > Cc: r-help@r-project.org > Subject: Re: [R] help with loops > > No problem, > > By the wa

Re: [R] help with loops

2011-08-11 Thread R. Michael Weylandt
No problem, By the way, you can't (or at least shouldn't) use return() outside of a function -- that was the source of your old error message. If you, for whatever reason, couldn't use unlist() you would write: OurUnlist <- function(c, unique = F) { if (!is.list(c)) return(c) z <- NU

Re: [R] 2-dim density plot

2011-08-11 Thread Duncan Murdoch
On 11/08/2011 3:11 PM, annie Zhang wrote: Hi All, I have a 2-dim density defined on 0 persp() or contour() are in the graphics package. There are similar ones in lattice (and I think in ggplot2), but I forget their names. There's also persp3d() in the rgl package for a rotatable version of

Re: [R] 2-dim density plot

2011-08-11 Thread R. Michael Weylandt
I'd suggest either a color plot as given by image() and related functions or a 3d mesh-plot which you can get from persp() E.g., x = seq(0,1,by=0.01); y = x z = outer(x,y+1,"/") # z = x/(y+1) -- I know that's not a density but you can adapt as necessary filled.contour(x,y,z) persp(x,y,z) There

[R] 2-dim density plot

2011-08-11 Thread annie Zhang
Hi All, I have a 2-dim density defined on 0https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

[R] Weighted data with npcdensbw

2011-08-11 Thread Barnet Wagman
Is there a way of using weighted data with npcdensbw (in the np package)? thanks __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide

Re: [R] value.labels

2011-08-11 Thread Bert Gunter
Use factor -- puhleeze read the Help file therefor: factor(x = character(), levels, labels = levels, exclude = NA, ordered = is.ordered(x)) either an optional vector of labels for the levels (in the same order as levels after removing those in exclude), or a character string of length 1.

Re: [R] value.labels

2011-08-11 Thread Zeki Çatav
Prş, 2011-08-11 tarihinde 19:27 +0200 saatinde, Uwe Ligges yazdı: > > On 11.08.2011 19:22, David Winsemius wrote: > > > > On Aug 11, 2011, at 11:42 AM, Uwe Ligges wrote: > > > >> > >> > >> On 11.08.2011 16:10, zcatav wrote: > >>> Hello R people, > >>> > >>> I have a "data.frame". Status variable h

Re: [R] round() a data frame containing 'character' variables?

2011-08-11 Thread Liviu Andronic
On Wed, Aug 10, 2011 at 5:52 PM, Jean V Adams wrote: > data.frame(lapply(x, function(y) if(is.numeric(y)) round(y, 2) else y)) > Building on this, I came up with a 'data.frame' method for round(). I'm not sure how orthodox it is, but it seems to do the job as intended: round.data.frame <- func

Re: [R] round() a data frame containing 'character' variables?

2011-08-11 Thread Liviu Andronic
On Thu, Aug 11, 2011 at 4:58 PM, David Winsemius wrote: >>> numVars <- sapply(iris, is.numeric) >>> iris[numVars] <- lapply(iris[numVars], round, digits = 2) >>> head(iris) >>> > Then drop the assignment operation and just print: > > ( lapply(iris[numVars], round, digits = 2) ) > That's a nice cat

Re: [R] model formula

2011-08-11 Thread Eik Vettorazzi
Am 11.08.2011 17:39, schrieb Uwe Ligges: > > > On 11.08.2011 17:27, Bond, Stephen wrote: >> Hello useRs, >> >> Pls help with removing a single interaction term from a formula: >> >> summary( >> glm.turn.2<- >> glm(cbind(turn.cnt,tot.cnt-turn.cnt)~sn+poly(relAge,2,raw=T)+termfac+rate:te

Re: [R] round() a data frame containing 'character' variables?

2011-08-11 Thread Liviu Andronic
Hello On Thu, Aug 11, 2011 at 4:34 PM, Martin Maechler wrote: > Well, as you say it's  "View()" only, so why don't you just > "view" the result of > > something like >          print(, digits = 2) > Unfortunately print(..., digits = 2) suffers of the same deficiencies as format(..., digits = 2):

Re: [R] generate two sets of random numbers that are correlated

2011-08-11 Thread Duncan Murdoch
On 11/08/2011 1:33 PM, Duncan Murdoch wrote: On 11/08/2011 12:01 PM, Kathie wrote: > almost forgot. In fact, I want to generate correlated Poisson random vectors. Saying you want two random variables to be correlated doesn't specify the joint distribution, so there will be a lot of solutions.

Re: [R] generate two sets of random numbers that are correlated

2011-08-11 Thread Albyn Jones
Here is a simple method z1 <- rpois(n,mu1) z2 <- rpois(n,mu1) z3 <- rpois(n,mu2) Y <- z1 + z3 X <- z2 + z3 Cov(X,Y) = mu2, so Cor(X,Y) = mu2/(mu1+mu2) albyn On Thu, Aug 11, 2011 at 09:01:50AM -0700, Kathie wrote: > almost forgot. In fact, I want to generate correlated Poisson random vectors. >

Re: [R] generate two sets of random numbers that are correlated

2011-08-11 Thread Duncan Murdoch
On 11/08/2011 12:01 PM, Kathie wrote: almost forgot. In fact, I want to generate correlated Poisson random vectors. Saying you want two random variables to be correlated doesn't specify the joint distribution, so there will be a lot of solutions. Here's one, for the case where both variables

Re: [R] round() a data frame containing 'character' variables?

2011-08-11 Thread Liviu Andronic
On Wed, Aug 10, 2011 at 5:52 PM, Jean V Adams wrote: > > As it says in > > ?format > > the digits argument specifies "... how many significant digits are to be > used ... enough decimal places will be used so that the smallest (in > magnitude) number has this many significant digits ..." > > In yo

Re: [R] value.labels

2011-08-11 Thread Uwe Ligges
On 11.08.2011 19:22, David Winsemius wrote: On Aug 11, 2011, at 11:42 AM, Uwe Ligges wrote: On 11.08.2011 16:10, zcatav wrote: Hello R people, I have a "data.frame". Status variable has 3 values. 0->alive, 1->dead and 2->missed Status as a factor have correct levels. Levels and labels ou

Re: [R] value.labels

2011-08-11 Thread David Winsemius
On Aug 11, 2011, at 11:42 AM, Uwe Ligges wrote: On 11.08.2011 16:10, zcatav wrote: Hello R people, I have a "data.frame". Status variable has 3 values. 0->alive, 1- >dead and 2->missed Status as a factor have correct levels. Levels and labels output as follows; levels(Adbf$status); la

Re: [R] generate two sets of random numbers that are correlated

2011-08-11 Thread Kathie
almost forgot. In fact, I want to generate correlated Poisson random vectors. Thank you anyway -- View this message in context: http://r.789695.n4.nabble.com/generate-two-sets-of-random-numbers-that-are-correlated-tp3736161p3736287.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Subsampling data

2011-08-11 Thread Eik Vettorazzi
Hi Stefán you might not to see the wood for the trees, but ?subset is a R function as well. MalesData <- subset(Datatemp,Datatemp$sex==1) btw. your selection > MalesData <- Datatemp[Datatemp $sex==1] went wrong for two reasons: (a) the extra space befor $ (b) incorrect indexing. Datatemp is a dat

Re: [R] step

2011-08-11 Thread Uwe Ligges
On 03.08.2011 16:33, Diana Schwegler wrote: Hello I am using the "step" function in order to do backward selection for a linear model of more than 200 variables but it doesn't work correctly. I think, there is a problem, if the matrix has same or more columns than rows. And if the matrix has too

[R] Cv.glment question -- why giving me an error

2011-08-11 Thread Andra Isan
Hi All,  I am trying to run cv.glmnet(x,y,family="multinomial", nfolds =4) and I only have 8 observations and the number of features I have is 1000, so my x matrix is 8 by 1000 and when I run the following, I get this error, I am not sure what is causing this problem.  Error in predmat[which, ,

Re: [R] help with loops

2011-08-11 Thread Srinivas Iyyer
Thank you. that was very easy. -srini --- On Thu, 8/11/11, R. Michael Weylandt wrote: From: R. Michael Weylandt Subject: Re: [R] help with loops To: "Srinivas Iyyer" Cc: r-help@r-project.org Date: Thursday, August 11, 2011, 12:49 PM unlist() Michael Weylandt On Thu, Aug 11, 2011 at 12:46 P

Re: [R] model formula

2011-08-11 Thread Uwe Ligges
On 11.08.2011 18:32, Eik Vettorazzi wrote: Hi Stephen, have a look at ?update.formula glm.turn.3<-update(glm.turn.2,.~.-termfac1:rate) No, "1" is a level of the variable "termfac" here. Uwe Ligges should do the trick. hth. Am 11.08.2011 17:27, schrieb Bond, Stephen: Hello useRs, Pls

Re: [R] UNC windows path beginning with backslashes: normalizePath bug??

2011-08-11 Thread Uwe Ligges
This is extremely tricky since Windows does not always accept "//" rather than "\\". Additionally, there is not implemented system call in Windows, hence ?Sys.glob tells us a "partial emulation" is provided and "An attempt is made to handle UNC paths starting with a double backslash." As you h

Re: [R] Sweave: pdf-graphics got three times lager with R 2.13.1

2011-08-11 Thread Prof Brian Ripley
1) Read about the changes to the colourspace in 2.13.0. 2) Try R-devel: it has compression for PDF files (or use a compressor on your final pdf file, e.g. tools::compactPDF). On Thu, 11 Aug 2011, Uwe Ligges wrote: On 04.08.2011 13:44, eriksengewald wrote: Dear R-Users, I am using R for y

Re: [R] help with loops

2011-08-11 Thread R. Michael Weylandt
unlist() Michael Weylandt On Thu, Aug 11, 2011 at 12:46 PM, Srinivas Iyyer wrote: > hi I need help with list object. > > I have a list object > > > a <- c('apple','orange','grape') > > b <- c('car','truck','jeep') > > c <- list(a,b) > > names(c) <- c('fruit','vehicle') > > c > $fruit > [1] "appl

[R] help with loops

2011-08-11 Thread Srinivas Iyyer
hi I need help with list object. I have a list object > a <- c('apple','orange','grape') > b <- c('car','truck','jeep') > c <- list(a,b) > names(c) <- c('fruit','vehicle') > c $fruit [1] "apple" "orange" "grape" $vehicle [1] "car" "truck" "jeep" I want to write all the elements of this l

[R] UNC windows path beginning with backslashes: normalizePath bug??

2011-08-11 Thread Keith Jewell
Hi, Back in June I posted the message below, but had no replies. I've made a little progress since then so this is to update anyone interested (!) and to ask for comments. Brief problem statement: Under Windows, some parts of R don't handle UNC paths beginning with backslashes. Specifically a)

Re: [R] model formula

2011-08-11 Thread Eik Vettorazzi
Hi Stephen, have a look at ?update.formula glm.turn.3<-update(glm.turn.2,.~.-termfac1:rate) should do the trick. hth. Am 11.08.2011 17:27, schrieb Bond, Stephen: > Hello useRs, > > Pls help with removing a single interaction term from a formula: > > summary( > glm.turn.2 <- > glm(cbin

Re: [R] improve formatting of HTML table

2011-08-11 Thread Barry Rowlingson
On Thu, Aug 11, 2011 at 5:04 PM, Juliet Hannah wrote: > I am trying to improve the look of an HTML table for a report (that > needs to be pasted into Word). > In the output, I would like to improve the justification of the > numbers (or any other suggestion to make > the HTML look nicer). The col

Re: [R] model formula

2011-08-11 Thread Bond, Stephen
Using glm.fit I can remove the unwanted column from model.matrix(glm.turn.2) manually and then call glm.fit directly. Q: how can I stuff the output from glm.fit into a regular glm object, so I can use prediction functions, etc.?? the help does not describe how to use output from glm.fit in the

Re: [R] Sweave: pdf-graphics got three times lager with R 2.13.1

2011-08-11 Thread Uwe Ligges
On 04.08.2011 13:44, eriksengewald wrote: Dear R-Users, I am using R for years now but recently I encounter a problem with the pdf-size of graphics generated with sweave. However, I am new in this forum. Hence, please don't hesitate if I am wrong here. I use a script which runs perfectly in R

Re: [R] Can R handle a matrix with 8 billion entries?

2011-08-11 Thread Łukasz Ręcławowicz
2011/8/11 Chris Howden > In that my distance matrix has too many entries for R's architecture to > know how to store in > memory > There was an multiv package with hierclust function and a bign option. "Is n big? If storage is problemsome, a different implementation of the Ward criterion may be

Re: [R] improve formatting of HTML table

2011-08-11 Thread Uwe Ligges
Please report to the package maintainer. Uwe Ligges On 11.08.2011 18:04, Juliet Hannah wrote: I am trying to improve the look of an HTML table for a report (that needs to be pasted into Word). Here is an example. table2<- structure(c(26L, 0L, 40L, 0L, 10L, 0L, 0L, 188L, 0L, 281L, 0L, 0L, 0L,

[R] improve formatting of HTML table

2011-08-11 Thread Juliet Hannah
I am trying to improve the look of an HTML table for a report (that needs to be pasted into Word). Here is an example. table2 <- structure(c(26L, 0L, 40L, 0L, 10L, 0L, 0L, 188L, 0L, 281L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 4L), .Dim = c(6L, 3L), .Dimnames = structure(list( myvar = c("Don't know", "S

Re: [R] generate two sets of random numbers that are correlated

2011-08-11 Thread Ista Zahn
If you want random numbers sampled from the normal distribution, you can use the mvrnorm function in MASS. Best, Ista On Thu, Aug 11, 2011 at 8:23 AM, Kathie wrote: > Dear R users > > I'd like to generate two sets of random numbers with a fixed correlation > coefficient, say .4, using R. > > Any

Re: [R] Extract values from a data frame

2011-08-11 Thread Ista Zahn
Hi Laura, On Thu, Aug 11, 2011 at 7:01 AM, Lali wrote: > Hi everyone, > I have a data frame that looks *sort of* like this: > > name <- letters[1:5] > signal.1 <- c("12", "bad signal", "noise", "10", "X") > length.signal.1 <- 5:9 > intensity.signal.1 <- 3:7 > signal.2 <- c("13", "noise", "19.2",

Re: [R] Splitting data

2011-08-11 Thread R. Michael Weylandt
This sounds very much like a recursive problem: something like this seems to get the gist of what you want. DataSplits <- function(Data, alpha = 0.05) { DataSplitsCore <- function(Data, alpha, level) { tt <- t.test(Data[,1],Data[,2]) print(tt) if (tt$p.value > alpha) {

Re: [R] value.labels

2011-08-11 Thread Uwe Ligges
On 11.08.2011 16:10, zcatav wrote: Hello R people, I have a "data.frame". Status variable has 3 values. 0->alive, 1->dead and 2->missed Status as a factor have correct levels. Levels and labels output as follows; levels(Adbf$status); labels(Adbf$status) [1] "0" "1" "2" [1] "1" "2" "3"

Re: [R] model formula

2011-08-11 Thread Uwe Ligges
On 11.08.2011 17:27, Bond, Stephen wrote: Hello useRs, Pls help with removing a single interaction term from a formula: summary( glm.turn.2<- glm(cbind(turn.cnt,tot.cnt-turn.cnt)~sn+poly(relAge,2,raw=T)+termfac+rate:termfac,data=fix, family="quasibinomial")

[R] model formula

2011-08-11 Thread Bond, Stephen
Hello useRs, Pls help with removing a single interaction term from a formula: summary( glm.turn.2 <- glm(cbind(turn.cnt,tot.cnt-turn.cnt)~sn+poly(relAge,2,raw=T)+termfac+rate:termfac,data=fix, family="quasibinomial") ) Gives Coefficients:

[R] value.labels

2011-08-11 Thread zcatav
Hello R people, I have a "data.frame". Status variable has 3 values. 0->alive, 1->dead and 2->missed Status as a factor have correct levels. Levels and labels output as follows; levels(Adbf$status); labels(Adbf$status) [1] "0" "1" "2" [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "1

[R] Subsampling data

2011-08-11 Thread Stefán Hrafn Jónsson
*Dear R community* * * *I have two questions on data subsample manipulation. I am starting to use R again after a long brake and feel a bit rusty.* * * *I want to select a subsample of data for males and females separately* * * library(foreign) Datatemp <- read.spss("H:/Skjol/Data/HL/t1a

Re: [R] "Denormalize" data

2011-08-11 Thread RobinLovelace
Hi Jeff, yes I can confirm that the xtabs solution does not work with the original method. Here's how it went: HHum02 <- Hum02[1:30,] # select subset for demonstration purposes > HHum02[1:5,] CASW Btype Yr CO2Group NumVeh 170597 00CCFA CARS 2002C 2 170598 00CCFA CARS 2002

Re: [R] generate two sets of random numbers that are correlated

2011-08-11 Thread R. Michael Weylandt
Well, without saying what sort of random numbers you mean, it's a little hard, but here's one straightforward way to do it for 2 normally distributed rvs. X1 = rnorm(100) X2 = rnorm(100) Y = X1 Z = 0.4*X1+sqrt(1-0.4)*X2 then cor(Y,Z) ~ 0.4 In function terms: CorrNorm <- function(n=100, rho =

[R] Splitting data

2011-08-11 Thread Marina de Wolff
I want to implement the following algorithm in R: I want to split my data, use a t test to compare both means of the groups to see if they significantly differ from each other. If this is a yes (p < alpha) I want to split again (into 4 groups) and do the same procedure twice, and stop otherw

Re: [R] To import data to R from Excel

2011-08-11 Thread Uwe Ligges
Or just read the R Data Import/Export manual that includes comments on how to deal with Excel. Best, Uwe Ligges On 11.08.2011 11:21, Petr PIKAL wrote: Hi In Excel, make sure that your data has a format that corresponds to an R data frame (first row with column names, consistent column

Re: [R] Capture R-Console Output to Excel with RExcel

2011-08-11 Thread David Winsemius
On Aug 11, 2011, at 7:46 AM, Meier Dario wrote: Hello All I've just started to use RExcel instead of CMD Batches. But I don't get the console output to an data.frame and push to Excel. With the CMD batch you got the console out relatively easy with C:\LocalData\R\bin\R CMD BATCH --slave %

Re: [R] R crashes when communicating with JAGS

2011-08-11 Thread Uwe Ligges
Works for me with JAGS 3.1.0. Uwe Ligges On 11.08.2011 14:09, David Wooff wrote: There is a thread on this topic already: http://finzi.psych.upenn.edu/Rhelp10/2010-August/250934.html I'm rather mystified by a similar problem and wondering whether I've overlooked something obvious. I'm running

[R] Extract values from a data frame

2011-08-11 Thread Lali
Hi everyone, I have a data frame that looks *sort of* like this: name <- letters[1:5] signal.1 <- c("12", "bad signal", "noise", "10", "X") length.signal.1 <- 5:9 intensity.signal.1 <- 3:7 signal.2 <- c("13", "noise", "19.2", "X", "V") length.signal.2 <- 2:6 intensity.signal.2 <- 1:5 signal.3 <- c

[R] generate two sets of random numbers that are correlated

2011-08-11 Thread Kathie
Dear R users I'd like to generate two sets of random numbers with a fixed correlation coefficient, say .4, using R. Any suggestion will be greatly appreciated. Regards, Kathryn Lord -- View this message in context: http://r.789695.n4.nabble.com/generate-two-sets-of-random-numbers-that-are-co

[R] Capture R-Console Output to Excel with RExcel

2011-08-11 Thread Meier Dario
Hello All I've just started to use RExcel instead of CMD Batches. But I don't get the console output to an data.frame and push to Excel. With the CMD batch you got the console out relatively easy with C:\LocalData\R\bin\R CMD BATCH --slave %rscript% %logfile% to a file. But how can I get it to

[R] R crashes when communicating with JAGS

2011-08-11 Thread David Wooff
There is a thread on this topic already: http://finzi.psych.upenn.edu/Rhelp10/2010-August/250934.html I'm rather mystified by a similar problem and wondering whether I've overlooked something obvious. I'm running with latest versions of R and all packages, and latest version of JAGS running und

Re: [R] round() a data frame containing 'character' variables?

2011-08-11 Thread David Winsemius
On Aug 10, 2011, at 5:46 AM, Liviu Andronic wrote: Hello On Wed, Aug 10, 2011 at 11:41 AM, Dimitris Rizopoulos wrote: One approach is the following: numVars <- sapply(iris, is.numeric) iris[numVars] <- lapply(iris[numVars], round, digits = 2) head(iris) That's interesting, but still doesn

Re: [R] round() a data frame containing 'character' variables?

2011-08-11 Thread Martin Maechler
> Liviu Andronic > on Wed, 10 Aug 2011 11:46:55 +0200 writes: > Hello On Wed, Aug 10, 2011 at 11:41 AM, Dimitris > Rizopoulos wrote: >> One approach is the following: >> >> numVars <- sapply(iris, is.numeric) iris[numVars] <- >> lapply(iris[numVars], round, d

[R] How to specify specific contrasts on repeated measures ANOVA using car?

2011-08-11 Thread hen...@singmann.org
Hello everyone, I am trying to run a repeated measures Anova in R followed by some specific contrasts on that dataset. So far I think the correct approach would be to use Anova() from the car package.   Lets illustrate my question with the example taken from ?Anova using the OBrienKaiser data: We

Re: [R] Data frame to list?

2011-08-11 Thread David Winsemius
On Aug 11, 2011, at 8:24 AM, Michael Karol wrote: Perhaps the split() function would do. Something like split(dfrm, 1:nrow(dfrm)) or split(dfrm, rownames(dfrm)) -- Regards, Michael -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org ] On B

Re: [R] Data frame to list?

2011-08-11 Thread Michael Karol
Perhaps the split() function would do. Regards,  Michael -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jonathan Greenberg Sent: Wednesday, August 10, 2011 10:36 PM To: r-help Subject: [R] Data frame to list? R-helpers: Is there

Re: [R] legend position in interaction.plot

2011-08-11 Thread David Winsemius
On Aug 11, 2011, at 3:38 AM, Peter Maclean wrote: How do I move the legend from default position (right and within the plot) to the "bottomleft" of the plot? interaction.plot(YEAR, ID GROWTH, legend=TRUE, col = 2:7,xlab="Year", ylim=c(0,2), ylab="Growth",leg.bty = "o") You display t

Re: [R] matrix correlations with different packages

2011-08-11 Thread Jari Oksanen
Dear Veronika, > I'm calculating matrix correlations with permutation tests and I got this > funny result. All correlation coefficients are the same with mantel.test > {ncf} and pcol {simba} but the two functions yield dramatically different > p-values (using the same number of permutations). Co

Re: [R] plotrix update

2011-08-11 Thread Jim Lemon
On 08/11/2011 11:19 AM, Jesse Brown wrote: I've run across what I think is a small bug in the plotrix package. I've tried to contact the maintainer (Jim Lemon) directly but email is returned 'undeliverable' at the provided address. What is the best method to push a patch to a CRAN package in this

Re: [R] Different approach to set up Cohen Kappa

2011-08-11 Thread Jim Lemon
On 08/10/2011 06:38 PM, gavfung wrote: Hi, I just started learning R, and one of the most frequent thing that I need to calculate is cohen kappa in my psychology lab and I figure being able to do inter rater reliability is a great way for me to explore R. There are two different scenario in whic

[R] Passing on "groups" argument to xyplot within a plotting function

2011-08-11 Thread Fredrik Karlsson
Hi, I am constructing a plotting function that I would like to behave like plotting functions within the lattice package. It takes a "groups" argument, which I process, and then I would like to pass that argument on to the xyplot function for the actual plotting. However, what ever I do, get an er

Re: [R] To import data to R from Excel

2011-08-11 Thread Petr PIKAL
Hi > > In Excel, make sure that your data has a format that corresponds to an R > data frame (first row with column names, consistent column size and data type). > Export your .XLS worksheet as .CSV file (mydata.csv). > In R, read it into a data frame with > > > read.csv( "mydata.csv" ) Anot

Re: [R] Sequential Naming of ggplot .pngs using plyr

2011-08-11 Thread Matthew Dowle
Hi Justin, In data.table 1.6.1 there was this news item : oj's environment is now consistently reused so that local variables may be set which persist from group to group; e.g., incrementing a group counter : DT[,list(z,groupInd<-groupInd+1),by=x] One of

Re: [R] To import data to R from Excel

2011-08-11 Thread Rainer Schuermann
In Excel, make sure that your data has a format that corresponds to an R data frame (first row with column names, consistent column size and data type). Export your .XLS worksheet as .CSV file (mydata.csv). In R, read it into a data frame with > read.csv( "mydata.csv" ) >From here, you shold be

Re: [R] plotrix update

2011-08-11 Thread Prof Brian Ripley
On Thu, 11 Aug 2011, Jesse Brown wrote: On Thu, Aug 11, 2011 at 12:09 AM, Rolf Turner wrote: On 11/08/11 13:19, Jesse Brown wrote: I've run across what I think is a small bug in the plotrix package. I've tried to contact the maintainer (Jim Lemon) directly but email is returned 'undeliverabl

Re: [R] legend position in interaction.plot

2011-08-11 Thread Peter Maclean
How do I move the legend from default position (right and within the plot) to the "bottomleft" of the plot?   interaction.plot(YEAR, ID GROWTH, legend=TRUE, col = 2:7,xlab="Year",    ylim=c(0,2), ylab="Growth",leg.bty = "o") Peter Maclean Department of Economics UDSM ___

[R] matrix correlations with different packages

2011-08-11 Thread Bókony Veronika
Dear all, I'm calculating matrix correlations with permutation tests and I got this funny result. All correlation coefficients are the same with mantel.test {ncf} and pcol {simba} but the two functions yield dramatically different p-values (using the same number of permutations). Could anyone

  1   2   >