[R] filtering data frame on multiple columns

2011-03-22 Thread Dry, Jonathan R
Hello I want to filter a data frame called 'filtEXP' for rows where column 'max' 6 OR column 'FC' 4 and am trying various permutations of the below to no avail: filtEXP2 - filtEXP[filtEXP$max 6,] || filtEXP[filtEXP$FC 4,] Any ideas?

[R] Maintaining sort order when transpose

2009-10-01 Thread Dry, Jonathan R
Hi all - I have a data frame and have sorted it by a particular column, with rownames set to a different variable. I wish to transpose this data frame, naming columns by the rowname variable but maintaining the sorted order through to the order of columns in my transposed table, however use of

Re: [R] Scaling data

2009-09-30 Thread Dry, Jonathan R
Hello all I am manipulating some data and wish to expand/unmerge (i.e. do the opposite of aggregate) rows in a data matrix based on the values in a particular column and a seperator, e.g. Col1Col2 n1;n2 6 ...separating by ; becomes Col1Col2 num16 num26 Any ideas? Also

[R] Scaling data

2009-09-28 Thread Dry, Jonathan R
Hello all I have a data frame representing a matrix of data. For each of my variables (rows) I want to scale the data between 0 (representing the minimum value in that row) and 1 (representing the maximum value in that row). I was wondering if there is a simple function anywhere that does

[R] Spliting columns, strings or reg exp returning substrings

2009-09-25 Thread Dry, Jonathan R
Currently as the first column in a data frame I have string values in the format xx_yy - I want to create a new column with just the substring xx (for each row in turn). Three possible ways to do this might be (1) split the string by '_' using strsplit and paste the first of the resulting

[R] aggregating strings

2009-07-28 Thread Dry, Jonathan R
I am currently summarising a data set by collapsing data based on common identifiers in a column. I am using the 'aggregate' function to summarise numeric columns, i.e. aggregate(dat[,3], list(dat$gene), mean). I also wish to summarise text columns e.g. by concatenating values in a comma

[R] Merging tables

2009-01-20 Thread Dry, Jonathan R
I am relatively new to R and am trying to do some basic data manipulation. Basically I have a table (csv - table 1) of data for a set of samples (rows), and a second table (table 2) of information about a subset of samples of particular interest. I want to pull out the data from table 1 for

[R] network

2008-07-11 Thread Dry, Jonathan R
Hello I am a relatively new user of R and am struggling to use the 'network' package. I have a correlation matrix (produced using 'cor'), and want to draw a network where each item showing correlation above a threshold (say 0.5) is joined by a green line, and each item showing correlation

Re: [R] network

2008-07-11 Thread Dry, Jonathan R
To: Dry, Jonathan R Cc: R Help list Subject: Re: [R] network Jonathan, please stay on the list. The first query i don't understand, can you send a pdf or explain a bit what exactly happens. As for the names, use them as row or column names in the matrix (see ?colnames), and then do V(g)$label