Re: [R] rbind with partially overlapping column names

2011-05-16 Thread Jonathan Flowers
quot; wrote: > > > > >> -Original Message- > >> From: r-help-boun...@r-project.org > >> [mailto:r-help-boun...@r-project.org] On Behalf Of Jonathan Flowers > >> Sent: Sunday, May 15, 2011 5:41 PM > >> To: r-help@r-project.org > &

[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

[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) u

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

2011-01-15 Thread Jonathan Flowers
how to > look at the ... > > > sapply(mylist, browser) > Called from: lapply(X, FUN, ...) > Browse[1]> ls(all.names=TRUE) > [1] "..." "FUN" "X" > Browse[1]> FUN > function (text = "", condition = NULL, expr = TRUE, skipCalls

[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 wit

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

Re: [R] Perl "cut" equivalent in R

2010-12-01 Thread Jonathan Flowers
of ways to solve the problem, but cut is a handy solution. Thanks. On Wed, Dec 1, 2010 at 6:31 PM, Sarah Goslee 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 P

[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 post

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

2010-11-26 Thread Jonathan Flowers
Winsemius wrote: > > 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 >> f

[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 muc

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 wrote: > 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 margins of 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 wrote: > On 2010-09-25 8:59, Jonathan Flowers wr

[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 havin

[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 gra

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) Ch

[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 <- data.frame("col1"=c(1,2,3),"col2

[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