Re: [R] Mean of difftime vectors : "code infelicity" or intended behaviour ?

2009-03-17 Thread Emmanuel Charpentier
Oops. Clicked "Send" too fast (don't shoot, Brian !). I forgot : > sessionInfo() R version 2.8.1 (2008-12-22) i486-pc-linux-gnu locale: LC_CTYPE=fr_FR.UTF-8;LC_NUMERIC=C;LC_TIME=fr_FR.UTF-8;LC_COLLATE=fr_FR.UTF-8; LC_MONETARY=C;LC_MESSAGES=fr_FR.UTF-8;LC_PAPER=fr_FR.UTF-8;LC_NAME=C; LC_ADDRESS=

Re: [R] Multilevel modeling using R

2009-03-17 Thread ronggui
If you want to know how to calculate the CI, you can study the code of this function. You can access the code by nlme:::intervals.lme. Best 2009/3/17 WONG, Ka Yau : >    No standard deviation of variable in the random effect is > provided. How to construct CI? > > Best Regards, > Tommy >

Re: [R] bigglm() results different from glm()

2009-03-17 Thread Thomas Lumley
This is a surprisingly interesting problem that took a while to debug, because the computations all seemed correct. Your model hasn't converged yet. You can get the right answer either by running longer: summary(m1big_longer) Large data regression model: bigglm(y ~ ttment, data = dat, fami

Re: [R] set intercept in glm to non-0

2009-03-17 Thread Thomas Lumley
On Mon, 16 Mar 2009, David Winsemius wrote: Use an offset with a non-intercept model? Yes dat$ones<-1 glm(y~0+x+offset(ones), data=dat, family=whatever) I wonder if there could be problems depending on the choice of family. Only in the sense that if the model fits badly it might run up a

Re: [R] Calculate across columns

2009-03-17 Thread Tal Galili
try: apply(data[,c(6:42)], 2, max) (as stephen sefick Just mentioned...) On Tue, Mar 17, 2009 at 2:56 AM, timbean wrote: > > I'd like to perform some calculations across a series of columns. Is there > an > easy way to do so? For example, I'd like to calculate the maximum value > from > c

Re: [R] R-code in html help pages: syntax highlighting

2009-03-17 Thread Wacek Kusnierczyk
Romain Francois wrote: > Duncan Murdoch wrote: > > That is an issue. I guess I will fall back on what the parser says and > infer on the scoping. Within the lines below, mean would be different > each time > > mean( 1:10 ) > lapply( 1:10, mean) > mean <- (1+4) / 2 > lapply( list( mean, median), fun

Re: [R] plot lines at 0,0 axis

2009-03-17 Thread Martin Maechler
> "PaCo" == p connolly > on Tue, 17 Mar 2009 10:42:49 +1300 writes: PaCo> Quoting Mohan Singh : >> Hii >> >> I am trying to plot lines at (0,0) axis where my scatterplot goes >> between positive n negative values for x and y axis >> >> i can plot point us

Re: [R] R-code in html help pages: syntax highlighting

2009-03-17 Thread Romain Francois
Wacek Kusnierczyk wrote: Romain Francois wrote: Duncan Murdoch wrote: That is an issue. I guess I will fall back on what the parser says and infer on the scoping. Within the lines below, mean would be different each time mean( 1:10 ) lapply( 1:10, mean) mean <- (1+4) / 2 lapply( list( mean,

Re: [R] sweep?

2009-03-17 Thread Wacek Kusnierczyk
rkevinbur...@charter.net wrote: > I am having a hard time understanding just what 'sweep' does. The > documentation states: > > Return an array obtained from an input array by sweeping out a summary > statistic. > > So what does it mean "weeping out a summary statistic"? > from both the text

Re: [R] errors when install RSQLite

2009-03-17 Thread Dongyan Song
Hello, I do loggin as root, and I tried three methods listed in INSTALL file in RSQLite, but still did not work. The whole error list is: ** libs WARNING: R include directory is empty -- perhaps need to install R-devel.rpm or similar gcc -std=gnu99 -I/usr/lib/R/include -DRSQLITE_USE_BUNDLED_SQLIT

Re: [R] R-code in html help pages: syntax highlighting

2009-03-17 Thread Wacek Kusnierczyk
Romain Francois wrote: > Wacek Kusnierczyk wrote: >> >> >>> Duncan Murdoch wrote: >>> >>> So if you've got high standards, it's probably quite hard. On the other hand, if you're willing to accept the usual sort of errors that syntax highlighters make, it's not so bad, but not triv

Re: [R] [Rd] R with MKL

2009-03-17 Thread Martyn Plummer
On Tue, 2009-03-17 at 12:12 +0900, Ei-ji Nakama wrote: > Hi > > > I have seen a lot of problems from people trying to compile R with > > MKL. So I am writing my experience in case it helps and to ask one > > question. I installed R-2.8.1.patched in Ubuntu 9.04 (gcc 4.3.3) using > > MKL 10.1.1.019.

[R] Merging.

2009-03-17 Thread Tammy Ma
Hi, All. I have a data frame with the part as : . 1422006-02-22 16:28:18 useractivity_act 8 0 1432006-02-22 16:28:26 42 0 1442006-02-22 16:28:28 33 0 1452006-02-22 16:28:31

Re: [R] permutations in R

2009-03-17 Thread Gavin Simpson
On Mon, 2009-03-16 at 18:43 -0400, Stavros Macrakis wrote: > Greg, > > I'm not bringing this up because I am bloody-minded, but because I > think it's a serious issue with the R libraries -- there is no obvious ^ packages > way to find relevant func

Re: [R] R with MKL

2009-03-17 Thread Martyn Plummer
On Mon, 2009-03-16 at 18:33 -0400, Cristián wrote: > Hi, > > I have seen a lot of problems from people trying to compile R with > MKL. So I am writing my experience in case it helps and to ask one > question. I installed R-2.8.1.patched in Ubuntu 9.04 (gcc 4.3.3) using > MKL 10.1.1.019. The R-adm

[R] Merging

2009-03-17 Thread Tammy Ma
Hi, All. I have a data frame with the part as : . 1422006-02-22 16:28:18 useractivity_act 8 0 1432006-02-22 16:28:26 42 0 1442006-02-22 16:28:28 33 0 1452006-02-22 16:28:31

Re: [R] Merging

2009-03-17 Thread Tammy Ma
Thanks for your reply, I couldn't use the method what the example gives. Because Data frame is quite big, and it has so many rows which are repeated. I am not pretty sure about the range of 1000. It turns out I should merge those row which repeated. Tammy > From: simon.pick...@bto.org > To: me

[R] help with 3-D plot of kernel density estimates

2009-03-17 Thread Josh
Hi, I guess I have a naive question. I use kde2d function in a standard way to estimate kernel densities of x and y (x and y are vectors) and plot them using image(). f1=kde2d(x,y) image(f1) But what if I want to see kernel estimates of three variables, x, y and z (a vector) plotted together ? So

Re: [R] Merging

2009-03-17 Thread Simon Pickett
Hi, I'm pretty sure you dont mean "merge" since merge() creates a new big data frame from two small ones. It appears that you want to omit some rows. As I said before, get used to selecting rows like this data.frame<-data.frame[data.frame$conditional.rows>1000,] (for example) Although I don

Re: [R] Merging

2009-03-17 Thread Pankaj Chopra
Is this what you want it to do ('n' is the original data frame)? > n v V1 V2 V3 V4 1 k a 2 1 2 2 l b 1 2 1 3 m c 2 1 2 4 n d 1 2 1 5 o e 2 1 2 > n1 <- n[,3:5] > n2 <- duplicated(n1) > n3 <- n[!n2,] > n3 v V1 V2 V3 V4 1 k a 2 1 2 2 l b 1 2 1 Pankaj Tammy Ma wrote:

[R] General help on sample size based on recurrent events

2009-03-17 Thread si.fu
Hello, I have a general help question that some of you might be able able to help. I would like calculate sample size for a study (a two group comparison) based on the outcome of reduction on (recurrent) events (say hospital admissions). In a previous study, hospital admission rate of 140 a

Re: [R] Merging

2009-03-17 Thread Tammy Ma
Sorry, I didn't sent it twice, but there is some problem on my emailSorry for this. Tammy > From: metal_lical...@live.com > To: r-help@r-project.org > Date: Tue, 17 Mar 2009 11:49:10 +0200 > Subject: [R] Merging > > > Hi, All. > > > I have a data frame with the part as : > > . > 1

Re: [R] sweep?

2009-03-17 Thread David Winsemius
On Mar 17, 2009, at 4:59 AM, Wacek Kusnierczyk wrote: rkevinbur...@charter.net wrote: I am having a hard time understanding just what 'sweep' does. The documentation states: Return an array obtained from an input array by sweeping out a summary statistic. So what does it mean "weeping o

Re: [R] help with 3-D plot of kernel density estimates

2009-03-17 Thread Duncan Murdoch
On 17/03/2009 6:44 AM, Josh wrote: Hi, I guess I have a naive question. I use kde2d function in a standard way to estimate kernel densities of x and y (x and y are vectors) and plot them using image(). f1=kde2d(x,y) image(f1) But what if I want to see kernel estimates of three variables, x, y a

Re: [R] multiple hypothesis testing

2009-03-17 Thread Neil Shephard
Vijaykumar Muley wrote: > > Dear all, > > Myself Vijaykumar Muley working as senior research fellow. By training I > am > a computational biologist with not a strong knowledge of statistics. I > have > done some analysis which is explained as follows, > > I have 10340 (X) profiles of binary v

Re: [R] Merging

2009-03-17 Thread Tammy Ma
My aim is not only relect unduplicated column, I also want merge the last column beside selection Thanks. Tammy > Date: Tue, 17 Mar 2009 06:59:20 -0400 > From: pcho...@ncsu.edu > To: metal_lical...@live.com > CC: r-help@r-project.org > Subject: Re: [R] Merging > > Is this what you want it t

Re: [R] Best way to do temporal joins in R?

2009-03-17 Thread Gabor Grothendieck
I am assuming that for each species and station_id that you want the value in that temp record whose date/time is closest to the date/time in the species record along with the identifying information (species, station_id) and date/time of the species. That interpretation does give the same answer

Re: [R] sweep?

2009-03-17 Thread Wacek Kusnierczyk
David Winsemius wrote: > >>A <- array(1:16, dim = c(4, 4)) >># sweep by * 1:4, with recycling >>sweep(A, 1, 1:4, '*') >> >> be careful to note that here '1' means that the operation is performed >> *columnwise*, unlike in the case of apply, where '1' means *rowwise*: > > The sweep opera

Re: [R] Merging

2009-03-17 Thread Keith Jewell
Is this what you want it to do? (aDF is the original data frame) > aDF V1V2 V3 V4 1 2006-02-22 16:28:18 useractivity_act 8 0 2 2006-02-22 16:28:26 4 2 0 3 2006-02-22 16:28:28 3 3 0 4 2006-02-22 16:28:31

[R] Double Cross validation for LASSO

2009-03-17 Thread Alex Roy
Dear R user, I am looking for a code on double cross validation in LASSO , one for optimizing the parameter and other one is for MSEP. If any one have it, please foroward to me. I am using different package like LARS, chemometric etc. Thanks in advance Alex [[altern

Re: [R] Merging

2009-03-17 Thread Tammy Ma
Does anyone know the solution`? Thanks, Tammy > From: metal_lical...@live.com > To: r-help@r-project.org > Date: Tue, 17 Mar 2009 11:49:10 +0200 > Subject: [R] Merging > > > Hi, All. > > > I have a data frame with the part as : > > . > 1422006-02-22 16:28:18 useractivity_act

[R] (no subject)

2009-03-17 Thread Aad Termorshuizen
# How do I make from a SpatialGridDataframe a normal data frame? If I do this in package gstat: library(gstat) g.dummy <- gstat(formula = z~1, locations = ~x+y, dummy = TRUE, beta = 0, model = vgm(1,"Exp",15), nmax = 20) set.seed(1) iso <- predict(g.dummy, newdata = xy, nsim = 10) gridded(iso) =

[R] matching vectors

2009-03-17 Thread emj83
I have two numerical vectors; hun2 is a subset of hun1: > hun1 [1] 147 198 141 170 184 136 150 134 144 161 124 103 107 110 121 79 106 51 [19] 102 109 52 71 52 80 95 78 75 96 101 107 107 80 71 49 71 64 [37] 58 68 75 85 55 52 70 90 98 90 100 98 74 78 60 69 106 103

[R] General help on sample size based on recurrent events

2009-03-17 Thread si.fu
Hello, I have a general help question that some of you might be able able to help. I would like to design a study (a two group comparison) based on reduction on events(say hospital admissions). In a previous study hospital admission rate of 140 admissions per 72 patients (over a 4 month period)

Re: [R] Double Cross validation for LASSO

2009-03-17 Thread Max Kuhn
Alex, >  I am looking for a code on double cross validation in > LASSO , one for optimizing the parameter and other one is for MSEP. If any > one have it, please foroward to me. I am using different  package like LARS, > chemometric etc. It won't do double cross-validation, but the caret package

Re: [R] Best way to do temporal joins in R?

2009-03-17 Thread Gabor Grothendieck
In thinking about this some more an SQL solution would be a bit easier. Try this where species and temp are from the prior post (i.e. after processing with chron). The first statement finds the minimum distances for each species and station_id combination. The second finds all combinations of a

Re: [R] Merging

2009-03-17 Thread Tammy Ma
I still couldn't solve itany help would be preciated! Tammy > From: metal_lical...@live.com > To: r-help@r-project.org > Date: Tue, 17 Mar 2009 11:49:10 +0200 > Subject: [R] Merging > > > Hi, All. > > > I have a data frame with the part as : > > . > 1422006-02-22 16:28

Re: [R] Non-Linear Optimization - Query

2009-03-17 Thread Ravi Varadhan
Hi Lars, The approach suggested by Paul Smith is one way to try and solve your problem. Another aproach is to try and eliminate, if possible, one of the variables using the equality constraint, so that the problem now become unconstrained in (p-1) dimensions (where p is the original dimension

Re: [R] Merging

2009-03-17 Thread Annette Heisswolf
Tammy, You won't get more help if you post this again every half an hour... I don't quite understand what you exactly want to do, but it seemed at least to me that Keith's suggestion (see again below) pretty much does what you want. If not, could you please specify *EXACTLY* what you want to do

[R] coefficient graph

2009-03-17 Thread Sachi Ito
Dear R list members, I'd like to make a graph of coefficients of the intercept, variable 1, and variable 2 (and possibly the interaction between variable 1 and variable 2). When I use the lmList function as attached below, it shows a nice coefficient graph. > PACRP.lis <- lmList(PAffect ~ CRPC +

Re: [R] bigglm() results different from glm()

2009-03-17 Thread John Fox
Dear Francisco, I was able to duplicate the problem that you reported, and in addition discovered that the problem seems to be peculiar to the poisson family. lm(y~ttment, data=dat) and biglm(y~ttment, data=dat) produce identical results, as do glm(y~ttment, data=dat) and bigglm(y~ttment, data=dat

Re: [R] Merging

2009-03-17 Thread Tammy Ma
Thanks. Actually, I have been trying many time using method from KJ, There is always the following information coming up or Rgui exit without reason.. I have no idea about this? gh<-with(act_data12, aggregate(V4, by=list(V1,V2,V3), sum)) Error in unlist(y, recursive = FALSE) : promise alrea

[R] set a legend with an "image" graph

2009-03-17 Thread Luis Ridao Cruz
R-help, I have an image plot and I wish to set a legend to it but I don't have an idea how to do it. Below it's the code line. image(yyy, col = rev(heat.colors(10)), axes = T) Thanks in advance. __ R-help@r-project.org mailing list https://stat.ethz.c

Re: [R] Merging

2009-03-17 Thread Keith Jewell
Looks as if you copied my code without modifying to suit your data frame. My data frame (aDF) had column names V1, V2, V3, V4 > str(aDF) 'data.frame': 12 obs. of 4 variables: $ V1: chr "2006-02-22 16:28:18" "2006-02-22 16:28:26" "2006-02-22 16:28:28" "2006-02-22 16:28:31" ... $ V2: Factor w

[R] Difficulty Replacing a Row of a Data Frame

2009-03-17 Thread Bill Cunliffe
I have the following data frames, avGain and retGain. They have the same dimensions. The following line of code replaces row j of avGain as desired: avGain[j, ] <- mean( retGain[jStart:j, ] ) However, the following line does not work: avGain[j, ] <- ( avGain[j-1, ] * ( DAYS - 1 ) +

Re: [R] RES: set a legend with an "image" graph

2009-03-17 Thread Luis Ridao Cruz
R-help, I'm sorry that I said " I don't have idea ". What I mean t is that I just don't know how to set a legend when "image" is called. Thanks in advance __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] R package to automatically produce combination plot?

2009-03-17 Thread Jason Rupert
I guess no reply means there is not an existing package to produce the plot? I will post the results of my script to hopefully help others who are trying to formulate the same plot. Thanks again. --- On Mon, 3/16/09, Jason Rupert wrote: > From: Jason Rupert > Subject: [R] R package to aut

[R] RES: set a legend with an "image" graph

2009-03-17 Thread Rodrigo Aluizio
Luis, take a look at the ?legend function, it can produce almost any kind of legend you may need! Hope It helps. Rodrigo. -Mensagem original- De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em nome de Luis Ridao Cruz Enviada em: terça-feira, 17 de março de 2009 11:

Re: [R] Merging

2009-03-17 Thread Keith Jewell
In case it helps, this refers to the columns by position rather than name... > aggregate(aDF[,4], by=aDF[,-4], sum) It sums the fourth column (I'm guessing this is what Tammy meant by "merge") for unique combinations of all columns except the fourth. It doesn't need the column names inside the ag

Re: [R] matching vectors

2009-03-17 Thread jim holtman
You can use something like this to make sure that h2 is a subset of h1 in consecutive order: > h1 <- 1:50 > h2 <- 25:30 > hm <- match(h2, h1) > all(diff(hm) == 1) [1] TRUE > On Tue, Mar 17, 2009 at 6:42 AM, emj83 wrote: > > I have two numerical vectors; hun2 is a subset of hun1: > >> hun1 >  [

[R] Need to build package for Affy HT HG-U133+ PM arrays

2009-03-17 Thread James Mcininch
I would like to build a package for the HT HG-U133+ PM arrays from affy, but I can't find any good documentation on how to go about it. Naively using makecdfenv's make.cdf.package() causes R to seg-fault. I'm unfamiliar with the CDF format as such, but I'm guessing that it's changed somewhat be

Re: [R] Merging

2009-03-17 Thread Tammy Ma
My data frame is: > str(act_data12) 'data.frame': 1687 obs. of 5 variables: $ Date: chr "2006-02-22" "2006-02-22" "2006-02-22" "2006-02-22" ... $ Dtime : chr "14:36:10" "14:36:11" "14:36:12" "14:37:38" ... $ FocusApp_seq: chr "useractivity_act" "4" "3" "0" ... $ App_duratio

[R] Way to rotate a histogram?

2009-03-17 Thread Jason Rupert
Here is what I have so far: > test_data<-rnorm(100) > par(mfrow=c(1,3)) # 3 rows by 1 columns layout of plots > hist(test_data) > boxplot(test_data) > qqnorm(test_data) I noticed that I can rotate a boxplot via "horizontal", but apparently "hist" does not have that functionality. I tried stack

[R] Combining Sweave and fancyvrb

2009-03-17 Thread Giovanni Petris
I find Sweave very useful and I was trying to combine it with the latex package fancyvrb. I was trying to get line numbering and labels in order to reference the lines where particular commands occur. Unfortunately, I haven't been able to figure out how to do it. Maybe somebody can help me. The

Re: [R] Way to rotate a histogram?

2009-03-17 Thread David Winsemius
I believe that hist will return a vector that could be passed to barplot: h.islands <- hist(islands) > barplot(h.islands$intensities, horiz=TRUE) # or > barplot(h.islands$counts, horiz=TRUE) David Winsemius On Mar 17, 2009, at 11:38 AM, Jason Rupert wrote: Here is what I have so far:

[R] Help with R.oo's Rdoc$compile()

2009-03-17 Thread Ken Feng
Does anyone have a sample file with an example/template for Rdoc (as implemented in R.oo)? The command I am using is Rdoc$compile(), but I am having difficulties figuring out what the Macros look like. Apparently, in the headers, I see that I should use one of: # @RdocClass className # @RdocMeth

[R] Multilevel Modeling using R

2009-03-17 Thread WONG, Ka Yau
Dear experts, I use R to conduct multilevel modeling. However, I have a problem about the interpretation of random effect. Unlike the variables in fixed effects, the variables in random effects have not shown the standard error (s.e.) and p-value, so I don't know whether the

Re: [R] Get user system name

2009-03-17 Thread Paolo Sonego
UNIX only (At least it works under Linux and Mac OS X): (user <- system("users", intern=T)) Paolo __ 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

[R] the quote problem with readLines()

2009-03-17 Thread Dongyan Song
Dear all, I read a file with all numbers with readLines function, as below, > f <- file("data.txt") > a <- readLines(f) but all the values in a are in format "", and I cannot do the calculation with them since they are not numeric. I wonder how should I skip those quotes, thank you for help!

Re: [R] Difficulty Replacing a Row of a Data Frame

2009-03-17 Thread stephen sefick
not off the top of my head, but if you provide a reproducible example (cut and paste into R) then I may be able to help you. On Tue, Mar 17, 2009 at 10:44 AM, Bill Cunliffe wrote: > I have the following data frames, avGain and retGain.  They have the same > dimensions. > > > > The following line

Re: [R] Multilevel Modeling using R

2009-03-17 Thread Doran, Harold
That's by intent, by the way. The standard errors of the variance components are only useful if the distribution is symmetric, and this is not always true. If you were using lmer, and not lme, then you could use the mcmcsamp function to look at the distribution of the random effects to see if it is

Re: [R] Difficulty Replacing a Row of a Data Frame

2009-03-17 Thread Levi Waldron
Your first example that works would just repeat the atomic vector to the length of the row. To replace a row with another data frame, you could use rbind: avGain <- rbind(avGain[-j,],b) Or if the positioning is important, 2) avGain <- rbind(avGain[1:(j-1),],b,avGain[(j+1):nrow(avGain),]) I didn

Re: [R] R package to automatically produce combination plot?

2009-03-17 Thread stephen sefick
I don't know if this will help, but look at the R graph gallery. There may be something there, with code, that will work. On Tue, Mar 17, 2009 at 10:39 AM, Jason Rupert wrote: > > I guess no reply means there is not an existing package to produce the plot? > > I will post the results of my script

Re: [R] Way to rotate a histogram?

2009-03-17 Thread Patrizio Frederic
Jason, be carefully to the order of intensities (counts or densities): x=rnorm(1000) par(mfrow=c(2,2)) h=hist(x,breaks=bk<-c(-5,-3,-2,-1,-.5,0,1,3,5)) barplot(rev(h$intensities),rev(bk[2:9]-bk[1:8]),space=0,horiz=T) # compare to axis(2) barplot(h$intensities,bk[2:9]-bk[1:8],space=0,horiz=T) axis(2

Re: [R] Combining Sweave and fancyvrb

2009-03-17 Thread Andrew Ellis
try this: create a file called mySweave.sty, containing the following code: \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{mySweave}{} \RequirePackage{ifthen} \newboolean{swe...@gin} \setboolean{swe...@gin}{true} \newboolean{swe...@ae} \setboolean{swe...@ae}{true} \RequirePackage{ifthen} \RequirePack

Re: [R] Merging

2009-03-17 Thread Keith Jewell
OK, I can't see anything wrong with that. a) post the results of ... > sessionInfo() ... so we can check you're using a reasonably up to date system b) send a copy of your data set to me at... k.jewell at campden.co.uk ... and I'll see if I can reproduce your error. I can take most common da

Re: [R] permutations in R

2009-03-17 Thread Greg Snow
No, I meant the Combinations package, it is apparently an Omegahat package (http://www.omegahat.org/Combinations/). It looks similar to the permn function as far as the usage goes, but the documentation includes additional information on other resources. -- Gregory (Greg) L. Snow Ph.D. Statis

[R] breaking ties in order() based on many vectors

2009-03-17 Thread Levi Waldron
The order() function allows you to specify multiple vectors, which are used successively to break ties. If I want to use many vectors to break ties (say, 25 or more), that are columns of a matrix or elements of a list, does anyone know a shortcut to do this without passing 25 arguments to order()?

Re: [R] Difficulty Replacing a Row of a Data Frame

2009-03-17 Thread Bill Cunliffe
Thanks for your help. Part of the problem was that I thought I was dealing with a data frame when it was actually an array. I forced all to be matrices for consistency. However, I see that avGain <- rbind(avGain[1:(j-1),],b,avGain[(j+1):nrow(avGain),]) would be a great solution as posit

Re: [R] breaking ties in order() based on many vectors

2009-03-17 Thread Levi Waldron
On Tue, Mar 17, 2009 at 12:56 PM, Patrick Burns wrote: > Use 'do.call' as discussed in 'The R Inferno' > and elsewhere. Perfect, thanks. -- Levi Waldron post-doctoral fellow Jurisica Lab, Ontario Cancer Institute Division of Signaling Biology IBM Life Sciences Discovery Centre TMDT 9-304D 101

[R] Std.Error in Analysis of Deviance Table

2009-03-17 Thread Alexander Jüterbock
Hello, I would be pleased if you could help me in determining the standard error of the estimate for “place2L1.N2” from the following table: Call: glm(formula = y ~ places2 + shellheight, family = quasibinomial) Deviance Residuals: Min1QMedian3Q Max -3.41415 -

Re: [R] Need to build package for Affy HT HG-U133+ PM arrays

2009-03-17 Thread James W. MacDonald
This question is better asked on the Bioconductor list (bioconduc...@stat.math.ethz.ch). James Mcininch wrote: I would like to build a package for the HT HG-U133+ PM arrays from affy, but I can't find any good documentation on how to go about it. Naively using makecdfenv's make.cdf.package()

[R] A useful alternative to simple merging?

2009-03-17 Thread Frank E Harrell Jr
In the case of 1:1 merging with distinct sets of non-ID variables in two or more datasets, would the following code, which doesn't need to form the larger merged data frame, be useful or faster? [A generalization of with() would make this even better. I've often wondered about the utility of

[R] initial value in 'vmmin' is not finite

2009-03-17 Thread Andreia Mendonça
Dear r helpers, I'm trying to run the models of the BIOMOD package and got this message: * Error in nnet.default (x, y, w,...): **initial value in 'vmmin' is not finite* What does this mean? and how can I correct it? Thank you *Andreia* [[alternative HTML version deleted]]

[R] Interview: Jon Peck on SPSS, R ,Python ...

2009-03-17 Thread Ajay ohri
Dear List, I recently got the chance to interview Jon Peck of SPSS Inc, a pioneering technical statistician working since 1983 (when there were only two substantial statistical software companies as per him ;) (not anymore ;) and currently he is a Principal Software Engineer and Technical Advisor

Re: [R] bigglm() results different from glm()

2009-03-17 Thread Thomas Lumley
Yes, the slow convergence is easier to get with the log link. Overshooting the correct coefficient vector has more dramatic effects on the fitted values and weights, and in this example the starting value of (0,0) is a long way from the truth. The same sort of thing happens in the Cox model

[R] 3d layering

2009-03-17 Thread kapo coulibaly
Is it possible to render a volume like the one attached, in R using packages misc3d or rgl if I have the data for the individual surfaces (top and bottom for each layer). Thanks __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] 3d layering

2009-03-17 Thread Duncan Murdoch
On 3/17/2009 1:57 PM, kapo coulibaly wrote: Is it possible to render a volume like the one attached, in R using packages misc3d or rgl if I have the data for the individual surfaces (top and bottom for each layer). Your figure wasn't attached, but I'd guess the answer is yes. rgl allows you

[R] package vars: save plots

2009-03-17 Thread Koboltschnig, Rose-Gerd
hello, i use the vars package and would like to save the plots plotted with the plot method for objects with class attribute varest etc. so, if library(vars) data(Canada) var.canada <- VAR(Canada) then plot(var.canada) produces a plot for every of the four variable

Re: [R] Difficulty Replacing a Row of a Data Frame

2009-03-17 Thread Levi Waldron
On Tue, Mar 17, 2009 at 12:54 PM, Bill Cunliffe wrote: > Thanks for your help. Part of the problem was that I thought I was > dealing with a data frame when it was actually an array. I forced all to be > matrices for consistency. However, I see that > > > > avGain <- rbind(avGain[1:(j-1),],b,a

Re: [R] Non-Linear Optimization - Query

2009-03-17 Thread Paul Smith
Hi Lars, Consider the following problem: max x + y subject to x^2 + y^2 =1. The solution is obviously (x,y) = (sqrt(2) / 2, sqrt(2) / 2). Now, consider the unconstrained maximization problem on the variables x, y and lambda: max x + y + lambda * (x^2 + y^2 - 1) (Notice that the objective fu

Re: [R] package vars: save plots

2009-03-17 Thread David Winsemius
You do not mention your OS, so further details may be needed. Graphical output can be constrained by machine details. As a first step, why not try a format that has multiple page possibilities such as pdf ... this gives me 4 pages: pdf(file ="outtest.pdf") ?lm ctl <- c(4.17,5.58,5.18,6

Re: [R] Way to rotate a histogram?

2009-03-17 Thread Jason Rupert
Awesome. This seems to produce the vertical histogram as needed, but is there then a way to come back and add on a probability distribution line? That is, add something like the following to the barplot: points(density(x), type='l', lwd=3, col='red') Thanks again. --- On Tue, 3/17/09, Patr

[R] update on mcmcsamp for glmer

2009-03-17 Thread Tanja Srebotnjak
I've searched the help archives of both lists and apologize if I missed the answer to my question: Is there an update on developing mcmcsamp for glmer? I'm using R v. 2.7.2 (on our Unix server - will hopefully be updated soon) and 2.8.1 on my PC and get the message for both: gm1 <- glmer(cbind

[R] AFT model

2009-03-17 Thread tsn4867
Hi, In the package survival, using the function survreg for AFT model, I only see 4 distributions for the response y: weibull, gaussian, logistic, lognormal and log-logistic, which correspond to certain distributions for the error terms. I'm wondering if there is a package or how to obta

Re: [R] Way to rotate a histogram?

2009-03-17 Thread David Winsemius
Can you reverse the x and y columns of the density object? plot(density(c(-20,rep(0,98),20))$y, density(c(-20,rep(0,98),20))$x, xlim = c(0,1), ylim=c(-4,4), type='l', lwd=3, col='red') -- David Winsemius On Mar 17, 2009, at 2:38 PM, Jason Rupert wrote: Awesome. This seems to

Re: [R] Non-Linear Optimization - Query

2009-03-17 Thread Ravi Varadhan
Lars, Here is how you can solve the example given by Paul using spg() in "BB" package. f <- function(x, lambda) x[1] + x[2] - lambda * (x[1]^2 + x[2]^2 - 1)^2 # look at how Penalized function is formulated eps <- Inf tol <- 1.e-05 p0 <- c(1, 1) lambda <- 0.1 # start with a small value for

Re: [R] Non-Linear Optimization - Query

2009-03-17 Thread Ravi Varadhan
Here is how you can implement the Lagrangian multiplier approach and solve the first-order KKT conditions to obtain the solution for Paul Smith's example: require(BB) f2 <- function(x) { f <- rep(NA, length(x)) f[1] <- 1 + 2 * x[1] * x[3] # x[3] is the Lagrangian multiplier f[2] <- 1 +

[R] RODBC changes data types when reading from MS SQL Server 2005 -- How to fix?

2009-03-17 Thread Seeliger . Curt
Folks, As reproduced in the code below, our data is being transformed during the sqlFetch() operation. This has apparently been an issue since 2002. Are there any ways for correctly reading data from MS SQL Server 2005? Why does RODBC ignore the type information supplied by SQL Server? req

Re: [R] Non-Linear Optimization - Query

2009-03-17 Thread Paul Smith
On Tue, Mar 17, 2009 at 7:10 PM, Ravi Varadhan wrote: > Here is how you can implement the Lagrangian multiplier approach and solve > the first-order KKT conditions to obtain the solution for Paul Smith's > example: > >        require(BB) > > f2 <- function(x) { > f <- rep(NA, length(x)) > f[1] <-

[R] Need a little help setting the upper median using "layout"...

2009-03-17 Thread Jason Rupert
The code I'm using is shown below. I would like to have a larger median at the top of the plot so that I can show the entirity of "title_text". Several times I tried messing with "par(mar", but that seemed to make matters worse. By any chance can anyone provide any insight as to the best

[R] sorting by creation time in ls()

2009-03-17 Thread Alexy Khrabrov
When trying to remember what did I do in the session, especially after coming back to it after a few days, I'd like to mimic Unix's ls -ltrh -- does R retain the timing a certain variable is created? If not, would it make a useful addition, to have ls with an option to sort by creation tim

Re: [R] Non-Linear Optimization - Query

2009-03-17 Thread Berend Hasselman
Ravi Varadhan wrote: > > > require(BB) > > f2 <- function(x) { > f <- rep(NA, length(x)) > f[1] <- 1 + 2 * x[1] * x[3] # x[3] is the Lagrangian multiplier > f[2] <- 1 + 2 * x[2] * x[3] > f[3] <- x[1]^2 + x[2]^2 - 1 # the equality constraint > f > } > > You can also try my packag

Re: [R] R package to automatically produce combination plot?

2009-03-17 Thread Paul Murrell
Hi Jason Rupert wrote: > I guess no reply means there is not an existing package to produce > the plot? > > I will post the results of my script to hopefully help others who are > trying to formulate the same plot. > > Thanks again. I don't know of an existing function that does that particul

Re: [R] Multilevel Modeling using R

2009-03-17 Thread Stas Kolenikov
In most biometric applications, those variances are treated as nuisance parameters. They only need to be controlled for, while the main purpose is to get the right point estimates and standard errors for the fixed effects. In social science multilevel modeling (of which education is probably the he

Re: [R] R package to automatically produce combination plot?

2009-03-17 Thread Jason Rupert
Paul, This is great! Like you said it is really close. I made a few changes and for some reason the y-axis label magically came back. I tried to remove it but it wouldn't stay away. Also, for some reason the title exceeds the margins of the layout. I am going ot mess around with this a

[R] Requesting assistance installing ESS for R on Redhat

2009-03-17 Thread Steve_Friedman
I'm moving my R applications to a Redhat OS and want to install ESS. My sys admin has downloaded the rpm (emacs-common-ess-5.3.8-1.fc8.src.rpm), but when he tried to do the install he rec'd a number of warnings. We are not sure if the warnings are telling us that the installation did not occur

Re: [R] Requesting assistance installing ESS for R on Redhat

2009-03-17 Thread Marc Schwartz
On Mar 17, 2009, at 3:29 PM, steve_fried...@nps.gov wrote: I'm moving my R applications to a Redhat OS and want to install ESS. My sys admin has downloaded the rpm (emacs-common- ess-5.3.8-1.fc8.src.rpm), but when he tried to do the install he rec'd a number of warnings. We are not sure if

Re: [R] Way to rotate a histogram?

2009-03-17 Thread Mike Lawrence
Using ggplot2: library(ggplot2) test_data<-rnorm(100) a=data.frame(obs=test_data,condition='None') p1=qplot( data=a ,x=obs ,geom='histogram' )+coord_flip() p2=qplot( data=a ,y=obs ,x=condition ,geom='boxplot' )+opts(

Re: [R] sorting by creation time in ls()

2009-03-17 Thread Tony Plate
R doesn't keep track of when objects were created, so that's not possible. If this is important to you, you could look at the 'trackObjs' package, which does this and also stores individual objects in individual files (and writes them to the file when they are changed in R). -- Tony Plate Ale

  1   2   >