Re: [R] ddply to count frequency of combinations

2011-06-22 Thread Idris Raja
Brian, I'm a bit confused about how the following line works, specifically, what is happening in freq=length(x)? Is it just taking the length of x after it has been summarized by different combinations x & y? I guess that must be the case, because that gives the same result as using freq=length(y)

Re: [R] Saved EPS does not match screen when using bquote(.(i))

2011-06-22 Thread Dennis Murphy
Hi: As Uwe suggested... pdf('testgraph.pdf') layout( matrix( 1:2 , nrow=2 ) ) for ( i in 1:2 ) { plot( 0 , 0 , xlab=bquote(mu[.(i)]) ) } dev.off() postscript('testgraph.ps') layout( matrix( 1:2 , nrow=2 ) ) for ( i in 1:2 ) { plot( 0 , 0 , xlab=bquote(mu[.(i)]) ) } dev.off() png('testgrap

Re: [R] Hardy Weinberg

2011-06-22 Thread Mike Miller
On Wed, 22 Jun 2011, Jim Silverton wrote: I am generating 1,000 replicates of 10,000 of these 2 x 3 tables but R cannot seem to save it. Its over 1 Gig. Any ideas on how I can store this large amount of data? Should I use a list or a matrix? Is English your first language? If so, you can pro

Re: [R] Hardy Weinberg

2011-06-22 Thread David Winsemius
On Jun 22, 2011, at 11:57 PM, Jim Silverton wrote: I am generating 1,000 replicates of 10,000 of these 2 x 3 tables but R cannot seem to save it. What does that mean? Error messages? Its over 1 Gig. Any ideas on how I can store this large amount of data? Should I use a list or a matrix? H

Re: [R] Hardy Weinberg

2011-06-22 Thread Jim Silverton
I am generating 1,000 replicates of 10,000 of these 2 x 3 tables but R cannot seem to save it. Its over 1 Gig. Any ideas on how I can store this large amount of data? Should I use a list or a matrix? Jim On Wed, Jun 22, 2011 at 10:21 PM, Mike Miller wrote: > On Thu, 23 Jun 2011, David Duffy wro

Re: [R] lme convergence failure within a loop

2011-06-22 Thread Daniel Malter
I am not an expert in this. But try try() :) hth, Daniel Sam Nicol wrote: > > Hi R-users, > > I'm attempting to fit a number of mixed models, all with the same > structure, across a spatial grid with data points collected at various > time points within each grid cell. I'm trying to use a

[R] Saved EPS does not match screen when using bquote(.(i))

2011-06-22 Thread John Kruschke
Here's a fairly minimal-case example in which the saved EPS does not match the screen. The error comes when using bquote(.(i)) instead of bquote(1), as demonstrated by the two minimally different cases below. Very strange. Any clues as to why? # begin --- # Version

Re: [R] Time-series analysis with treatment effects - statistical approach

2011-06-22 Thread Ravi Varadhan
If you have any specific features of the time series of soil moisture, you could either model that or directly estimate it and test for differences in the 4 treatments. If you do not have any such specific considerations, you might want to consider some nonparametric approaches such as function

Re: [R] numerical integration and 'non-finite function value' error

2011-06-22 Thread Ravi Varadhan
In the limit as x goes to infinity, the integrand x f(x) should go to 0 sufficiently fast in order for the integral to be finite. The error indicates that the integrand becomes infinite for large x. Check to ensure that the integrand is correctly specified. I don't understand how you can repla

Re: [R] Problem with mclapply -- losing output/data

2011-06-22 Thread Janet Young
Hi Elizabeth, I just found your thread after experiencing a similar problem (I was also using some IRanges/GenomicRanges functions). You've probably figured it out by this time - I'm actually curious to know what you found? I think I've tracked it down in my case, where a small minority of the

Re: [R] Subsetting data systematically

2011-06-22 Thread Peter Alspach
Tena koe Nate You can use the fact that R recycles. If yourData is a dataframe, then (as examples): yourData[c(TRUE,FALSE),] will give you every second row, starting with the first. Similarly, yourData[c(FALSE,TRUE,FALSE),] will give every third row, starting with the second; and yourData[c(

Re: [R] Hardy Weinberg

2011-06-22 Thread Mike Miller
On Thu, 23 Jun 2011, David Duffy wrote: I am interested in simulating 10,000 2 x 3 tables for SNPs data with the Hardy Weinberg formulation. Is there a quick way to do this? I am assuming that the minor allelle frequency is uniform in (0.05, 0.25). rmultinom() with HWE expectations I'm als

Re: [R] BY GROUP IN GEV

2011-06-22 Thread Peter Maclean
I am trying to run gev (general extreme value) function in “evir” package. My data is divided by state. I am using the following codes but it is not working. I will appreciate any help.   #Split data MAS <- split(MA, MA$states)   CP  <- lapply(MAS, function(x){gev(MAS$CP1, 100, method = "BFGS", c

[R] lme convergence failure within a loop

2011-06-22 Thread Sam Nicol
Hi R-users, I'm attempting to fit a number of mixed models, all with the same structure, across a spatial grid with data points collected at various time points within each grid cell. I'm trying to use a 'for' loop to try the model fit on each grid cell. In some cells lme does not converge, g

[R] Subsetting data systematically

2011-06-22 Thread gibberish
I would like to subset data from a larger dataset and generate a smaller dataset. However, I don't want to use sample() because it does it randomly. I would like to take non-random subsamples, for example, every 2nd number, or every 3rd number. Is there a procedure that does this? Thanks, Nate

[R] numerical integration and 'non-finite function value' error

2011-06-22 Thread Adan_Seb
Dear R users, I have a question about numerical integration in R. I am facing the 'non-finite function value' error while integrating the function xf(x) using 'integrate'. f(x) is a probability density function and assumed to follow the three parameter (min = 0) beta

Re: [R] Time-series analysis with treatment effects - statistical approach

2011-06-22 Thread Mike Marchywka
> Date: Wed, 22 Jun 2011 17:21:52 -0700 > From: jmo...@student.canterbury.ac.nz > To: r-help@r-project.org > Subject: Re: [R] Time-series analysis with treatment effects - statistical > approach > > Hi Mike, here's a sample of my data so that you get an idea what I'm working > with. Thanks,

Re: [R] Re; Getting SNPS from PLINK to R

2011-06-22 Thread Mike Miller
Resending to correct bad subject line... On Mon, 20 Jun 2011, Jim Silverton wrote: I a using plink on a large SNP dataset with a .map and .ped file. I want to get some sort of file say a list of all the SNPs that plink is saying that I have. ANyideas on how to do this? All the SNPs you hav

Re: [R] several messages

2011-06-22 Thread Mike Miller
On Mon, 20 Jun 2011, Jim Silverton wrote: I a using plink on a large SNP dataset with a .map and .ped file. I want to get some sort of file say a list of all the SNPs that plink is saying that I have. ANyideas on how to do this? All the SNPs you have are listed in the .map file. An easy way

Re: [R] plotmath: unexpected SPECIAL

2011-06-22 Thread Sarah Goslee
Dennis, Thanks. That makes sense, but I don't think it's clearly documented. The default assumption that I and at least some others in this discussion made is that everything in the list of plotmath features in the helpfile works the same way, since they're all in the same list. And if for some o

Re: [R] plotmath: unexpected SPECIAL

2011-06-22 Thread Dennis Murphy
Hi: >From the plotmath help page: x %->% y x right-arrow y so this is behaving like a binary operator. There happen to be several of these in plotmath On Wed, Jun 22, 2011 at 5:49 PM, Sarah Goslee wrote: > Interesting. I don't know the explanation, but look at this: > # works > plot(1:

Re: [R] plotmath: unexpected SPECIAL

2011-06-22 Thread Bryan Hanson
Thanks to both David and Sarah. I'm glad I asked, as I had tried some of the combos Sarah suggested and observed the same behavior, which puzzled me. David, thanks for reminding me about ~ as that is a different way to get a space into the string. I just don't use plotmath often enough t

Re: [R] plotmath: unexpected SPECIAL

2011-06-22 Thread David Winsemius
On Jun 22, 2011, at 8:10 PM, Bryan Hanson wrote: Hello R Masters and the Rest of Us: The first of these works fine, the 2nd is accepted but too literal (the "%->%" is shown in the plot label and in the wrong position). The 3rd throws and error due to "unexpected SPECIAL". Would someone

Re: [R] plotmath: unexpected SPECIAL

2011-06-22 Thread Sarah Goslee
Interesting. I don't know the explanation, but look at this: # works plot(1:10, 1:10, xlab=expression(a %->% b)) # doesn't work plot(1:10, 1:10, xlab=expression(%->%)) # works plot(1:10, 1:10, xlab=expression(paste("something" %->% "else"))) # doesn't work plot(1:10, 1:10, xlab=expression(paste("s

Re: [R] Time-series analysis with treatment effects - statistical approach

2011-06-22 Thread J.Morgenroth
Hi Mike, here's a sample of my data so that you get an idea what I'm working with. http://r.789695.n4.nabble.com/file/n3618615/SampleDataSet.txt SampleDataSet.txt Also, I've uploaded an image showing a sample graph of daily soil moisture by treatment. The legend shows IP, IP+, PP, PP+ which are

[R] plotmath: unexpected SPECIAL

2011-06-22 Thread Bryan Hanson
Hello R Masters and the Rest of Us: The first of these works fine, the 2nd is accepted but too literal (the "%->%" is shown in the plot label and in the wrong position). The 3rd throws and error due to "unexpected SPECIAL". Would someone recommend a way to format this? I want the two phr

Re: [R] Fantastic! So many interesting and useful!

2011-06-22 Thread Jim Brindle
http://bakaneko.fr/friends.page.php?igjhotmailID=28aq2 [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the post

Re: [R] question about read.columns

2011-06-22 Thread Gabor Grothendieck
On Wed, Jun 22, 2011 at 7:07 PM, Changbin Du wrote: > INstalling of "RSQLite" was successful. > > in R: >> packageVersion("RSQLite") > [1] '0.9.4' > > > > When I try to install "sqldf", I found the following errors: > >> install.packages("sqldf") > Installing package(s) into '/house/homedirs/c/cdu

Re: [R] question about read.columns

2011-06-22 Thread Changbin Du
INstalling of "RSQLite" was successful. in R: > packageVersion("RSQLite") [1] '0.9.4' When I try to install "sqldf", I found the following errors: > install.packages("sqldf") Installing package(s) into '/house/homedirs/c/cdu/library/' (as 'lib' is unspecified) trying URL 'http://cran.cnr.Berke

Re: [R] question about read.columns

2011-06-22 Thread Changbin Du
I will try this first. Thanks, Gabor! On Wed, Jun 22, 2011 at 3:15 PM, Gabor Grothendieck wrote: > On Wed, Jun 22, 2011 at 6:10 PM, Changbin Du wrote: > > My R is 2.12.0. > > > >> R.version.string > > [1] "R version 2.12.0 (2010-10-15)" > >> packageVersion("RSQLite") > > [1] '0.8.0' > >> pac

Re: [R] question about read.columns

2011-06-22 Thread Gabor Grothendieck
On Wed, Jun 22, 2011 at 6:10 PM, Changbin Du wrote: > My R is 2.12.0. > >> R.version.string > [1] "R version 2.12.0 (2010-10-15)" >> packageVersion("RSQLite") > [1] '0.8.0' >> packageVersion("sqldf") > [1] '0.3.5' > > So it seems I have to update or install the 2.13.0 version in my linux > machine

Re: [R] question about read.columns

2011-06-22 Thread Changbin Du
My R is 2.12.0. > R.version.string [1] "R version 2.12.0 (2010-10-15)" > packageVersion("RSQLite") [1] '0.8.0' > packageVersion("sqldf") [1] '0.3.5' So it seems I have to update or install the 2.13.0 version in my linux machine. On Wed, Jun 22, 2011 at 3:04 PM, Gabor Grothendieck wrote: >

Re: [R] question about read.columns

2011-06-22 Thread Gabor Grothendieck
On Wed, Jun 22, 2011 at 6:01 PM, Changbin Du wrote: > I found the following errors: > > >> library(sqldf) > Loading required package: DBI > Loading required package: RSQLite > Loading required package: RSQLite.extfuns > Error: package 'RSQLite' 0.8-0 is loaded, but >= 0.9.1 is required by > 'RSQLi

Re: [R] question about read.columns

2011-06-22 Thread Changbin Du
I found the following errors: > library(sqldf) Loading required package: DBI Loading required package: RSQLite Loading required package: RSQLite.extfuns *Error: package 'RSQLite' 0.8-0 is loaded, but >= 0.9.1 is required by 'RSQLite.extfuns'* > hh<-read.csv.sql("/house/homedirs/c/cdu/operon/gh5/

Re: [R] question about read.columns

2011-06-22 Thread Changbin Du
Hi, Gabor, Thanks so much, I will try it and let you know the results. Appreciated! On Wed, Jun 22, 2011 at 2:54 PM, Gabor Grothendieck wrote: > On Wed, Jun 22, 2011 at 5:45 PM, Changbin Du wrote: > > HI, Dear R community, > > > > I have a large data set names dd.txt, the columns are: there

Re: [R] Hardy Weinberg

2011-06-22 Thread David Duffy
I am interested in simulating 10,000 2 x 3 tables for SNPs data with the Hardy Weinberg formulation. Is there a quick way to do this? I am assuming that the minor allelle frequency is uniform in (0.05, 0.25). rmultinom() with HWE expectations __ R-

Re: [R] question about read.columns

2011-06-22 Thread Gabor Grothendieck
On Wed, Jun 22, 2011 at 5:45 PM, Changbin Du wrote: > HI, Dear R community, > > I have a large data set names dd.txt, the columns are: there are 2402 > variables. > > a1, b1, ..z1, a11, b11, ...z11, a111, b111, ..z111.. > > IF I dont know the relative position of the columns, but I know I need the

[R] question about read.columns

2011-06-22 Thread Changbin Du
HI, Dear R community, I have a large data set names dd.txt, the columns are: there are 2402 variables. a1, b1, ..z1, a11, b11, ...z11, a111, b111, ..z111.. IF I dont know the relative position of the columns, but I know I need the following variables: var<-c(a1, c1,a11,b11,f111) Can I use read.

Re: [R] Appending to list

2011-06-22 Thread Sarah Goslee
You lost me with the TRN and TRN_CLUSTER bits, but are you trying to make a list of lists? > Data_ <- list() > SN <- 1:12 > for(sn in SN) { + Data_[[sn]] <- list() + for(i in 1:10) { + Data.X <- rnorm(5, 0, 10) + Data_[[sn]][[i]] <- Data.X + }} > > Data_[[3]][[2]] [1] -5.687070 -2.365589 12.378359

Re: [R] Unreasonable syntax error

2011-06-22 Thread Greg Snow
I second the fortune nomination, probably the 1st paragraph is sufficient for a fortune. -- 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-bounces@r-

Re: [R] Factor Analysis with orthogonal and oblique rotation

2011-06-22 Thread Jeremy Miles
Varimax is orthogonal, promax is oblique. Varimax is generally not recommended. See: Preacher, K. J., & MacCallum, R. C. (2003). Repairing Tom Swift's electric factor analysis machine. Understanding Statistics, 2(1), 13-43. (Google the title and you'll find a PDF). The fa() function in the psy

Re: [R] strange date problem - May 3, 1992 is NA

2011-06-22 Thread Alexander Shenkin
On 6/22/2011 4:09 PM, Brian Diggs wrote: > On 6/22/2011 1:37 PM, Alexander Shenkin wrote: >> On 6/22/2011 3:34 PM, Brian Diggs wrote: >>> On 6/22/2011 12:09 PM, Luke Miller wrote: For what it's worth, I cannot reproduce this problem under a nearly identical instance of R (R 2.12.1, Win 7

[R] Factor Analysis with orthogonal and oblique rotation

2011-06-22 Thread Rosario Garcia Gil
Hello I seem to find only two types of rotation for the factanal function in R, the Varimax and Promax, but is it possible to run a orthogonal and oblique rotations in R? Thanks in advance Rosario __ R-help@r-project.org mailing list https://stat.ethz.

Re: [R] mlogit model that contains both individual-specific parameters and universal parameters

2011-06-22 Thread Achim Zeileis
On Wed, 22 Jun 2011, Quang Anh Duong wrote: Hello,? I am pretty new to mlogit, and still trying to figure out what models to use.I have a data set of N individuals, each of which faces I alternatives. The utility function of individual n, for choice i is:? u(i,n) = alpha(i) * x1(i,n) + beta

Re: [R] strange date problem - May 3, 1992 is NA

2011-06-22 Thread Brian Diggs
On 6/22/2011 1:37 PM, Alexander Shenkin wrote: On 6/22/2011 3:34 PM, Brian Diggs wrote: On 6/22/2011 12:09 PM, Luke Miller wrote: For what it's worth, I cannot reproduce this problem under a nearly identical instance of R (R 2.12.1, Win 7 Pro 64-bit). I also can't reproduce the problem with R 2

[R] AIC() vs. mle.aic() vs. step()?

2011-06-22 Thread Alexandra Thorn
I know this a newbie question, but I've only just started using AIC for model comparison and after a bunch of different keyword searches I've failed to find a page laying out what the differences are between the AIC scores assigned by AIC() and mle.aic() using default settings. I started by usin

[R] Appending to list

2011-06-22 Thread LCOG1
So im here now b/c im incredibly frustrated. Please consider the following: #Try 1 Data_<-list() Sn<-1:12 for(sn in Sn){ for(i in 1:10){ Data.X <- rnorm(100,0,10) Data_[[paste(sn,i,sep="-")]]<-Data.X } } ##Try 2 Data_<-list() Sn<-1:12 for(sn

Re: [R] strange date problem - May 3, 1992 is NA

2011-06-22 Thread Brian Diggs
On 6/22/2011 1:23 PM, William Dunlap wrote: The isdst value -1 doesn't seem right. Shouldn't it be either 0 (not daylight savings time) or 1 (yes dst)? I've only seen isdst==-1 when all the other entries were NA (that happens when the string doesn't match the format). A isdst of -1 indicates t

Re: [R] strange date problem - May 3, 1992 is NA

2011-06-22 Thread Alexander Shenkin
On 6/22/2011 3:34 PM, Brian Diggs wrote: > On 6/22/2011 12:09 PM, Luke Miller wrote: >> For what it's worth, I cannot reproduce this problem under a nearly >> identical instance of R (R 2.12.1, Win 7 Pro 64-bit). I also can't >> reproduce the problem with R 2.13.0. You've got something truly weird

Re: [R] strange date problem - May 3, 1992 is NA

2011-06-22 Thread Brian Diggs
On 6/22/2011 12:09 PM, Luke Miller wrote: For what it's worth, I cannot reproduce this problem under a nearly identical instance of R (R 2.12.1, Win 7 Pro 64-bit). I also can't reproduce the problem with R 2.13.0. You've got something truly weird going on with your particular instance of R. is

Re: [R] strange date problem - May 3, 1992 is NA

2011-06-22 Thread Alexander Shenkin
Wow. Setting my timezone to UTC -5 Bogota (where there is no daylight savings time), I get the error: > is.na(strptime("5/3/1992", format="%m/%d/%Y")) [1] TRUE But setting it to UTC -5 East Coast Time (whether or not I tell windows to adjust for DST) I get: > is.na(strptime("5/3/1992", format="

Re: [R] strange date problem - May 3, 1992 is NA

2011-06-22 Thread William Dunlap
I can reproduce your problem when using a time that doesn't exist because it is between 2am and 3am on the Sunday that we switch from winter time to summer time: > z <- strptime(paste(paste(sep="/", 4, 5, 1992), "2:30"), format="%m/%d/%Y %H:%M") > z [1] "1992-04-05 02:30:00" > is.na(z) [1] TRUE >

Re: [R] strange date problem - May 3, 1992 is NA

2011-06-22 Thread William Dunlap
The isdst value -1 doesn't seem right. Shouldn't it be either 0 (not daylight savings time) or 1 (yes dst)? I've only seen isdst==-1 when all the other entries were NA (that happens when the string doesn't match the format). In the parts of the US where daylight savings time is used the switchove

Re: [R] setting 'layout' locally within functions

2011-06-22 Thread Paul Murrell
Hi On 23/06/2011 2:58 a.m., Simon Goodman wrote: Using layout I've created a function that makes a 2 panel plot - comprising a main plot, and a sub-panel with custom legend. I would now like to use layout to create multiple panels with plots created by my function, however the values for layout

Re: [R] Package warnings

2011-06-22 Thread steven mosher
Thanks all the issue is closed. in this case I had a data element FILE.PARAMETERS = list() the .Rd files created by package.skelton() for data objects had the following for \usage. \usage{data(FILE.PARAMETERS)} I left that as is and CHECK throws a warning. "checking for code/d

[R] mlogit model that contains both individual-specific parameters and universal parameters

2011-06-22 Thread Quang Anh Duong
Hello,  I am pretty new to mlogit, and still trying to figure out what models to use.I have a data set of N individuals, each of which faces I alternatives. The utility function of individual n, for choice i is:  u(i,n) = alpha(i) * x1(i,n) + beta * x2(i,n)  where alpha(i) is the individual sp

[R] caret's Kappa for categorical resampling

2011-06-22 Thread Harlan Harris
Hello, When evaluating different learning methods for a categorization problem with the (really useful!) caret package, I'm getting confusing results from the Kappa computation. The data is about 20,000 rows and a few dozen columns, and the categories are quite asymmetrical, 4.1% in one category a

Re: [R] Linking 2 columns in 2 databases and applying a function

2011-06-22 Thread Ryan Utz
Daniel, That indeed does work... and I didn't even need to learn a new function. Thanks! -- Ryan Utz, Ph.D. Aquatic Ecologist/STREON Scientist National Ecological Observatory Network Home/Cell: (724) 272-7769 Work: (720) 746-4844 ext. 2488 [[alternative HTML version deleted]] ___

Re: [R] strange date problem - May 3, 1992 is NA

2011-06-22 Thread Luke Miller
For what it's worth, I cannot reproduce this problem under a nearly identical instance of R (R 2.12.1, Win 7 Pro 64-bit). I also can't reproduce the problem with R 2.13.0. You've got something truly weird going on with your particular instance of R. > is.na(strptime("5/3/1992", format="%m/%d/%Y")

Re: [R] Linking 2 columns in 2 databases and applying a function

2011-06-22 Thread B77S
1st of all Dr Utz, thanks for your recent pubs on regional differences between the piedmont and coastal plain streams. and to add to Daniels post (giving your binary yes/no): df<-merge(x,y,all.x=T,all.y=F) df["exceed"] <- ifelse(df$Q>df$Threshold_Q , 1, 0) ## now look at df df Daniel Mal

Re: [R] Documenting variables, dataframes and files?

2011-06-22 Thread Jan van der Laan
The memisc package also offers functionality for documenting data. Jan On 06/22/2011 04:57 PM, Robert Lundqvist wrote: Every now and then I realize that my attempts to document what all dataframes consist of are unsufficient. So far, I have been writing notes in an external file. Are there an

Re: [R] strange date problem - May 3, 1992 is NA

2011-06-22 Thread Alexander Shenkin
On 6/22/2011 1:34 PM, Sarah Goslee wrote: > On Wed, Jun 22, 2011 at 2:28 PM, David Winsemius > wrote: >> >> On Jun 22, 2011, at 2:03 PM, Sarah Goslee wrote: >> >>> Hi, >>> >>> On Wed, Jun 22, 2011 at 11:40 AM, Alexander Shenkin >>> wrote: > > is.na(strptime("5/2/1992", format="%m/%d/%Y")

Re: [R] Help Needed on Merging Columns by Summation

2011-06-22 Thread Rita Carreira
I assume that you are working in package MatrixCalc. Let’s say you have a matrix X. You can call the columns of X this way: X[,1] for the first column X[,2] for the second column X[,3] for the third column Etc. So let’s say that you want to add the first and third column, then you would just

Re: [R] strange date problem - May 3, 1992 is NA

2011-06-22 Thread Sarah Goslee
On Wed, Jun 22, 2011 at 2:28 PM, David Winsemius wrote: > > On Jun 22, 2011, at 2:03 PM, Sarah Goslee wrote: > >> Hi, >> >> On Wed, Jun 22, 2011 at 11:40 AM, Alexander Shenkin >> wrote: is.na(strptime("5/2/1992", format="%m/%d/%Y")) >>> >>> [1] FALSE is.na(strptime("5/3/1992",

Re: [R] Linking 2 columns in 2 databases and applying a function

2011-06-22 Thread Daniel Malter
For example, you can merge the two data frames and do a direct comparison: df<-merge(x,y,all.x=T,all.y=F) df df$Q>df$Threshold_Q HTH, Daniel Ryan Utz-2 wrote: > > Hi all, > > I have two datasets, one that represents a long-term time series and one > that represents summary data for the time

Re: [R] strange date problem - May 3, 1992 is NA

2011-06-22 Thread David Winsemius
On Jun 22, 2011, at 2:03 PM, Sarah Goslee wrote: Hi, On Wed, Jun 22, 2011 at 11:40 AM, Alexander Shenkin wrote: is.na(strptime("5/2/1992", format="%m/%d/%Y")) [1] FALSE is.na(strptime("5/3/1992", format="%m/%d/%Y")) [1] TRUE I can't reproduce your problem on R 2.13.0 on linux: I als

Re: [R] strange date problem - May 3, 1992 is NA

2011-06-22 Thread Alexander Shenkin
On 6/22/2011 1:03 PM, Sarah Goslee wrote: > Hi, > > On Wed, Jun 22, 2011 at 11:40 AM, Alexander Shenkin wrote: >>> is.na(strptime("5/2/1992", format="%m/%d/%Y")) >> [1] FALSE >>> is.na(strptime("5/3/1992", format="%m/%d/%Y")) >> [1] TRUE > > I can't reproduce your problem on R 2.13.0 on linux: >

Re: [R] strange date problem - May 3, 1992 is NA

2011-06-22 Thread Sarah Goslee
Hi, On Wed, Jun 22, 2011 at 11:40 AM, Alexander Shenkin wrote: >> is.na(strptime("5/2/1992", format="%m/%d/%Y")) > [1] FALSE >> is.na(strptime("5/3/1992", format="%m/%d/%Y")) > [1] TRUE I can't reproduce your problem on R 2.13.0 on linux: > strptime("5/2/1992", format="%m/%d/%Y") [1] "1992-05-0

[R] Linking 2 columns in 2 databases and applying a function

2011-06-22 Thread Ryan Utz
Hi all, I have two datasets, one that represents a long-term time series and one that represents summary data for the time series. It looks something like this: x<-data.frame(Year=c(2001,2001,2001,2001,2001,2001,2002,2002,2002,2002,2002,2002), Month=c(1,1,1,2,2,2),Q=c(5,5,5,6,6,6,3,3,3,4,4,5)) y<

Re: [R] binary in R

2011-06-22 Thread Sarah Goslee
Jürg. It's not that nobody knows the answer, necessarily, it's that your inquiry is so vague we don't know what the *question* is, let alone the answer. We don't know anything about your data, your intended function and model, anything. A toy reproducible example with clear explanation would be

[R] strange date problem - May 3, 1992 is NA

2011-06-22 Thread Alexander Shenkin
> is.na(strptime("5/2/1992", format="%m/%d/%Y")) [1] FALSE > is.na(strptime("5/3/1992", format="%m/%d/%Y")) [1] TRUE Any idea what's going on with this? Running strptime against all dates from around 1946, only 5/3/1992 was converted as "NA". Even stranger, it still seems to have a value associa

[R] binary in R

2011-06-22 Thread Jürg Altwegg
Does really nobody has a coment to this question? Dear R-help members I would like to use the R package goalprog, weighted and lexicographical goal programming and optimization to optimize a location problem. In my model I need a "yes" or "no" decision - in this case, whether to select a site

[R] VAR with excluded lags

2011-06-22 Thread gizmo
Hi, I would like to fit a Vector Auto Regression with lags that are not consecutive with the vars package (or other if there is one as good). Is it possible? For example, rather than having lags 1, 2, 3, 4, 5 have 1, 2, 5. Thanks. -- View this message in context: http://r.789695.n4.nabble.com

[R] VGAM constraints-related puzzle

2011-06-22 Thread Edward Wallace
Hello R users, I have a puzzle with the VGAM package, on my first excursion into generalized additive models, in that this very nice package seems to want to do either more or less than what I want. Precisely, I have a 4-component outcome, y, and am fitting multinomial logistic regression with one

Re: [R] Hardy Weinberg

2011-06-22 Thread Aaron Mackey
H-W only gives you the expected frequency of AA, AB, and BB genotypes (i.e. a 1x3 table): minor <- runif(1, 0.05, 0.25) major <- 1-minor AA <- minor^2 AB <- 2*minor*major BB <- major^2 df <- cbind(AA, AB, BB) -Aaron On Tue, Jun 21, 2011 at 9:30 PM, Jim Silverton wrote: > Hello all, > I am

Re: [R] Documenting variables, dataframes and files?

2011-06-22 Thread Laurent Gatto
Have a look at the AnnotatedDataFrame class in the Biobase package [1]. Here is the description from the manual: An ‘AnnotatedDataFrame’ consists of two parts. There is a collection of samples and the values of variables measured on those samples. There is also a description of each variable measu

Re: [R] Documenting variables, dataframes and files?

2011-06-22 Thread David Winsemius
There is a 'comment' function. It sets an attribute which gets carried along with the dataframe when it is saved or copied: > df1 <-data.frame(NA) > df1 NA. 1 NA > comment(df1) <- "empty dataframe" > comment(df1) [1] "empty dataframe" > df2 <- df1 > comment(df2) <- c(comment(df1), "copy of d

Re: [R] Package warnings

2011-06-22 Thread steven mosher
Thanks Duncan, I'll join Dev and ask the questions over there. Steve On Wed, Jun 22, 2011 at 7:19 AM, Duncan Murdoch wrote: > On 11-06-21 11:58 PM, steven mosher wrote: > >> Thanks to all your help I've just finished my first package and I have a >> couple of questions >> >> >> >> I want to su

Re: [R] error using glmmML()

2011-06-22 Thread Göran Broström
Tom, thanks for spotting a bug in glmmML; internally, glmmML sorts data by cluster. The bug is that I missed to sort the weights accordingly. Weights are produced when the response is a two-column matrix, as in your case. So, glmmML calls glm.fit with wrong weights, and the warning comes from that

Re: [R] analysing a three level reponse

2011-06-22 Thread Robert A LaBudde
The best method would probably be proportional odds regression using polyr() in 'MASS'. At least it's a starting point. At 09:19 AM 6/22/2011, Matt Ellis \(Research\) wrote: Hello, I am struggling to figure out how to analyse a dataset I have inherited (please note this was conducted some tim

[R] setting 'layout' locally within functions

2011-06-22 Thread Simon Goodman
Using layout I've created a function that makes a 2 panel plot - comprising a main plot, and a sub-panel with custom legend. I would now like to use layout to create multiple panels with plots created by my function, however the values for layout set in the function act globally, stopping me from

Re: [R] Setting up list of many equations for systemfit

2011-06-22 Thread Rita Carreira
Thanks for the suggestion, Dennis. Unfortunately, I was not able to make it work. Maybe I'm not using as.formula properly. I posted below some new things I tried. What am I doing wrong? Thanks for any feedback! Rita First attempt: > eqSystem2 <-paste(paste("form", 1:4, sep=""), as.formula(paste

[R] Documenting variables, dataframes and files?

2011-06-22 Thread Robert Lundqvist
Every now and then I realize that my attempts to document what all dataframes consist of are unsufficient. So far, I have been writing notes in an external file. Are there any better ways to do this within R? One possibility could be to set up the data as packages, but I would like to have a sol

Re: [R] How to add label to lines()

2011-06-22 Thread David Winsemius
On Jun 21, 2011, at 10:31 AM, Nevil Amos wrote: I am plotting a number of lines on a standard plot. I would like to add labels at the end (rhs) of each line. is there a way to do this other than defining the individual xy coordinates and placing each label using text() Without an examp

Re: [R] Tricky (?) conversion from data.frame to matrix where not all pairs exist

2011-06-22 Thread David Winsemius
On Jun 22, 2011, at 9:46 AM, Marius Hofert wrote: Hi David, thanks for the quick response. That's nice. Is there also a way without loading an additional package? I'd prefer loading less packages if possible. > xtb <- xtabs(value ~ year + block, data = df) > xtb block year a b c

Re: [R] analysing a three level reponse

2011-06-22 Thread David Cross
You could analyze these data with a multinomial logit model, with an ordinal response. I don't have my copy handy, but I know that Agresti (Categorical Data Analysis, Wiley) covers these models. Cheers David Cross d.cr...@tcu.edu www.davidcross.us On Jun 22, 2011, at 8:19 AM, Matt Ellis (R

Re: [R] Package warnings

2011-06-22 Thread Duncan Murdoch
On 11-06-21 11:58 PM, steven mosher wrote: Thanks to all your help I've just finished my first package and I have a couple of questions I want to submit to CRAN but I have 1 warning " checking for code/documentation mismatches ... WARNING Data sets with usage in documentation object 'FI

Re: [R] Help Needed on Merging Columns by Summation

2011-06-22 Thread Gabor Grothendieck
On Wed, Jun 22, 2011 at 2:35 AM, Nabila Binte Zahur wrote: > Dear Sirs/Madam, > > I am a beginner to R, and I am currently working on a data matrix which looks > like this: > >> head(oligo) > >        ko:K1 ko:K3 ko:K5 ko:K8 ko:K9 ko:K00010 ko:K00012 > AAA       370          6

Re: [R] How to add label to lines()

2011-06-22 Thread Duncan Murdoch
On 11-06-21 10:31 AM, Nevil Amos wrote: I am plotting a number of lines on a standard plot. I would like to add labels at the end (rhs) of each line. is there a way to do this other than defining the individual xy coordinates and placing each label using text() Probably, but what you describe

Re: [R] Tricky (?) conversion from data.frame to matrix where not all pairs exist

2011-06-22 Thread Marius Hofert
Hi David, thanks for the quick response. That's nice. Is there also a way without loading an additional package? I'd prefer loading less packages if possible. Cheers, Marius On 2011-06-22, at 15:38 , David Winsemius wrote: > > On Jun 22, 2011, at 9:19 AM, Marius Hofert wrote: > >> Hi, >>

Re: [R] Help Needed on Merging Columns by Summation

2011-06-22 Thread Dennis Murphy
Hi: Based on the information you provided, I would suggest looking into the transform() and within() functions in base R, and perhaps the mutate() function in package plyr. HTH, Dennis On Tue, Jun 21, 2011 at 11:35 PM, Nabila Binte Zahur wrote: > Dear Sirs/Madam, > > I am a beginner to R, and I

[R] How to add label to lines()

2011-06-22 Thread Nevil Amos
I am plotting a number of lines on a standard plot. I would like to add labels at the end (rhs) of each line. is there a way to do this other than defining the individual xy coordinates and placing each label using text() Thanks Nevil Amos __ R-h

[R] How to plot 4 variable/distribution as tetrahedral

2011-06-22 Thread Rajesh K Kushawaha
Dear all, I am a new user of R. I want use R to plot four momentum vectors(variable) in form of tetrahedral. The data(momentum vector) is in form of distribution(e.g. momentum of particle1 vs intensity). Thanks in advance. Best Regards Rajesh -- View this message in context: http://r.78969

[R] Help with winbugs code

2011-06-22 Thread nita yalina
Good afternoon sir, i'm a student in Indonesia who study technology management, i need to review the software i'v been develop, i was told to use bayesian SEM because i don't have large sample. i don't know much about statistics but i try to make a code via winbugs.. and a i got a problem. here i a

[R] analysing a three level reponse

2011-06-22 Thread Matt Ellis (Research)
Hello, I am struggling to figure out how to analyse a dataset I have inherited (please note this was conducted some time ago, so the data is as it is, and I know it isn't perfect!). A brief description of the experiment follows: Pots of grass were grown in 1l pots of standad potting medium for 1

[R] Help Needed on Merging Columns by Summation

2011-06-22 Thread Nabila Binte Zahur
Dear Sirs/Madam, I am a beginner to R, and I am currently working on a data matrix which looks like this: > head(oligo) ko:K1 ko:K3 ko:K5 ko:K8 ko:K9 ko:K00010 ko:K00012 AAA 370 631 365 67 164 455

Re: [R] Tricky (?) conversion from data.frame to matrix where not all pairs exist

2011-06-22 Thread David Winsemius
On Jun 22, 2011, at 9:19 AM, Marius Hofert wrote: Hi, and what's the simplest way to obtain a *data.frame* with all years? The matching seems more difficult here because the years can/will show up several times... (df <- data.frame(year=c(2000, 2001, 2002, 2001, 2000, 2001),

Re: [R] Help interpreting ANCOVA results

2011-06-22 Thread Daniel Malter
I think you should write out your model formula and then go over it term by term to see which term adds what to your understanding of the data. If necessary, pick up a text about the interpretation of coefficients. For example, you will find that Reduction is not just the slope for the condition QF

Re: [R] Tricky (?) conversion from data.frame to matrix where not all pairs exist

2011-06-22 Thread Marius Hofert
Hi, and what's the simplest way to obtain a *data.frame* with all years? The matching seems more difficult here because the years can/will show up several times... (df <- data.frame(year=c(2000, 2001, 2002, 2001, 2000, 2001), block=c("a","a","a","b","c","c"), value=1:6)) (df.

[R] (no subject)

2011-06-22 Thread Jim Brindle
..I can’t imagine myself without this site! http://www.stadcopolyproducts.com/friends.page.php?utopic=07x1 [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch

  1   2   >