Re: [R] dataframe of dataframes?

2010-09-13 Thread Henrik Bengtsson
You can create an empty matrix (or even array) of list elements and then assign your data frames to whichever element you want. Example: # Allocate empty matrix... > x <- matrix(list(), nrow=2, ncol=3); # ...alternatively > x <- array(list(), dim=c(2,3)); > print(x); [,1] [,2] [,3] [1,] NULL

Re: [R] apply over parallel lists and their elements

2010-09-13 Thread Liviu Andronic
On Tue, Sep 14, 2010 at 12:44 AM, David Winsemius wrote: > The second argument to mean is trim. I am not sure what mean(1, 3) is > supposed to do but what it return is 1. > Thanks for the info. On this particular point I find the documentation confusing. In ?mapply : '‘mapply’ applies ‘FUN’ t

Re: [R] xlab with text and expression

2010-09-13 Thread threshold
One more question, given that plot(rnorm(1),rnorm(1), ylab=expression(a~b >= 3), cex.lab=1.2) then sign >= seems to be smaller than the rest, seems like cex.lab=1.2 affects only the text in ylab. 1) Is there any way to alter its size to follow the size of the whole expression? It works nice for

Re: [R] dataframe of dataframes?

2010-09-13 Thread Jeff Newmiller
raje...@cse.iitm.ac.in wrote: Hi, I create several dataframes in a nested loop and would like to maintain them in a matrix form with each dataframe represented by the row and the column. How can I do this? You can't, at least as you describe it. However, you can add a column for "row ID"

[R] panel data and model selection

2010-09-13 Thread amatoallah ouchen
Good day R-listers, I'm working with a panel dataset, i've used many models , homogeneous (fixed effect, pooled ols and Driscoll and Kraay) heterogeneous (swamy random coefficients) and would like to do a post-estimation to select the model that best fit my regression. is there any method, co

[R] dataframe of dataframes?

2010-09-13 Thread raje...@cse.iitm.ac.in
Hi, I create several dataframes in a nested loop and would like to maintain them in a matrix form with each dataframe represented by the row and the column. How can I do this? [[alternative HTML version deleted]] __ R-help@r-project.org maili

[R] Getting Error while connecting "R"

2010-09-13 Thread krishan . kumar
Hi, This is Krishan, I am working on r-project through vb.Net While calling the r-project I got following error System.Runtime.InteropServices.COMException (0x80040013): Exception from HRESULT: 0x80040013 at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type ob

Re: [R] xyplot axis line width

2010-09-13 Thread array chip
Thanks for the hint. But I want to change the line thickness, mgp() concerns the the spacing. Also I think par() doesn't have any effect on lattice plots. It seems to be an easy thing to make axis line thicker, anyone has nay suggestions? Thanks John - Original Message From: Daisy

Re: [R] relative risk regression with survey data

2010-09-13 Thread Daniel Nordlund
Thanks to Thomas Lumley and David Winsemius for their responses. I had read a number of papers by Thomas and have ordered his book on survey analysis, but I wanted to get some confirmation because I wanted to get started before the book arrived. Thanks, again. Dan Daniel Nordlund Bothell, WA US

Re: [R] Stats Question

2010-09-13 Thread Ben Bolker
David Winsemius comcast.net> writes: > On Sep 13, 2010, at 8:27 PM, csiro.au> wrote: > > > I have site data with variables that vary across sites (like wind > > speed, moisture content) and within sites I have experimental units > > (logs) with associated variables (like decay class, suspen

Re: [R] xyplot axis line width

2010-09-13 Thread Daisy Englert Duursma
check out ?par for all the details on plotting ‘mgp’ The margin line (in ‘mex’ units) for the axis title, axis labels and axis line. Note that ‘mgp[1]’ affects ‘title’ whereas ‘mgp[2:3]’ affect ‘axis’. The default is ‘c(3, 1, 0)’. On Tue, Sep 14, 2010 at 8:56 AM,

Re: [R] Homogeneity of regression slopes

2010-09-13 Thread Thomas Stewart
Allow me to add to Michael's and Clifford's responses. If you fit the same regression model for each group, then you are also fitting a standard deviation parameter for each model. The solution proposed by Michael and Clifford is a good one, but the solution assumes that the standard deviation pa

Re: [R] relative risk regression with survey data

2010-09-13 Thread Thomas Lumley
On Mon, 13 Sep 2010, Daniel Nordlund wrote: I have been asked to look at options for doing relative risk regression on some survey data. I have a binary DV and several predictor / adjustment variables. In R, would this be as "simple" as using the survey package to set up an appropriate desig

Re: [R] Homogeneity of regression slopes

2010-09-13 Thread Michael Bedward
Thanks for turning my half-baked suggestion into something that would actually work Cliff :) Michael On 14 September 2010 12:27, Clifford Long wrote: > If you'll allow me to throw in two cents ... > > Like Michael said, the dummy variable route is the way to go, but I believe > that the coeffici

Re: [R] Homogeneity of regression slopes

2010-09-13 Thread Clifford Long
If you'll allow me to throw in two cents ... Like Michael said, the dummy variable route is the way to go, but I believe that the coefficients on the dummy variables test for equal intercepts. For equality of slopes, do we need the interaction between the dummy variable and the explanatory variab

Re: [R] The future of R - Ross Ihaka stirs discussions around the web

2010-09-13 Thread Spencer Graves
Hello: On 9/13/2010 3:44 PM, Vojtěch Zeisek wrote: > Hello > > Dne Po 13. září 2010 14:51:39 Tal Galili napsal(a): > But here, I wish point out one issue, which can be fixed relatively > easily: R would deserve much more better web running some good > open-source CMS. I have very good exp

Re: [R] Stats Question

2010-09-13 Thread David Winsemius
On Sep 13, 2010, at 8:27 PM, wrote: I have site data with variables that vary across sites (like wind speed, moisture content) and within sites I have experimental units (logs) with associated variables (like decay class, suspension). With normal response y one can use R to get the betwee

Re: [R] How to tell R that "ABC" is the name of a dataset not a variable value

2010-09-13 Thread Jie Li
Thanks! This helps a lot! On Mon, Sep 13, 2010 at 4:35 PM, Joshua Wiley wrote: > Hi, > > Just to provide an example: > > > #Sample data copied to variables "X", "Y", and "Z" > Z <- Y <- X <- data.frame(A = 1:10) > > # A variable holding the names of the variables > datasetname <- c("X", "Y", "Z")

Re: [R] proportion

2010-09-13 Thread ROLL Josh F
Sure I tried that and it works but I was formerly using just 'proportion ' so I find it strange that this has occurred. -Original Message- From: Phil Spector [mailto:spec...@stat.berkeley.edu] Sent: Monday, September 13, 2010 4:08 PM To: ROLL Josh F Cc: r-help@r-project.org Subject: Re:

[R] Stats Question

2010-09-13 Thread Jennifer.Hollis
I have site data with variables that vary across sites (like wind speed, moisture content) and within sites I have experimental units (logs) with associated variables (like decay class, suspension). With normal response y one can use R to get the between and within site information using aov(y~

Re: [R] reshape matrix entities to columns

2010-09-13 Thread Natasha Asar
I am trying this as you mentioned and getting an error which i cant fix do you know where is the problem? > df2[is.na(df2)] <- 0 > df2 X age no. age.1 no..1 age.2 no..2 age.3 no..3 age.4 no..4 1 center1 3 9 6 4 9 110 1 0 0 2 center2 5 3 9

Re: [R] reshape matrix entities to columns

2010-09-13 Thread David Winsemius
On Sep 13, 2010, at 8:51 PM, Natasha Asar wrote: > I am trying this as you mentioned and getting an error which i cant > fix > do you know where is the problem? > > > df2[is.na(df2)] <- 0 > > df2 > X age no. age.1 no..1 age.2 no..2 age.3 no..3 age.4 no..4 > 1 center1 3 9 6

Re: [R] post

2010-09-13 Thread Hadley Wickham
Have a look at: "Computing Thousands of Test Statistics Simultaneously in R" by Holger Schwender and Tina Müller, in http://stat-computing.org/newsletter/issues/scgn-18-1.pdf Hadley On Mon, Sep 13, 2010 at 4:26 PM, Alexey Ush wrote: > Hello, > > I have a question regarding how to speed up the t

Re: [R] Homogeneity of regression slopes

2010-09-13 Thread Michael Bedward
Hello Doug, Perhaps it would just be easier to keep your data together and have a single regression with a term for the grouping variable (a factor with 3 levels). If the groups give identical results the coefficients for the two non-reference grouping variable levels will include 0 in their confi

[R] relative risk regression with survey data

2010-09-13 Thread Daniel Nordlund
I have been asked to look at options for doing relative risk regression on some survey data. I have a binary DV and several predictor / adjustment variables. In R, would this be as "simple" as using the survey package to set up an appropriate design object and then running svyglm with family=

Re: [R] xyplot legends

2010-09-13 Thread array chip
Thanks David. It almost does what I wanted, except it's plotting the point characters 3 time for each line (left, middle and right): o---o---o I can live with that if there is no way to get rid of the point characters at the ends. Thanks very much! John - Original Message From: D

Re: [R] proportion

2010-09-13 Thread Phil Spector
Maybe prop.table ? - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

Re: [R] xyplot legends

2010-09-13 Thread David Winsemius
On Sep 13, 2010, at 6:25 PM, array chip wrote: Hi all, I When I plot both lines and points using type=c('l', 'p') in xyplot(), if I want to include in legend both of them using keys=list(lines=list(col=1:3), points=list(pch=1:3)), the lines and points are plotted side by side in legend.

Re: [R] Question: Form a new list with the index replicated equal to the number of elements in that index

2010-09-13 Thread Peter Dalgaard
On 09/13/2010 08:41 PM, Sunny Srivastava wrote: > Dear R-Helpers, > I have a list l1 like: > > l1[[1]] > a b c > > l1[[2]] > d > > l1[[3]] > e f > > I want an output res like: > > res[[1]] > 1 1 1 > > res[[2]] > 2 > > res[[3]] > 3 3 > > Essentially, I want to replicate each index equal to t

[R] proportion

2010-09-13 Thread LCOG1
Hi , SO i have been on a role of asking simple questions lately. So much for feeling like im getting this R business. I wrote a script 2 weeks ago that utilized "proportion" to turn values in a table (from "table") into proportions to then graph. I now get an error that proportion is not a

[R] post

2010-09-13 Thread Alexey Ush
Hello, I have a question regarding how to speed up the t.test on large dataset. For example, I have a table "tab" which looks like: a b c d e f g h 1 2 3 4 5 ... 10 dim(tab) is 10 x 100 I need to do the t.test for each ro

Re: [R] Question: Form a new list with the index replicated equal to the number of elements in that index

2010-09-13 Thread Sunny Srivastava
Thank you very much list! On Mon, Sep 13, 2010 at 5:04 PM, Phil Spector wrote: > Sunny - > I don't think mapply is needed: > > lapply(1:length(mylist),function(x)rep(x,length(mylist[[x]]))) >> > [[1]] > [1] 1 1 1 > > [[2]] > [1] 2 > > [[3]] > [1] 3 3 > >

[R] Homogeneity of regression slopes

2010-09-13 Thread Doug Adams
Hello, We've got a dataset with several variables, one of which we're using to split the data into 3 smaller subsets. (as the variable takes 1 of 3 possible values). There are several more variables too, many of which we're using to fit regression models using lm. So I have 3 models fitted (one

Re: [R] Question: Form a new list with the index replicated equal to the number of elements in that index

2010-09-13 Thread Henrique Dallazuanna
Try this: relist(rep(1:length(l1), sapply(l1, length)), l1) On Mon, Sep 13, 2010 at 3:41 PM, Sunny Srivastava wrote: > Dear R-Helpers, > I have a list l1 like: > > l1[[1]] > a b c > > l1[[2]] > d > > l1[[3]] > e f > > I want an output res like: > > res[[1]] > 1 1 1 > > res[[2]] > 2 > > res[[3]]

[R] xyplot axis line width

2010-09-13 Thread array chip
Hi, another question: is there any argument that controls the line width of axis box of xyplot()? I tried lwd=2 or lwd.axis=2 in xyplot() or within scales=list() argument, without success. Thanks John __ R-help@r-project.org mailing list https://st

Re: [R] The future of R - Ross Ihaka stirs discussions around the web

2010-09-13 Thread Vojtěch Zeisek
Hello Dne Po 13. září 2010 14:51:39 Tal Galili napsal(a): Hello all, There is currently a (very !) lively discussions happening around the web, surrounding the following topics: 1) Is R efficient? (scripting wise, and performance wise) 2) Should R be written from scratch? 3) What should be the

[R] xyplot legends

2010-09-13 Thread array chip
Hi all, I When I plot both lines and points using type=c('l', 'p') in xyplot(), if I want to include in legend both of them using keys=list(lines=list(col=1:3), points=list(pch=1:3)), the lines and points are plotted side by side in legend. Is there anyway to plot the points in the middle of th

Re: [R] Plot with Group # as pch

2010-09-13 Thread Peter Ehlers
On 2010-09-13 16:11, Kevin Burnham wrote: The line I have now is this: plot(alldata$haa_Haa, pch=alldata$Subject.Group) This more or less gives me what I want, but instead of using the actual group number as the plotting point it converts it to the pch character corresponding to that number. I

[R] Problem (environment?) with R CMD CHECK

2010-09-13 Thread Peter Langfelder
Hi all, I have a package that contains a function foo that calls a function .fooInternal via match.fun('.fooInternal'). This step is necessary because I want to give the user an option to override .fooInternal with a custom function. The .fooInternal function name is not exported. The function foo

Re: [R] Plot with Group # as pch

2010-09-13 Thread Kevin Burnham
The line I have now is this: plot(alldata$haa_Haa, pch=alldata$Subject.Group) This more or less gives me what I want, but instead of using the actual group number as the plotting point it converts it to the pch character corresponding to that number. Is there a way that the above line could be m

Re: [R] Dampening the spline interpolation for contours

2010-09-13 Thread Spencer Graves
Have you considered something like the following: install.packages('sos') # if it's not already installed library(sos) si <- findFn('spline interpolation') # 125 matches summary(si) # in 64 packages si # opens the results as a table in a web browser # sorted to put first the package with the mo

Re: [R] Plot with Group # as pch

2010-09-13 Thread David Winsemius
On Sep 13, 2010, at 5:48 PM, Kevin Burnham wrote: Hi All, I am trying to plot per cent correct scores (column name =PerCorr) for each of about 40 subjects. I would like the character representing each score to be a number between 0 and 4 depending on the subject's group (from the column S

Re: [R] Condition %in%

2010-09-13 Thread David Winsemius
On Sep 13, 2010, at 5:43 PM, Mestat wrote: Hi listers, If I would like to check if a variable contains certain value, I would write: if (10 %in% x) And If I would like to check the opposite, that 10 is not into x. How would be? Not sure about your terminology, "into x"?. why wouldn't it

[R] Plot with Group # as pch

2010-09-13 Thread Kevin Burnham
Hi All, I am trying to plot per cent correct scores (column name =PerCorr) for each of about 40 subjects. I would like the character representing each score to be a number between 0 and 4 depending on the subject's group (from the column Subject.Group). Also, I would ideally be able to order the d

Re: [R] Condition %in%

2010-09-13 Thread Phil Spector
!10 %in% x (or !(10 %in% x) if you don't believe in R's precedence rules. - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] apply over parallel lists and their elements

2010-09-13 Thread David Winsemius
On Sep 13, 2010, at 5:20 PM, Liviu Andronic wrote: Hello On Sun, Sep 12, 2010 at 5:37 PM, Sebastian Gibb > wrote: Hello, thanks for your answer. mapply fits to my needs. One thing that seems strange is that if you use tree[[1]]$node$values <- 1:10 tree[[2]]$node$values <- 3:12 you still g

[R] Condition %in%

2010-09-13 Thread Mestat
Hi listers, If I would like to check if a variable contains certain value, I would write: if (10 %in% x) And If I would like to check the opposite, that 10 is not into x. How would be? Thanks in advance, Marcio -- View this message in context: http://r.789695.n4.nabble.com/Condition-in-tp2538110

Re: [R] apply over parallel lists and their elements

2010-09-13 Thread Liviu Andronic
Hello On Sun, Sep 12, 2010 at 5:37 PM, Sebastian Gibb wrote: > Hello, > > thanks for your answer. > mapply fits to my needs. > One thing that seems strange is that if you use tree[[1]]$node$values <- 1:10 tree[[2]]$node$values <- 3:12 you still get > mapply(mean, tree[[1]]$node$values, tree[[2]]

Re: [R] The future of R - Ross Ihaka stirs discussions around the web

2010-09-13 Thread Albyn Jones
There was an award session at the Vancouver JSM where both Ross Ihaka and Robert Gentleman spoke. The simply-start-over post sounds very much like Ross's JSM talk. Robert's response was much more positive - coming from the perspective of developing BioConductor I think. I don't recall the detail

Re: [R] Dampening the spline interpolation for contours

2010-09-13 Thread Dylan Beaudette
Although not an R solution, I would highly recommend the generic mapping tools GMT for this type of work. http://gmt.soest.hawaii.edu/ Cheers, Dylan On Monday 13 September 2010, Craig Stanton wrote: > Hello all, > I'm very new to R and am having some trouble with the results of the > inte

Re: [R] Question: Form a new list with the index replicated equal to the number of elements in that index

2010-09-13 Thread Phil Spector
Sunny - I don't think mapply is needed: lapply(1:length(mylist),function(x)rep(x,length(mylist[[x]]))) [[1]] [1] 1 1 1 [[2]] [1] 2 [[3]] [1] 3 3 - Phil Spector Statistical Computing Facility

[R] Dampening the spline interpolation for contours

2010-09-13 Thread Craig Stanton
Hello all, I'm very new to R and am having some trouble with the results of the interp function. I'm trying to produce a chart roughly akin to a weather map with natural looking filled contours over a large region of the south pacific. I've got a list of points and values to be mapped to

Re: [R] lattice: Set x-axis in italics only

2010-09-13 Thread Alejo C.S.
Thanks all for the excellent help! Kind regards, Alej 2010/9/13 Dennis Murphy : > Hi: > > demo(graphics) has a lot of nice examples of how to use various features - > one of them is font selection. > > font = 3  => italic  font = 4 => bold italic > > You need to select the correct as

Re: [R] How to tell R that "ABC" is the name of a dataset not a variable value

2010-09-13 Thread Joshua Wiley
Hi, Just to provide an example: #Sample data copied to variables "X", "Y", and "Z" Z <- Y <- X <- data.frame(A = 1:10) # A variable holding the names of the variables datasetname <- c("X", "Y", "Z") # Use mget() to collect all the variables in a list # get() only gets one variable at a t ime,

[R] Transparent Labels for Polar Plot

2010-09-13 Thread James MacCarthy
Hello, I am currently using the polar.plot function in the plotrix package to graph data. Unfortunately, it seems that the default for the labels is to have a background color that is covering the line representing my data, making it difficult to read. Is there a way to make this label backgrou

Re: [R] How to tell R that "ABC" is the name of a dataset not a variable value

2010-09-13 Thread Henrique Dallazuanna
Se ?get function. On Mon, Sep 13, 2010 at 3:40 PM, Jie Li wrote: > All, > > For example, I have a dataset named "ABC" loaded into R > > ABC > [,1] [,2] [,3] > [1,]147 > [2,]258 > [3,]369 > > and I also have a variable datasetname > > datasetname > [1] "ABC

[R] Question: Form a new list with the index replicated equal to the number of elements in that index

2010-09-13 Thread Sunny Srivastava
Dear R-Helpers, I have a list l1 like: l1[[1]] a b c l1[[2]] d l1[[3]] e f I want an output res like: res[[1]] 1 1 1 res[[2]] 2 res[[3]] 3 3 Essentially, I want to replicate each index equal to the number of elements present in that index. Below is what I do to accomplish this: l1 <- list

[R] How to tell R that "ABC" is the name of a dataset not a variable value

2010-09-13 Thread Jie Li
All, For example, I have a dataset named "ABC" loaded into R > ABC [,1] [,2] [,3] [1,]147 [2,]258 [3,]369 and I also have a variable datasetname > datasetname [1] "ABC" and I want to add this "ABC" dataset to an existing list "alldata" > alldata <-NULL

[R] The future of R - Ross Ihaka stirs discussions around the web

2010-09-13 Thread Tal Galili
Hello all, There is currently a (very !) lively discussions happening around the web, surrounding the following topics: 1) Is R efficient? (scripting wise, and performance wise) 2) Should R be written from scratch? 3) What should be the license of R (if it was made a new)? Very serious people hav

Re: [R] Problems with reshape2 on Mac

2010-09-13 Thread Hadley Wickham
Hi Uwe, The problem is most likely because the original poster doesn't have the latest version of plyr. I correctly declare this dependency in the DESCRIPTION (http://cran.r-project.org/web/packages/reshape2/index.html), but unfortunately R doesn't seem to use this information at run time, genera

Re: [R] Transforming character vector

2010-09-13 Thread Ben Bolker
LCOG1 lcog.org> writes: [snip] > > I need to do the same for a fueltype where each record has a character > representing the data instead of a numeral(as in year). No reproducible > code or data because i think this is pretty straight forward. I could do > this using a series of loops but i t

[R] list with explanation for trellis parameters available?

2010-09-13 Thread Jannis
Dears, does anyone know whether there is any complete list with explanations for the several Trellis parameters (i.e. the ones you one gets with trellis.par.set() ) available? Many of them are self explanatory or easy to guess but there is such a vast amount of them that this is not possible f

[R] [R-pkgs] New version of rms package on CRAN

2010-09-13 Thread Frank Harrell
CRAN has a significant update to rms. Windows and unix/linux versions are available and I expect the Mac version to be available soon. The most significant improvement is addition of latex=TRUE arguments to model fitting print methods, made especially for use with Sweave. Here is a summary o

[R] using survexp and ratetable with coxph object that includes a factor term

2010-09-13 Thread Erik Iverson
Hello, I'm attempting to use the ratetable argument to survexp in the survival package. I use the example from the ?survexp help page below, and then slightly modify it to produce an error. library(survival) data(pbc) #fit a model without any factors pfit1 <- coxph(Surv(time, status > 0) ~ tr

Re: [R] as.Date() add a day to a date

2010-09-13 Thread David Winsemius
Try this: format(dt, '%Y-%m-%d'), if you want Date class: as.Date(format(dt, '%Y-%m-%d')) On Mon, Sep 13, 2010 at 2:24 PM, Andrew Yee wrote: Thanks David, now I wonder how you can have as.Date() render the date using local time rather than UTC. Andrew On Mon, Sep 13, 2010 at 12:08 PM

[R] Transforming character vector

2010-09-13 Thread LCOG1
Hi guys, Cant seem to find a solution for this. I am looking for a substitute for cut that can transform character vectors. So as cut would be used below to transform YearCat-> YearCat2 base on Year and vector Ag<-c("00-'70","'71-'75","'76-'85","'86-'09") using 'cut ' FleetData$YearCat<-cut(F

Re: [R] as.Date() add a day to a date

2010-09-13 Thread Andrew Yee
Henrique, thanks for your suggestion. For my applications, character would have been sufficient, so your suggestion of using format() works fine too. Perhaps I should submit a feature request for as.Date() to let you specify local time. Thanks, Andrew On Mon, Sep 13, 2010 at 2:06 PM, Henrique D

Re: [R] as.Date() add a day to a date

2010-09-13 Thread David Winsemius
On Sep 13, 2010, at 1:24 PM, Andrew Yee wrote: > Thanks David, now I wonder how you can have as.Date() render the > date using local time rather than UTC. > Since we are both in the EDT TZ at the moment, our times are UTC-4 (hours = 60*60 seconds) > dt <- as.POSIXct("2010-08-22 23:14:52")

Re: [R] Sample a vector repeatedly

2010-09-13 Thread Henrique Dallazuanna
You can try this also: Vectorize(sample, 'size')(y, 1:3) On Mon, Sep 13, 2010 at 12:30 PM, James Hudson wrote: > I’d like to sample the vector “y” repeatedly. In this dummy dataset, I’d > like to sample (and store) it 1, 2, and 3 times. > > > > Is there a straightforward way to do this without

Re: [R] reshape matrix entities to columns

2010-09-13 Thread Natasha Asar
thanks for your help I am trying to work around this in R but i have the feeling that this is going to but the center and age next to each other which is not what i need... it might be me not being able to find my head around this but... i need a table with age as columns and center as rows if

Re: [R] Sample a vector repeatedly

2010-09-13 Thread James Hudson
Thank you Marc - the first scenario. On Mon, Sep 13, 2010 at 2:04 PM, Marc Schwartz wrote: > > On Sep 13, 2010, at 10:30 AM, James Hudson wrote: > > > I‚d like to sample the vector „y‰ repeatedly. In this dummy dataset, > > I‚d > > like to sample (and store) it 1, 2, and 3 times. >

[R] R 2.12.0 scheduled for October 15

2010-09-13 Thread Peter Dalgaard
This is to announce that we plan to release R version 2.12.0 on Friday, October 15, 2010. Those directly involved should review the generic schedule at http://developer.r-project.org/release-checklist.html The source tarballs will be made available daily (barring build troubles) via http://cran.

Re: [R] as.Date() add a day to a date

2010-09-13 Thread Andrew Yee
Thanks David, now I wonder how you can have as.Date() render the date using local time rather than UTC. Andrew On Mon, Sep 13, 2010 at 12:08 PM, David Winsemius wrote: > > On Sep 13, 2010, at 11:56 AM, Andrew Yee wrote: > > I'm trying to understand why as.Date() is converting a the modified dat

[R] R 2.12.0 scheduled for October 15

2010-09-13 Thread peter dalgaard
This is to announce that we plan to release R version 2.12.0 on Friday, October, 2010. Those directly involved should review the generic schedule at http://developer.r-project.org/release-checklist.html The source tarballs will be made available daily (barring build troubles) via http://cran.r-p

Re: [R] Sample a vector repeatedly

2010-09-13 Thread Marc Schwartz
On Sep 13, 2010, at 10:30 AM, James Hudson wrote: > I‚d like to sample the vector „y‰ repeatedly. In this dummy dataset, I‚d > like to sample (and store) it 1, 2, and 3 times. > > Is there a straightforward way to do this without using a „for‰ loop? > > x <- c(1 :3) > > y <- c(1:10) > > (run.

Re: [R] How to do a trig regression

2010-09-13 Thread Greg Snow
Without the square term you can just use the rule for addition in sines: sin(a+b) = sin(a)cos(b) + cos(a)sin(b) So a regression of y= a + b* sin(2*pi/360*x + c) can be fit as: lm( y~ sin( 2*pi/360*x) + cos( 2*pi/360/x ) ) If you need the actual values of b and c then you will need to do a littl

Re: [R] sum to infinity

2010-09-13 Thread David Winsemius
On Sep 13, 2010, at 5:24 AM, tuggi wrote: hello, can i calculate a sum to infinity in R. i want to do something like this: \sum_{i=0}^\infty \frac{2^{-d-1}}{\Gamma(\frac{d-1}{2})}\left(\frac{\Gamma(2d-3)(2- d)_{i}\Gamma(i+1,-z/2)2^{i+1}}{\Gamma(d-1)(4-2d)_{i}i!}\right)+ \\ \sum_{i=0}^\inft

Re: [R] Saveing plot to multiple locations

2010-09-13 Thread Greg Snow
?dev.copy -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Joel > Sent: Monday, September 13, 2010 7:13 AM > T

Re: [R] Overlay of two graphs of different axes

2010-09-13 Thread Greg Snow
The zoomplot or updateusr functions in the TeachingDemos package may help. But be cautious, the thing that grabs the most attention is where 2 (or more) lines cross, when you plot multiple lines on different scales the crossing is meaningless, but that meaningless point is what draws the eyes.

Re: [R] as.Date() add a day to a date

2010-09-13 Thread David Winsemius
On Sep 13, 2010, at 11:56 AM, Andrew Yee wrote: I'm trying to understand why as.Date() is converting a the modified date of a file from August 22 to August 23. foo <- file.info(file.to.process) str(foo) 'data.frame': 1 obs. of 10 variables: $ size : num 5.37e+09 $ isdir : logi FALSE $

Re: [R] Problems with reshape2 on Mac

2010-09-13 Thread Uwe Ligges
Is this a recent version of R? If so, please report to the maintainer. Otherwise, please also report that it does not work with your version of R so that the maintainer can add a version dependency. Best, Uwe Ligges On 13.09.2010 17:42, Paul Metzner wrote: Hi! I updated to reshape2 yesterday

Re: [R] SF-8 (not 36) questionnaire scoring for R?

2010-09-13 Thread Joshua Wiley
On Mon, Sep 13, 2010 at 8:02 AM, Marc Schwartz wrote: > > On Sep 13, 2010, at 8:59 AM, Joshua Wiley wrote: > >> If it's not possible to use their particular algorithms, does anyone >> think it would be helpful/practical to try to write a general scoring >> system?  I imagine a function with argume

[R] as.Date() add a day to a date

2010-09-13 Thread Andrew Yee
I'm trying to understand why as.Date() is converting a the modified date of a file from August 22 to August 23. > foo <- file.info(file.to.process) > str(foo) 'data.frame': 1 obs. of 10 variables: $ size : num 5.37e+09 $ isdir : logi FALSE $ mode :Class 'octmode' int 436 $ mtime : POSIX

Re: [R] Axis break with gap.plot()

2010-09-13 Thread Filoche
Thank you sir. Regards, Phil -- View this message in context: http://r.789695.n4.nabble.com/Axis-break-with-gap-plot-tp2533027p2537660.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.eth

[R] Sample a vector repeatedly

2010-09-13 Thread James Hudson
I’d like to sample the vector “y” repeatedly. In this dummy dataset, I’d like to sample (and store) it 1, 2, and 3 times. Is there a straightforward way to do this without using a “for” loop? x <- c(1 :3) y <- c(1:10) (run.sample <- sample (y, x)) Thanks very much, James Hudson

[R] Problems with reshape2 on Mac

2010-09-13 Thread Paul Metzner
Hi! I updated to reshape2 yesterday and tried to make it work. Unfortunately, it mainly throws error messages at me (good thing it's reshape2 1.0 and not reshape 2.0). The most recent is: Error in match.fun(FUN) : object 'id' not found When I manually create an object 'id', it says: Error in

[R] Specify a minimum number of valid arguments for the mean function

2010-09-13 Thread Luana Marotta
Hello all, I want to specify a minimum number of valid arguments for the mean function--I have 5 variables but I want the mean only of cases that have at least 3 valid answers. What is the best way to do that? Thank you very much! Luana [[alternative HTML version deleted]]

Re: [R] Plotting multiple edges with iGraph

2010-09-13 Thread sashaBsAs
Thanks Gábor! -- View this message in context: http://r.789695.n4.nabble.com/Plotting-multiple-edges-with-iGraph-tp2527506p2537603.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/

Re: [R] SF-8 (not 36) questionnaire scoring for R?

2010-09-13 Thread peter dalgaard
On Sep 13, 2010, at 15:59 , Joshua Wiley wrote: > If it's not possible to use their particular algorithms, does anyone > think it would be helpful/practical to try to write a general scoring > system? I imagine a function with arguments for column names, a list > where each element is a vector t

Re: [R] lattice: Set x-axis in italics only

2010-09-13 Thread Dennis Murphy
Hi: demo(graphics) has a lot of nice examples of how to use various features - one of them is font selection. font = 3 => italic font = 4 => bold italic You need to select the correct aspect of the plot, however: font.main, font.sub, font.lab or font.axis (from par()). HTH, Dennis

Re: [R] SF-8 (not 36) questionnaire scoring for R?

2010-09-13 Thread Marc Schwartz
On Sep 13, 2010, at 8:59 AM, Joshua Wiley wrote: > If it's not possible to use their particular algorithms, does anyone > think it would be helpful/practical to try to write a general scoring > system? I imagine a function with arguments for column names, a list > where each element is a vector

Re: [R] Saving/loading custom R scripts

2010-09-13 Thread DrCJones
I'm still relatively new to R, so I tried the first of you two solutions: .First <- function(){ source("Friedman-Test-with-Post-Hoc.r.txt") } Thanks very much for that, it works perfectly Cheers -- View this message in context: http://r.789695.n4.nabble.com/Saving-loading-custom-R-scri

Re: [R] Axis break with gap.plot()

2010-09-13 Thread David Winsemius
On Sep 13, 2010, at 10:34 AM, Filoche wrote: Hi again everyone. Anyone know if there's any limitation with gap.plot concerning the fill color of plotted markers? I would like to fill the circles with a color : library(plotrix); gap.plot(c(1,2,3,4,10), c(1,2,3,4,10), c(5,9), pch = 21, co

Re: [R] shade area between 'ablines'

2010-09-13 Thread Dennis Murphy
Hi: Here's a ggplot2 example: p <- ggplot(mtcars, aes(x = wt, y = mpg)) p + geom_rect(xmin = 2, xmax = 3, ymin = 0, ymax = Inf, fill = 'green', alpha = 0.2) + geom_point() + theme_bw() I don't know why the alpha transparency doesn't work in this example, but plotting the points after shadin

Re: [R] shade area between 'ablines'

2010-09-13 Thread jim holtman
check out this link http://finzi.psych.upenn.edu/R/library/seqinr/html/col2alpha.html On Mon, Sep 13, 2010 at 9:58 AM, threshold wrote: > > Thanks for replying, indeed works. > I forgot to mention that I am looking for a 'transparent shading' s.t. the > plot symbols are still visible on the shad

Re: [R] Axis break with gap.plot()

2010-09-13 Thread Filoche
Hi again everyone. Anyone know if there's any limitation with gap.plot concerning the fill color of plotted markers? I would like to fill the circles with a color : library(plotrix); gap.plot(c(1,2,3,4,10), c(1,2,3,4,10), c(5,9), pch = 21, col = "red"); However, it only change the color of the

Re: [R] confidence bands for a quasipoisson glm

2010-09-13 Thread Gavin Simpson
On Sat, 2010-09-11 at 14:41 -0700, Peng, C wrote: > Is this something you want to have (based on a simulated dataset)? > > counts <- c(18,17,15,20,10,20,25,13,12) > #risk <- round(rexp(9,0.5),3) > risk<- c(2.242, 0.113, 1.480, 0.913, 5.795, 0.170, 0.846, 5.240, 0.648) > gm <- glm(counts ~ risk, f

Re: [R] Help on simple problem with optim

2010-09-13 Thread Cristian Montes
Did you check if the data in "da" has any NA in the dependent or the independent data? Remember that your function llk.mar is going to evaluate dnorm for each pair. If any of those pairs has an NA value, your function will return an NA at the end (sum(c(NA,1,2,3)) = NA) I would check if the ll

Re: [R] lattice: Set x-axis in italics only

2010-09-13 Thread David Winsemius
On Sep 13, 2010, at 8:50 AM, Alejo C.S. wrote: Dear list, I making some box-and-whisker plots in R with vertebrate data. The x axis are species names that must be in italics. I tried with the "axis" function but no luck, and it seems that affects both axes. Any tip? In bwplot just add: ...,

Re: [R] SF-8 (not 36) questionnaire scoring for R?

2010-09-13 Thread Joshua Wiley
If it's not possible to use their particular algorithms, does anyone think it would be helpful/practical to try to write a general scoring system? I imagine a function with arguments for column names, a list where each element is a vector that indicates the numbers that correspond to various subsc

  1   2   >