-
Insert the current time into R history timestamp…
Monteiro Insert the current time into R history timestamp()
-
matchPWM is now part of Biostrings 2.7.47 in…
Beverwijk matchPWM() is now part of Biostrings 2.7.47 (in BioC devel, so you need R-2.7). Load Biostrings: library(Biostrings) Suppose ‘pwm’ contains a Position Weight Matrix, let’s say: pwm maxWeights(pwm) # the max weight in each column [1] 17 20 19 20 18 18 20 8 > maxScore(pwm) # the max possible score [1] 140 Let’s match…
-
Save R function to a text file latex…
Save R function to a text file latex.code
-
Quick and easy submission of R on Sun…
Quick and easy submission of R on Sun Grid Engine Easiest way to submit R jobs Here are two scripts and a symlink I created to make it easy as possible to submit R jobs to your Grid: qsub-R If you normally do something along the lines of: user@exec:~$ nohup nice R CMD BATCH toodles.R…
-
Subsetting ranged data with its values Example subset…
Subsetting ranged data with its values. Example subset reads according to the width > paired.read.rd RangedData with 997111 rows and 1 value column across 1 space space ranges | strand | 1 chr4 [ 146855, 146898] | + 2 chr4 [1322462, 1322493] | – 3 chr4 [ 135547, 135703] | + 4 chr4 [ 965138,…
-
To import a SAM file or other data…
To import a SAM file or other data having “#” as data using read.table, it is necessary to change the “comment.char” option. test.sam
-
Import specific columns into R using read table…
Import specific columns into R using read.table test.import
-
Retrieving rda into a different variable name in…
Retrieving .rda into a different variable name in R 1. Using environment x
-
Convert a list of data frame into a…
Convert a list of data frame into a data frame ldply in plyr package did awesome job. I have a list with different length of data. I’d like to convert the list to a data frame with the name of the each list showing as a column. Then I can do grouping the data. Here…
-
Do NOT use 1 length x in for…
Do NOT use 1:length(x) in for statement in R. Because when x is empty, the loop will run over 1:0, which is twice. > y length(y) [1] 0 > for (i in 1:length(y)) { print(“y”)} [1] “y” [1] “y” > for (i in 1:seq(along=y)) { print(“y”)} Error in 1:seq(along = y) : argument of length…