Blog

  • list to matrix in R matrix(unlist(l …

    list to matrix in R

    matrix(unlist(list.data), nrow=num.row, byrow=TRUE)
    

    To convert list of list to matrix,

    do.call(rbind, sapply(list.data, unlist))
    
  • Getting names while applying sapply or l …

    Getting names while applying sapply or lapply in R.
    sapply or lapply extract the element without the row name.
    So this code does not work.

    par(mfrow = c(4,4))
    sapply(names(score.avg)
           , function(x) {
               plot(x
                    , type = 'l'
                  );
               title(main=names(x))      
               })
    

    In order to use the row names while applying sapply or apply,
    pass the names of the list to a function and call the values using the names.

    par(mfrow = c(4,4))
    sapply( http://polo5167.com/2017//08//05//intervention-a-la-prison-du-pontet-quartier-des-mineurs/ names(score.avg)
           , function(x) {
               xlength <- length(score.avg[[x]]);         
               plot(-499:(xlength-499-1),  visitez ce site ici score.avg[[x]]
                    , type = 'l'
                    , xlab='Distance from TSS', ylab='score'
                 #   , xlim=c(-100,100)
                  );
               title(main=x, cex.main=0.85);
               })
    
  • Use cex.main or cex.sub to change the si …

    Use cex.main or cex.sub to change the size of the title or subtitle in R

    title(main="Main title", cex.main=0.85)
    
  • Oh, Word. It appears “It just works.” …

    Oh, Word. It appears “It just works.” then betray me at the very last moment.

    The cross-reference and Track Changes do not get along well. I figured out that the numbering may not be correct/updated till accept/reject all changes. If you want to keep the previous changes, you are in trouble. Track Changes seems to be meant to track changes ‘once’.

    What is Track Changes in Word?
    http://www.shaunakelly.com/word/sharing/howtrackchangesworks.html

    If you want to keep track the history of the changes, this plugin may help.

    Version control plugin for Word
    http://autohistory.codeplex.com/releases/view/21671

    p.s. The numbering and formatting of the citations does not seem to work correctly. I just don’t have a gut to touch my proposal to figure out what is wrong. It will be easier to go back to LaTeX.

  • A little utility to open a terminal at a …

    A little utility to open a terminal at a folder in Nautilus

    Install nautilus-open-terminal.

    http://ubuntu-tutorials.com/2007/05/13/nautilus-open-terminal-terminal-quick-launch/

  • Bibliography style repository with previ …

    Bibliography style repository with preview

    This site has collection of over 1000 citation styles (over 300 unique styles) that can be used in Zotero, Mendeley, or Papers.
    The great thing about this site is the styles can be searched by fields and format such as biology and author-date.
    Unfortunately, I haven’t found the way to use it with LaTeX, yet.

    http://www.zotero.org/styles

  • Connecting PostgreSQL from R using RdbiP …

    Connecting PostgreSQL from R using RdbiPgSQL

    library(RdbiPgSQL)
    conn <- dbConnect(PgSQL(), host="localhost", dbname="my_database", user="my_user", password="my_secret_password")
    res <- dbSendQuery(conn, "select * from prices where item_id = 29")
    mydata <- dbGetResult(res)
    ...
    dbDisconnect(conn)
    
  • Usage of perlpod Suggested by Damian Co …

    Usage of perlpod
    Suggested by Damian Conway in Perl Best Practices.

    Name
    Usage
    Description
    Required arguments
    Options
    Exit status
    Diagnostics
    Configuration
    Dependencies
    Incompatibilities
    Bugs and limitations
    Author
    License and copyright
    Disclaimer of warranty
    
  • gdb tutorial http://www.unknownroad.c …

    gdb tutorial

    http://www.unknownroad.com/rtfm/gdbtut/gdbtoc.html

  • Setting the width of a column to make th …

    Setting the width of a column to make the text wrapped in LaTeX.

    \begin{center}
        \begin{tabular}{ | l | l | l | p{5cm} |}
        \hline
        Day & Min Temp & Max Temp & Summary \\ \hline
        Monday & 11C & 22C & A clear day with lots of sunshine.  
        However, the strong breeze will bring down the temperatures. \\ \hline
        Tuesday & 9C & 19C & Cloudy with rain, across many northern regions. Clear spells
        across most of Scotland and Northern Ireland,
        but rain reaching the far northwest. \\ \hline
        Wednesday & 10C & 21C & Rain will still linger for the morning.
        Conditions will improve by early afternoon and continue
        throughout the evening. \\
        \hline
        \end{tabular}
    \end{center}
    

    from http://en.wikibooks.org/wiki/LaTeX/Tables#Text_wrapping_in_tables