similar to: R equivalent of linux "cut", "paste", and "grep" ?

Displaying 20 results from an estimated 12000 matches similar to: "R equivalent of linux "cut", "paste", and "grep" ?"

2008 Jan 29
1
remove similar values
hello!! say that i have the values of x1 and x2. my x1 has longer length than x2. how am i going to remove the similar values of x1 and x2. Any suggestion?? Thanks in advance!! Cheers, Anisah e f [1,] 17358865 17906353 [2,] 17966995 21295547 [3,] 21306539 27880531 [4,] 27880531 34118702 [5,] 34166504 35395488 [6,] 36111044 36132622 [7,]
2008 Feb 12
3
filter data from data frame
Hi, I have a data frame Y with the following information, ORF spectra 1 YAL001C 2 2 YAL005C 21 3 YAL007C 2 4 YAL012W 8 5 YAL016W 24 6 YAL019W 3 7 YAL020C 2 8 YAL021C 7 9 YAL022C 3 10 YAL023C 6 11 YAL026C 2 12 YAL029C 1 13 YAL031C 1 14 YAL035W 48 15 YAL038W 173 16 YAL041W 4 17 YAL042W 4 18
2008 Feb 13
4
rolling sum (like in Rmetrics package)
Hello, I'm new to R and would like to know how to create a vector of "rolling sums". (I have seen the Rmetrics package and the rollMean function and I would like to do the same thing except Sum instead of Mean.) I imagine someone has done this, I just can't find it anywhere. Example: x <- somevector #where x is 'n' entries long #what I would like to do is: x1
2010 Apr 12
1
Local R Training
Hello List, I am new to R and statistics in general. My two colleges and I would like to get some training in the proper usage of R. A quick internet search provided no results for the region of Basel in Switzerland. Does some one on this list knows of any trainers or schools in the region in question or where to look next? Regards, Dominik Riva Universitätsspital Basel Med.
2008 Feb 13
3
indices of rows containing one or more elements >0
Hi, Given test <- matrix(c(0,2,0,1,3,5), 3,2) > test[test>0] [1] 2 1 3 5 These are values >0 > which(test>0) [1] 2 4 5 6 These are array indices of those values >0 > which(apply(test>0, 1, all)) [1] 2 This gives the row whose elements are all >0 I can't seem to get indices of rows containing one or more elements >0 [[alternative HTML version deleted]]
2008 Feb 11
4
Conditional rows
Hi, Given a simple example, test <- matrix(c(0.1, 0.2, 0.1, 0.2, 0.1, 0.1, 0.3, 0.1, 0.1), 3, 3) How to generate row indexes for which their corresponding row values are less than or equal to 0.2 ? For this example, row 2 and 3 are the correct ones. Thanks [[alternative HTML version deleted]]
2007 Jun 19
4
plot only x- and y-axis with origin, no box()
hi all, I'm trying for quite some time to have an x- and y-axis, but no entire box. >plot(..,axes=F) >axis(1) >axis(2) Gives this, but their axes do not go to the origin. Quite a number of people find this gap between the two axes disturbing. Has anyone an idea how to let these axes go to the origin? thank you in advance [[alternative HTML version deleted]]
2008 Jun 30
6
Plotting three time series on the same graph
Dear R Users, I would like to plot three time series on the same graph, two axis on the left and one axis on the right. The time series that I am graphing on the left do not share a similar scale: one has a range of 1:100 and the other a range of 25000:70000. How can I display the tick marks for both on the left hand side without superimposing them, i.e. one set of tick marks in black right
2008 Mar 13
2
How to cbind or rbind different lengths vectors/arrays without repeating the elements of the shorter vectors/arrays ?
Hi, How to cbind or rbind different lengths vectors/arrays without repeating the elements of the shorter vectors/arrays ? > cbind(1:2, 1:10) [,1] [,2] [1,] 1 1 [2,] 2 2 [3,] 1 3 [4,] 2 4 [5,] 1 5 [6,] 2 6 [7,] 1 7 [8,] 2 8 [9,] 1 9 [10,] 2 10 [[alternative HTML version deleted]]
2008 Apr 14
2
how to write a table to pdf
Hi, Is there a way to write a table to pdf ? I have checked write.table, it only writes to text file. [[alternative HTML version deleted]]
2008 Apr 26
2
3 questions: debug R script, multi-level sorts, and multi-gsub
Hi, 1) I ran a script say test.R. It ran and terminated with an error. However, I am not sure where the error occur. > source("test.R") Loading required package: tools Welcome to Bioconductor Vignettes contain introductory material. To view, type 'openVignette()'. To cite Bioconductor, see 'citation("Biobase")' and for packages
2008 Feb 04
3
counts of each column that are not NA, and/or greater than column means
Hi, Given a test matrix, test <- matrix(c(1,2,3,NA,2,3,NA,NA,2), 3,3) A) How to compute the counts of each column (excluding the NA) i.e., 3, 2, 1 B) How to compute the counts of each column (excluding the NA) that are greater than the column means ? i.e., 1, 1, 0 I could write a for loop, but hope to use better alternative. [[alternative HTML version deleted]]
2008 Mar 13
2
How to manipulate data according to groups ?
Hi, I have a two columns data, the first column are values, and second column are the groups. For this example, there are 3 groups 1,2,3. How can I manipulate the values in the first column according to groups, say I would like to find mean, sum, and standard deviation for the different groups ? How do I plot data according to groups ? > t <- matrix(c(rnorm(10), 1,1,2,2,1,3,3,3,3,2),
2008 Jan 29
2
add/subtract matrices, ignoring NA or missing values
Hi, For example, given two 2x2 matrices m1 and m2. I would like to add/subtract element by element > m1 [,1] [,2] [1,] NA NA [2,] 1 2 > m2 [,1] [,2] [1,] 1 NA [2,] NA 2 > m1 + m2 [,1] [,2] [1,] NA NA [2,] NA 4 How can I ignore the NA, and get this ? Hope the solution can be extended to subtract and modulo also. [,1] [,2]
2008 Apr 16
1
What objects will save.image saves ? And how to specify objects to be saved..
Hi, I have a R script that loads an image R.data, does some operations, then save to the R.data again. Suppose I have done some computation before loading the R script, will all the objects before the R script execution be saved to R.data ? If yes, how can I specify save.image to save only those objects created in the R script ? Thanks Stanley [[alternative HTML version deleted]]
2008 Jan 31
1
Bug with hist() ?
Hi, Is this a bug from hist() ? The total density is greater than 1. > test [1] 0.05077802 -0.50585520 -0.98053648 -0.35513059 0.86767129 0.61736097 [7] 0.14264062 0.26243841 -0.41477782 0.64172618 0.87230953 -0.62570629 [13] 0.43596467 -0.93214106 -0.26781599 > h <- hist(test, freq = FALSE, main="Histogram of correlation", ylab = "Frequency", xlab =
2008 Feb 01
1
problem getting multiple densityplots on one page
Hi, I used the following statements to generate unsuccessfully a 5 by 5 multiple densityplots on a single page. If I use plot, the whole thing works. > data <- matrix(rnorm(25), 5, 5) > op <- par(mfrow = c(5, 5)) > for (x in 1:5) {densityplot(data[,x])} > par(op) Thanks Stanley [[alternative HTML version deleted]]
2008 Feb 14
1
How to check cy5 and cy3 values were lowess normalized
Hi, I have some microarray data, cy5 and cy3 values are in log2. Is there a way to check they have undergone lowess normalization ? Thanks Stanley [[alternative HTML version deleted]]
2008 Feb 05
2
How to generate table output of t-test
Hi, Given test <- matrix(c(1, 1,2,2), 2,2) t <- apply(test, 1, t.test) How can I obtain a table of p-values, confidence interval etc, instead of [[1]] One Sample t-test data: newX[, i] t = 3, df = 1, p-value = 0.2048 alternative hypothesis: true mean is not equal to 0 95 percent confidence interval: -4.853102 7.853102 sample estimates: mean of x 1.5 [[2]]
2008 Apr 10
6
How to create a legend without plot, and to use scientific notation for axes label ?
Hi, I have a 3 by 2 plots per page, and would like to place a legend on the last region. How to do that ? Also, is there any way to specify scientific notation for axes label ? [[alternative HTML version deleted]]