cliquez ici Resource for programming in R
http://zoonek2.free.fr/UNIX/48_R/02.html
Blog
-
Resource for programming in R http://zo …
-
Smoothing or moving average use ksmooth …
Smoothing or moving average
use ksmooth()
when kernel is “box”, it is the same as moving average by filter() except that ksmooth() can handle the edges better.
Example
ksmooth(data, kernel = “box”, bandwidth = 3) -
Great illustration of plot and margin in …
Great illustration of plot and margin in R
http://research.stowers-institute.org/efg/R/Graphics/Basics/mar-oma/index.htm -
2nd axis in R Use axis. side is where t …
2nd axis in R
Use axis. side is where the second axis goes. Side 3 is the top x-axis. Side 4 is the right y-axis. With put the 1st axis thick for the at and lab is for the text.
Here is the example.
axis(side=3, at = c(0.1, 0.2, 0.3, 0.4, 0.5), lab = c(10, 5, 3, 2.5, 2)) -
When the forward search of readline is n …
When the forward search of readline is not working.
$ stty -a
$ stty -ixon -
yank and put (copy and paste) between tw …
yank and put (copy and paste) between two gVim
Use * instead of +
e.g.
yank: *y
cut: *x
put: “*gPOn the other hand, use + to copy and paste to other programs
yank: +y
cut: +x
paste: “+gP -
Add comments on a mysql table CREATE …
Add comments on a mysql table
CREATE TABLE testing (
name VARCHAR(5)
) COMMENT=’this is testing’;
How to view the comment:Or add comments after making a table by
ALTER TABLE tablename COMMENT = ‘new updated comment’;To see the comments
SHOW CREATE TABLE testing;
-
Setting a scale in ggplot2 scale_y_cont …
Setting a scale in ggplot2
scale_y_continuous(limits = c(10, 200)) -
Moving average in R Median: runmed() M …
Moving average in R
Median: runmed()
Mean: filter()ex)
runmed(data, 3)
filter(data, rep(1/3, 3)) -
Save ggplot in pdf Use dev.copy2pdf(fil …
Save ggplot in pdf
Use dev.copy2pdf(file=”plot.pdf”)Example)
plotA <- ggplot() + geom_line(data=nucleosome.mono.colsum, aes(seq, y=A, colour="A") ) plotT <- ggplot() + geom_line(data=nucleosome.mono.colsum, aes(seq, y=T, colour="T") ) arranged.plot <- grid.arrange(plotA, plotT, nrow=2) dev.copy2pdf(file="arranged.plot") dev.off()