Re: [R] rbind with partially overlapping column names

2011-05-16 Thread Jonathan Flowers
- data.frame(b=c(B,B),c=c(c,c)) merge(df1,df2,all=TRUE) b a c 1 B A c 2 B A c 3 B A c 4 B A c On 5/15/11 11:19 PM, William Dunlap wdun...@tibco.com wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jonathan Flowers

[R] rbind with partially overlapping column names

2011-05-15 Thread Jonathan Flowers
Hello, I would like to merge two data frames with partially overlapping column names with an rbind-like operation. For the follow data frames, df1 - data.frame(a=c(A,A),b=c(B,B)) df2 - data.frame(b=c(b,b),c=c(c,c)) I would like the output frame to be (with NAs where the frames don't overlap)

[R] glm with within-subject factors

2011-03-28 Thread Jonathan Flowers
Hello, I am analyzing a dataset where the response is count data. I have one two-level factor that is repeated within-subjects and additional between-subject variables that are either categorical or continuous. I have previously modeled a comparable dataset (without the within-subjects factor)

[R] get list element names within lapply / sapply call

2011-01-15 Thread Jonathan Flowers
Hi all, I would like to iterate through a list with named elements and access the names within an lapply / sapply call. One way to do this is iterate through the names and index the list with the name. Is there a way to iterate through the list elements themselves and access the element names

Re: [R] get list element names within lapply / sapply call

2011-01-15 Thread Jonathan Flowers
: lapply(X, FUN, ...) Browse[1] ls(all.names=TRUE) [1] ... FUN X Browse[1] FUN function (text = , condition = NULL, expr = TRUE, skipCalls = 0L) .Primitive(browser) Browse[1] X $a [1] 1 2 $b [1] 3 4 $c [1] 5 6 Browse[1] On Sat, Jan 15, 2011 at 3:06 PM, Jonathan Flowers

Re: [R] subset question

2010-12-29 Thread Jonathan Flowers
Try subd - d[, gene == c(i1,i2,i3)] On Wed, Dec 29, 2010 at 4:55 PM, ANJAN PURKAYASTHA anjan.purkayas...@gmail.com wrote: Hi, I'm having a problem with a step that should be pretty simple. I have a dataframe, d, with column names : gene s1 s2 s3. The column gene stores an Id; the rest of

[R] Perl cut equivalent in R

2010-12-01 Thread Jonathan Flowers
Does anyone know of a command in R that is equivalent to the =cut function in Perl? Thanks. Jonathan [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] Perl cut equivalent in R

2010-12-01 Thread Jonathan Flowers
, but cut is a handy solution. Thanks. On Wed, Dec 1, 2010 at 6:31 PM, Sarah Goslee sarah.gos...@gmail.com wrote: It would help if you told us what you wanted this function to do, and provided an example. Not everyone speaks Perl. Sarah On Wed, Dec 1, 2010 at 6:10 PM, Jonathan Flowers

[R] d.f. in F test of nested glm models

2010-11-26 Thread Jonathan Flowers
Dear all, I am fitting a glm to count data using poison errors with the log link. My goal is to test for the significance of model terms by calling the anova function on two nested models following the recommendation in Michael Crawley's guide to Statistical Computing. Without going into too

Re: [R] d.f. in F test of nested glm models

2010-11-26 Thread Jonathan Flowers
Winsemius dwinsem...@comcast.netwrote: On Nov 26, 2010, at 9:30 PM, Jonathan Flowers wrote: Dear all, I am fitting a glm to count data using poison errors with the log link. My goal is to test for the significance of model terms by calling the anova function on two nested models following

Re: [R] graph margins

2010-09-29 Thread Jonathan Flowers
Use par(oma=c(1,1,1,1)) # oma = outer margin area Is this what your looking for? On Wed, Sep 29, 2010 at 5:03 PM, Mohsen Jafarikia jafari...@gmail.comwrote: Hello All, I am drawing a graph having 18 small graphs inside using par(mfrow = c(6,3)) command. My problem is how to specify the

Re: [R] margin control in lattice package

2010-09-27 Thread Jonathan Flowers
Hi Peter, Thank you for your thoughtful reply. I am tweaking the setting print settings you suggested. It looks like this is going to solve my problem. Thanks very much for help. Jonathan On Sat, Sep 25, 2010 at 6:00 PM, Peter Ehlers ehl...@ucalgary.ca wrote: On 2010-09-25 8:59, Jonathan

[R] margin control in lattice package

2010-09-25 Thread Jonathan Flowers
Hi all, I am difficulty with simple layout of plots in the lattice package I have created a series of levelplots and would like to plot them to a single device, but need to reduce the margin areas. This is easily accomplished with par(oma) and par(mar) in the base graphics package but I am

[R] layout of lattice graphics

2010-09-24 Thread Jonathan Flowers
Hi all, I am trying to pickup lattice graphics in R and having difficulty with simple layout of plots. I have created a series of levelplots and would like to plot them to a single device, but need to reduce the margin areas. This is easily accomplished with par(oma) and par(mar) in the base

Re: [R] Scatterplot_row match

2010-07-15 Thread Jonathan Flowers
Hi, What if you create two data frames, then merge them by gene id. If your data is in a data frame called dframe... df1 - subset(dframe,select=c(id2c,2c)) df2 - subset(dframe,select=c(id1c,1c)) merged - merge(df1,df2,by.x=id2c,by.y=id1c,all=TRUE) plot(merged$1c,merged$2c) Cheers, Jonathan

[R] select columns from vector of column names

2010-07-09 Thread Jonathan Flowers
Hi I want to extract columns from a data frame using a vector with the desired column names. This short example uses the select argument in the subset function to accomplish what I am trying to do. Is there a better solution? #names of desired columns colnames - c(col1,col3) #my data data -

[R] select columns from dataframe

2010-07-09 Thread Jonathan Flowers
Hi, I would like to extract columns from a dataframe using a vector of desired column names. The following working example uses the select argument in the subset function to accomplish what I am trying to do. Is there a better solution? Thanks. #my data data -