-
Array construction in R, Perl, and Python
sexe femme sur saint priest Array construction in R, Perl, and Python R: data Perl: @data = (1, 2, 3) @data[2..3] %hash = (‘a’ =>; ‘b’) $hash{a} Python: data = [1, 2, 3, ‘a’, ‘b’, ‘c’] data[2:3] tuple = (1, 2, 3, ‘a’, ‘b’, https://buycbdproducts.com # immutable dict = {‘a’: ‘America’, ‘c’: ‘Canada’} dict[‘a’]
-
Debugging R scripts with command line arguments 1…
rencontre célibataire chalon sur saône Debugging R scripts with command line arguments. 1. Break up the script into two parts: one for reading the arguments, another one for the analysis. 2. Run R with *-args option. It enters the interactive R session. Example. R –args -p ../../input/M00724-foxa1.mat -s ../../input/mouse_promoter_seqs_EPD.fasta -c 0.55 -o testing_ 3. Source the the file reading https://buycbdproducts.com…
-
showMethods and selectMethod to find the functions and…
showMethods() and selectMethod() to find the functions and sources of S3 object in R. http://tolstoy.newcastle.edu.au/R/help/05/09/12506.html
-
Shuffle sequences in DNASequenceSet lapply or sapply return…
Shuffle sequences in DNASequenceSet. lapply() or sapply() return list. endoapply() returns the same data class, DNASequenceSet. It is way slower, though. shuffled.seqs
-
Turn numeric into categorical data AdultUCI age…
Turn numeric into categorical data. AdultUCI[[“age”]]
-
Change the order of discrete axis Generate a…
Change the order of discrete axis. Generate a factor with reversed levels or use a new ggplot2 option. Examples. df$X1 = with(df, factor(X1, levels = rev(levels(X1)))) http://stackoverflow.com/questions/7418191/sorting-dotplot-factor-axis-in-ggplot Reverse the order of a discrete-valued axis Get the levels of the factor flevels
-
Nested Tmux command Screen vim + gnu screen…
Nested Tmux command. Screen (vim + gnu screen/tmux) is a great tool for vim that split the pane and send vim buffer to another pane. (Link: http://www.vim.org/scripts/script.php?script_id=2711) However, when used the plugin in tmux session, the tmux sessions are nested then the command is not working properly. Then setting a send prefix in .tmuxrc will…
-
Slopegraph in R Slopegraph shows the change of…
Slopegraph in R. Slopegraph shows the change of the quantity or rank. Beautiful slopegraph example. http://www.drewconway.com/zia/ Theory of slopegraph. http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0003nk An R and ggplot2 code example of slopegraph https://github.com/leondutoit/slopegraph/blob/master/slopegraph. R Example code. Generate sample data a
-
R function matching a function argument against candidate…
R function matching a function argument against candidate values. match.arg(arg, choices, several.ok = FALSE) arg = match.arg(arg)
-
How to rank data in R rank a…
How to rank data in R. rank(a) Then how to rank the data in reverse order? rand(-a)