[R] degrees of freedom

2014-01-23 Thread Iain Gallagher
Hello List I have been asked to analyse some data for a colleague. The design consists of a two sets of animals First set of three - one leg is treated and the other is not under two different conditions (control & overload are the same animals - control leg is control (!) for treated leg;

[R] heatmap tile size question

2013-02-01 Thread Iain Gallagher
Hello List I was wondering if it is possible to make the individual 'tiles' in a heatmap larger. Often when I plot heatmaps and want to label the rows with eg gene names I either have to shrink the text or leave it out altogether as it becomes so small as to be unreadable. I wondered if there w

[R] write out list of lists with names

2012-11-28 Thread Iain Gallagher
Hello List I have a list question. I'm doing some data wrangling for a colleague and I have nested list in the following format: structure(list(MU10 = structure(c(0.80527905920989, 0.4350488707836, 0.455195366623, 0.565174432205497, 0.208180556861924), .Names = c("MU.16", "MU.19", "MU.21", "

[R] conditional subset and reorder dataframe rows

2012-07-20 Thread Iain Gallagher
Hi List I have a dataframe (~1,200,000 rows deep) and I'd like to conditionally reorder groups of rows in this dataframe. I would like to reorder any rows where the Chr.Strand column contains a '-' but reorder within subsets delineated by the Probe.Set.Name column. # toy example library

Re: [R] reading file in zip archive

2012-05-31 Thread Iain Gallagher
Hi Phil That's it. Thanks. Will have a read at the docs now and see if I can figure out why leaving the 'r'ead instruction out works. Seems counter-intuitive! Best Iain From: Phil Spector To: Iain Gallagher Cc: r-help Sent: Thursday, 31

Re: [R] reading file in zip archive

2012-05-30 Thread Iain Gallagher
'x.txt', 'r') zT <- read.table(z, header=FALSE, sep='\t') Error in read.table(z, header = FALSE, sep = "\t") :   seek not enabled for this connection As I said in my previous email readLines fails as well. Rather strange really. Anyway, as before an

[R] reading file in zip archive

2012-05-30 Thread Iain Gallagher
Hi List I have a series of zip archives each containing several files. One of these files is called goCats.txt and I would like to read it into R from the archive. It's a simple tab delimited text file. pathToZip <- '/home/iain/Documents/Work/Results/bovineMacRNAData/deAnalysis/afInfection/comm

Re: [R] Completely Off Topic:Link to IOM report on use of "-omics" tests in clinical trials

2012-03-26 Thread Iain Gallagher
I followed this case while it was ongoing. It was a very interesting example of basic mistakes but also (for me) of journal politicking. Keith Baggerly and Kevin Coombes wrote a great paper - "DERIVING CHEMOSENSITIVITY FROM CELL LINES: FORENSIC BIOINFORMATICS AND REPRODUCIBLE RESEARCH IN H

Re: [R] hgu133plus2hsentrezgprobe library

2012-03-19 Thread Iain Gallagher
Hi Eleni Question like this are better served on the bioconductor mailing list. Nonetheless try this ALL <- topTable(fit2, coef=1, number=Inf) ALL$SYMBOL <- unlist(mget(ALL$ID, hgu133plus2hsentrezgSYMBOL, ifnotfound=NA)) Here ALL is the output from limma for differential expression (ALL$ID is t

[R] ggplot2 reorder factors for faceting

2011-11-08 Thread Iain Gallagher
Dear List I am trying to draw a heatmap using ggplot2. In this heatmap I have faceted my data by 'infection' of which I have four. These four infections break down into two types and I would like to reorder the 'infection' column of my data to reflect this. Toy example below: library(ggplo

Re: [R] R-Studio Question

2011-08-30 Thread Iain Gallagher
Above the graph on the left there are back and forward arrows. You can use those (like a browser). This might have been better asked on the R-Studio forums. They're very friendly. best iain --- On Tue, 30/8/11, Eran Eidinger wrote: > From: Eran Eidinger > Subject: [R] R-Studio Question > To

Re: [R] Synchronizing R libraries on N machines?

2011-08-26 Thread Iain Gallagher
Hi Giovanni Using Ubuntu and MacOSX may not be irrelevant. I use Ubuntu and if I carry out a fresh install (e.g. after a new release - although I've stuck with 10.04 so far) then I always have to mess around, check the web etc to install external packages that R libraries I want to use rely on.

Re: [R] aggregating data

2011-06-30 Thread Iain Gallagher
oops last reply was only half the solution: library(plyr) df <- data.frame(gene=c('A', 'A', 'E', 'A', 'F', 'F'), probe = c(1,2,3,4,5,6), exp = c(0.34, 0.21, 0.11, 0.21, 0.56, 0.81)) ddply(df, .(gene), function(df)c(length(df$gene), median(df$exp)) gene V1V2 1A 3 0.210 2E 1 0.110

Re: [R] aggregating data

2011-06-30 Thread Iain Gallagher
Hi Max Using plyr instead of rehsape: library(plyr) df <- data.frame(gene=c('A', 'A', 'E', 'A', 'F', 'F'), probe = c(1,2,3,4,5,6)) ddply(df, .(gene), function(df)length(df$gene)) gene V1 1A 3 2E 1 3F 2 best iain --- On Thu, 30/6/11, Max Mariasegaram wrote: > From: Max Mar

Re: [R] median time period

2011-06-29 Thread Iain Gallagher
lt;- median(as.numeric(intervalsMonths)) Best iain --- On Wed, 29/6/11, Iain Gallagher wrote: > From: Iain Gallagher > Subject: [R] median time period > To: r-help@r-project.org > Date: Wednesday, 29 June, 2011, 16:24 > Hello List > > I'm trying to calculate the median

[R] median time period

2011-06-29 Thread Iain Gallagher
Hello List I'm trying to calculate the median period (in months) of a set of time intervals (between two interventions). I have been playing with the lubridate package to create the intervals but I can't think of the right approach to get the median timeperiod. Toy code: library(lubridate) t

Re: [R] Why doesn't this work ?

2011-03-17 Thread Iain Gallagher
The first line of this reply is a definite candidate for the fortunes package! best i --- On Thu, 17/3/11, bill.venab...@csiro.au wrote: > From: bill.venab...@csiro.au > Subject: Re: [R] Why doesn't this work ? > To: ericst...@aol.com, r-help@r-project.org > Date: Thursday, 17 March, 2011, 3:

Re: [R] Export R dataframes to excel

2011-03-01 Thread Iain Gallagher
This appeared today on the r-bloggers site and might be useful for you. http://www.r-bloggers.com/release-of-xlconnect-0-1-3/ cheers i --- On Tue, 1/3/11, Steve Taylor wrote: > From: Steve Taylor > Subject: Re: [R] Export R dataframes to excel > To: r-help@r-project.org, "maxsilva" > Date:

Re: [R] multiple plots using a loop

2011-02-21 Thread Iain Gallagher
Hi Darcy This works for me: Factor <- rep(factor(letters[1:4]), each = 10) Size <- runif(40) * 100 par(mfrow = c(2, 2)) for (i in unique(Factor)) { hist(Size[Factor == i], main = i, xlab = paste("n =",length(Size[Factor == i])), ylab = "") } I think that using for (i in Factor) cycles through

Re: [R] [BioC] problem with function

2010-12-18 Thread Iain Gallagher
','cumulMetric')         #return whole list     return(listMetric)# dataframe } Cheers i --- On Sat, 18/12/10, cstrato wrote: > From: cstrato > Subject: Re: [BioC] problem with function > To: "Iain Gallagher" > Cc: "bioconductor" > Date:

Re: [R] help with function

2010-12-18 Thread Iain Gallagher
B.utf8 LC_NUMERIC=C [3] LC_TIME=en_GB.utf8LC_COLLATE=en_GB.utf8 [5] LC_MONETARY=C LC_MESSAGES=en_GB.utf8 [7] LC_PAPER=en_GB.utf8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_GB.utf8 LC

[R] help with function

2010-12-17 Thread Iain Gallagher
Hello List I'm moving this over from the bioC list as, although the problem I'm working on is biological, the current bottle neck is my poor understanding of R. I wonder if someone would help me with the following function. cumulMetric <- function(deMirPresGenes, deMirs){     #need to match po

Re: [R] netlabR package in English

2010-03-26 Thread Iain Gallagher
Keith Download the netLabR package from http://www.meduniwien.ac.at/user/georg.dorffner/netalg.html i.e. download the .tar.gz or zip files. Inside these, in the inst/doc directory you'll find two English manuals. HTH iain --- On Thu, 25/3/10, Keith McMillan wrote: > From: Keith McMillan >

Re: [R] where do I send typos?

2010-03-26 Thread Iain Gallagher
Best to send any comments on documentation to the author of the documentation. iain --- On Fri, 26/3/10, Xu Wang wrote: > From: Xu Wang > Subject: [R] where do I send typos? > To: r-help@r-project.org > Date: Friday, 26 March, 2010, 5:15 > > Hi, > > I notice several typos when reading docume

Re: [R] logical operations with lists

2010-02-12 Thread Iain Gallagher
these are vectors in R not lists try: a<-c('a', 'b', 'c')#first vector (like A) > a [1] "a" "b" "c" b<-c('c', 'd', 'e')#second vector (like B) > b [1] "c" "d" "e" c<-setdiff(b,a)# all those in B but not A > c [1] "d" "e" cheers iain --- On Fri, 12/2/10, Zoppoli, Gabriele (NIH/NCI) [G] wrote

Re: [R] logical operations with lists

2010-02-12 Thread Iain Gallagher
sorry, misread your post try this... > c<-setdiff(a,b) > c [[1]] [1] "a" [[2]] [1] "b" for a list C that contains all the members in the list B that are not in list A --- On Fri, 12/2/10, Zoppoli, Gabriele (NIH/NCI) [G] wrote: > From: Zoppoli, Gabriele (NIH/NCI) [G] > Subject: [R] logical

Re: [R] logical operations with lists

2010-02-12 Thread Iain Gallagher
> a<-list('a', 'b', 'c') > b<-list('c', 'd', 'e') > c<-intersect(a,b) > c [[1]] [1] "c" Is this what you want? Cheers Iain --- On Fri, 12/2/10, Zoppoli, Gabriele (NIH/NCI) [G] wrote: > From: Zoppoli, Gabriele (NIH/NCI) [G] > Subject: [R] logical operations with lists > To: "r-help@r-project

Re: [R] Upgrading To 2.10 from 2.6.2

2009-12-08 Thread Iain Gallagher
Hi Steve Have you tried: apt-cache search gfortran in a terminal window. Then sudo apt-get install theRelevantPackage I think you also need the Universe repos enabled. HTH Iain --- On Tue, 8/12/09, steve_fried...@nps.gov wrote: > From: steve_fried...@nps.gov > Subject: [R] Upgrading To

[R] string splitting and testing for enrichment

2009-06-20 Thread Iain Gallagher
Hi List I have data in the following form: Gene    TFBS NUDC     PPARA(1) HNF4(20) HNF4(96) AHRARNT(104) CACBINDINGPROTEIN(149) T3R(167) HLF(191) RPA2     STAT4(57) HEB(251) TAF12     PAX3(53) YY1(92) BRCA(99) GLI(101) EIF3I     NERF(10) P300(10) TRAPPC3     HIC1(3) PAX5(17) PAX5(110) NRF1(1

[R] arithmetic problem

2009-05-30 Thread Iain Gallagher
Hello list I have a problem with a dataset (see toy example below) where I am trying to find the difference between two (or more numbers) and discard those observations which fall outside a set interval. An example and further explanation: values ind 12655 7A5 23028

[R] counting occurrence of text in a dataframe

2009-05-23 Thread Iain Gallagher
Hello list. I am hoping for some help with a relatively simple problem. I have a data frame arranged as below. I want to be able to count the occurrence of each gene (eg let-7e) by Experiment. In other words how many times does a given gene crop up in the dataframe. I tried table but couldn't

[R] replacing values in a vector

2008-11-06 Thread Iain Gallagher
Hello list. I have a vector of values: eg > head(diff_mirs_list) [1] "hsa-miR-26b" "hsa-miR-26b" "hsa-miR-23a" "hsa-miR-27b" "hsa-miR-29a" [6] "hsa-miR-29b" and I would like to conditionally replace each value in this vector with a number defined in a dataframe: > fc Probe ave.fc

[R] RBGL installation

2008-10-06 Thread Iain Gallagher
Hi I'm trying to install the RBGL package. However I am getting the following error; can anybody shed some light on what I'm missing? /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/cstdlib:135: error: ‘::system’ has not been declared Thanks. Iain > sessionInfo() R vers

Re: [R] Free SQL Database with R

2008-09-03 Thread Iain Gallagher
Hi Chibisi I'm sort of jumping into this thread but from your description of charts / plotting below I thought you might like to take a look at flot: http://code.google.com/p/flot/ >From the page "Flot is a pure Javascript plotting library for jQuery. It produces graphical plots of arbitrary

Re: [R] Help with data layout - Thanks

2008-07-17 Thread Iain Gallagher
Thanks for all the excellent replies. Iain [[alternative HTML version deleted]] __ 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.html and p

[R] help with data layout

2008-07-17 Thread Iain Gallagher
Hello list I have been given some Excel sheets with data laid like this: Col1Col2 A 3 2 3 B 4 5 4 C 1 4 3 I was hoping to import this into R as a csv and then get the mean and SD for each letter in

Re: [R] Another failed attempt to install an R package in Ubuntu

2008-07-12 Thread IAIN GALLAGHER
Hi Miklos. If you want to install R packages to the /usr/lib/R/library directory you need to start R with 'root' user privileges. Ordinary users do not have the appropriate permissions to write to this directory. At the command line type: sudo R type your password when prompted. You won't ne

Re: [R] txt file, 14000+ rows, only last 8000 appear

2008-06-09 Thread IAIN GALLAGHER
I'm pretty sure I've had similar problems to this in the past and the problem has been a badly formatted text file ie you think it's all tab delimited but it's not. I can't be more specific (because it's your file) but it would be worth copying the non appearing rows into a separate file and se

Re: [R] 64 bit Linux/Ubuntu memory limit problem?

2008-04-24 Thread IAIN GALLAGHER
Hi Zack. I don't know how helpful this is but I use R on 64bit ubuntu for the analysis of large microarray datasets. R may well be taking advantage of all your memory but the objects it's creating are too big. You could run 'top' in another terminal window to examine this behaviour. If R is usi

[R] test individual values in rows

2008-03-14 Thread IAIN GALLAGHER
Hi list. I have a numerical dataset 22,000 rows deep and 43 columns wide. I would like to remove those rows which contain only values less than 100 (ie if any value in the row is greater than 100 the row stays in the dataset). I am unsure how to test each individual value across the rows and th