PROGRAMMING TOOLS: ADVENTURES with R a Guide to the Popular, Free Statistics and Visualization Software That Gives Scientists Control of Their Own Data Analysis

Total Page:16

File Type:pdf, Size:1020Kb

PROGRAMMING TOOLS: ADVENTURES with R a Guide to the Popular, Free Statistics and Visualization Software That Gives Scientists Control of Their Own Data Analysis TOOLBOX PROGRAMMING TOOLS: ADVENTURES WITH R A guide to the popular, free statistics and visualization software that gives scientists control of their own data analysis. ILLUSTRATION BY THE PROJECT TWINS THE PROJECT BY ILLUSTRATION BY SYLVIA TIPPMANN with her data-processing demands. Besides being free, R is popular partly because With the results of her first genomic sequenc- it presents different faces to different users. It is, or years, geneticist Helene Royo used ing experiments in hand at the start of a new first and foremost, a programming language — commercial software to analyse her work. postdoc, Royo had a choice: pass the sequences requiring input through a command line, which She would extract DNA from the devel- over to the experts or learn to analyse the data may seem forbidding to non-coders. But begin- Foping sperm cells of mice, send it for analysis herself. She took the plunge, and began learning ners can surf over the complexities and call up and then fire up a package called GeneSpring how to parse data in the free, open-source soft- preset software packages, which come ready- to study the results. “As a scientist, I wanted to ware package R. It helped that the centre she had made with commands for statistical analysis understand everything I was doing,” she says. joined — the Friedrich Miescher Institute for and data visualization. These packages create a “But this kind of analysis didn’t allow that: I just Biomedical Research in Basel, Switzerland — welcoming middle ground between the com- pressed buttons and got answers.” And as Royo’s ran regular courses on the software. But she was fort of commercial ‘black-box’ solutions and the studies comparing genetic activity on different also following a wider trend: for many academ- expert world of code. “R made it very easy,” says chromosomes became more involved, she real- ics seeking to wean themselves off commercial Rojo. “It did everything for me.” ized that the commercial tool could not keep up software, R is the data-analysis tool of choice. That, indeed, is what R’s developers 1 JANUARY 2015 | VOL 517 | NATURE | 109 © 2015 Macmillan Publishers Limited. All rights reserved TOOLBOX intended when they designed it in the 1990s. bioinformatics group, she took about half a year Ross Ihaka and Robert Gentleman, statisticians A RISING TIDE OF R to work on R and Bioconductor. But there are at the University of Auckland in New Zealand, An increasing proportion of research articles plentiful chances to learn, says Karthik Ram, had an interest in computing but lacked practi- explicitly reference R or an R package. an ecologist at the Berkeley Institute for Data cal software for their needs. So they developed 4 Science in California who founded rOpenSci, a programming language with which they Agricultural and biological sciences an initiative that helps scientists to adopt and Biochemistry, genetics could perform data analysis themselves. R got and molecular biology develop R (see ‘An R starter kit’). He and his its name in part from its developers’ initials, 3 Earth and planetary sciences colleagues teach free courses that do not require although it was also a reference to the most Environmental science existing programming skills and are targeted widely used coding language at the time, S. Immunology and microbiology towards scientists’ specific problems. Mathematics 2 In the early days of the World Wide Web, R Neuroscience One researcher who took that training is quickly attracted interest from scientists around Megan Jennings, an ecologist at San Diego the globe who needed statistical software and State University in California. She tracks bob- Articles citing R (%) were willing to contribute ideas. Gentleman and 1 cats, mountain lions and other wild animals, SCOPUS DATABASE TIPPMANN/SOURCE: ELSEVIER SYLVIA Ihaka decided to make their source code acces- to understand their movements. Armed with sible to everybody, and coding-literate scientists more than 400,000 time-stamped photos to quickly developed packages of pre-programmed 0 which she had appended species names — taken routines and commands for particular fields. “I 2000 2005 2010 from 36 cameras running for almost a year — can write software that would be good for some- Jennings wanted to follow particular species at body doing astronomy,” says Gentleman, “but it’s particular times of year. At first, she manually a lot better if someone doing astronomy writes packages, and the first citations of the ‘R Pro- selected the photos she wanted and fed them software for other people doing astronomy.” ject’ appeared. Today, nearly 6,000 packages into a black-box program called PRESENCE. exist for all kinds of specialized purposes. But with Ram’s help, she is creating an R package MATHEMATICAL SOLUTIONS They allow scientists to compare a human and that reads in the tagged photos, cleans them up Karline Soetaert, an oceanographer at the a Neanderthal genome (using Bioconductor: and then sends customized subsets of the data Royal Netherlands Institute for Sea Research in go.nature.com/s7mq39); to model population to a pre-existing modelling package in R. “What Yerseke, took up that idea when, in 2008, she growth (IPMpack: go.nature.com/cyhons); took me one hour to do manually, I will now be wanted to check the health of zooplankton in predict equity prices (quantmod: go.nature. able to do in five minutes,” Jennings says. the estuary of the river Scheldt. Soetaert wanted com/jxqasm); and visualize the results in pol- One of the greatest perks of R is its online to calculate how fast zooplankton were dying, ished graphics (ggplot2: ggplot2.org) in a few support. Discussion forums about R-related using measurements along the river, but R was lines of code. Experts can use R to write up topics outstrip online questions about any not equipped for that. To tackle the problem, she manuscripts, embedding raw code in them commercial statistics software says Muenchen. worked with two ecologists to develop deSolve to be run by the reader (knitr: http://yihui. “It’s common to see someone post a question — the first package written in R to solve differ- name/knitr). Nearly 1 in 100 scholarly articles and the person who developed the package ential equations. “Other software can do that, indexed in Elsevier’s Scopus database last year answer within half an hour,” he says. This rapid but it is expensive and closed source,” she notes. cites R or one of its packages — and in agricul- response is key for scientists in basic research. Now deSolve is used by epidemiologists model- tural and environmental sciences, the share is “I can find an answer to almost any question ling infectious diseases, geneticists working on even higher (see ‘A rising tide of R’). online,” says Royo. She can confidently do gene-regulatory networks and drug develop- most of her day-to-day data analysis herself, ers working on pharmaco kinetics (how com- STATISTICAL SUCCESS and she helps out less proficient colleagues. pounds behave in living organisms). For many users, R’s quality as statistics software Still, “I google things every day”, she adds. By 2003, 10 years after R’s first release, stands out. The tool is on a par with commer- Learning R, says Royo, has not only taught her scientists had developed more than 200 cial packages such as SPSS and SAS, says Rob- coding skills, but has also made her more criti- ert Muenchen, a statistician at the University of cal about other scientists’ analyses. Tennessee in Knoxville who analyses the popu- Not every scientist is enthusiastic about learn- TUTORIALS larity of software used in statistical computing. ing the necessary programming — even though, In the past decade, R has caught up with and says Ram, R is less intimidating than languages An R starter kit overtaken the market leaders. “Most likely, R such as Python (let alone Perl or C). “There are became the top statistics package used during going to be far more scientists that will be com- ● Install R at the Comprehensive R the summer of this year,” he says. fortable with click-and-drop interfaces than will Archive Network: http://cran.r-project. In genomics and molecular biology, a soft- ever learn to program at any time,” Muenchen org. This also provides an introduction to ware project called Bioconductor was devel- says. Geneticist Rabih Murr, for example, took the system: go.nature.com/jh9jb8. oped on the back of R. It helps scientists to the same R course as Royo when he was a ● Many researchers recommend using a process and compare huge numbers of genetic postdoc, but he did not invest as much time in (free) powerful interface called RStudio: sequences, to query results against databases practising. To get started and develop research- www.rstudio.com such as Gene Expression Omnibus and to specific skills in R definitely requires a commit- ● Among many online tutorials are upload data to the databases . It includes almost ment: “It’s a matter of priorities,” he says. But those provided by DataCamp (go. 1,000 packages, some of which help to link the after becoming a lab head at the University of nature.com/qndp6w), rOpenSci millions of DNA snippets from next-generation Geneva in Switzerland this year, he is planning (ropensci.org), Software Carpentry sequencing experiments to annotated genes. to hire someone with R experience. (go.nature.com/wg3s9u) and R-bloggers For her dive into R, Like any other skill, learning R cannot (www.r-bloggers.com). Royo had intensive train- NATURE.COM be done overnight. But Jennings says that ● For a sample list of R packages in ing: under the supervi- For more on scientific it is worth it.
Recommended publications
  • Navigating the R Package Universe by Julia Silge, John C
    CONTRIBUTED RESEARCH ARTICLES 558 Navigating the R Package Universe by Julia Silge, John C. Nash, and Spencer Graves Abstract Today, the enormous number of contributed packages available to R users outstrips any given user’s ability to understand how these packages work, their relative merits, or how they are related to each other. We organized a plenary session at useR!2017 in Brussels for the R community to think through these issues and ways forward. This session considered three key points of discussion. Users can navigate the universe of R packages with (1) capabilities for directly searching for R packages, (2) guidance for which packages to use, e.g., from CRAN Task Views and other sources, and (3) access to common interfaces for alternative approaches to essentially the same problem. Introduction As of our writing, there are over 13,000 packages on CRAN. R users must approach this abundance of packages with effective strategies to find what they need and choose which packages to invest time in learning how to use. At useR!2017 in Brussels, we organized a plenary session on this issue, with three themes: search, guidance, and unification. Here, we summarize these important themes, the discussion in our community both at useR!2017 and in the intervening months, and where we can go from here. Users need options to search R packages, perhaps the content of DESCRIPTION files, documenta- tion files, or other components of R packages. One author (SG) has worked on the issue of searching for R functions from within R itself in the sos package (Graves et al., 2017).
    [Show full text]
  • A Practical Guide for Improving Transparency and Reproducibility in Neuroimaging Research Krzysztof J
    bioRxiv preprint first posted online Feb. 12, 2016; doi: http://dx.doi.org/10.1101/039354. The copyright holder for this preprint (which was not peer-reviewed) is the author/funder. It is made available under a CC-BY 4.0 International license. A practical guide for improving transparency and reproducibility in neuroimaging research Krzysztof J. Gorgolewski and Russell A. Poldrack Department of Psychology, Stanford University Abstract Recent years have seen an increase in alarming signals regarding the lack of replicability in neuroscience, psychology, and other related fields. To avoid a widespread crisis in neuroimaging research and consequent loss of credibility in the public eye, we need to improve how we do science. This article aims to be a practical guide for researchers at any stage of their careers that will help them make their research more reproducible and transparent while minimizing the additional effort that this might require. The guide covers three major topics in open science (data, code, and publications) and offers practical advice as well as highlighting advantages of adopting more open research practices that go beyond improved transparency and reproducibility. Introduction The question of how the brain creates the mind has captivated humankind for thousands of years. With recent advances in human in vivo brain imaging, we how have effective tools to ​ ​ peek into biological underpinnings of mind and behavior. Even though we are no longer constrained just to philosophical thought experiments and behavioral observations (which undoubtedly are extremely useful), the question at hand has not gotten any easier. These powerful new tools have largely demonstrated just how complex the biological bases of behavior actually are.
    [Show full text]
  • Introduction to Ggplot2
    Introduction to ggplot2 Dawn Koffman Office of Population Research Princeton University January 2014 1 Part 1: Concepts and Terminology 2 R Package: ggplot2 Used to produce statistical graphics, author = Hadley Wickham "attempt to take the good things about base and lattice graphics and improve on them with a strong, underlying model " based on The Grammar of Graphics by Leland Wilkinson, 2005 "... describes the meaning of what we do when we construct statistical graphics ... More than a taxonomy ... Computational system based on the underlying mathematics of representing statistical functions of data." - does not limit developer to a set of pre-specified graphics adds some concepts to grammar which allow it to work well with R 3 qplot() ggplot2 provides two ways to produce plot objects: qplot() # quick plot – not covered in this workshop uses some concepts of The Grammar of Graphics, but doesn’t provide full capability and designed to be very similar to plot() and simple to use may make it easy to produce basic graphs but may delay understanding philosophy of ggplot2 ggplot() # grammar of graphics plot – focus of this workshop provides fuller implementation of The Grammar of Graphics may have steeper learning curve but allows much more flexibility when building graphs 4 Grammar Defines Components of Graphics data: in ggplot2, data must be stored as an R data frame coordinate system: describes 2-D space that data is projected onto - for example, Cartesian coordinates, polar coordinates, map projections, ... geoms: describe type of geometric objects that represent data - for example, points, lines, polygons, ... aesthetics: describe visual characteristics that represent data - for example, position, size, color, shape, transparency, fill scales: for each aesthetic, describe how visual characteristic is converted to display values - for example, log scales, color scales, size scales, shape scales, ..
    [Show full text]
  • Sharing and Organizing Research Products As R Packages Matti Vuorre1 & Matthew J
    Sharing and organizing research products as R packages Matti Vuorre1 & Matthew J. C. Crump2 1 Oxford Internet Institute, University of Oxford, United Kingdom 2 Department of Psychology, Brooklyn College of CUNY, New York USA A consensus on the importance of open data and reproducible code is emerging. How should data and code be shared to maximize the key desiderata of reproducibility, permanence, and accessibility? Research assets should be stored persistently in formats that are not software restrictive, and documented so that others can reproduce and extend the required computations. The sharing method should be easy to adopt by already busy researchers. We suggest the R package standard as a solution for creating, curating, and communicating research assets. The R package standard, with extensions discussed herein, provides a format for assets and metadata that satisfies the above desiderata, facilitates reproducibility, open access, and sharing of materials through online platforms like GitHub and Open Science Framework. We discuss a stack of R resources that help users create reproducible collections of research assets, from experiments to manuscripts, in the RStudio interface. We created an R package, vertical, to help researchers incorporate these tools into their workflows, and discuss its functionality at length in an online supplement. Together, these tools may increase the reproducibility and openness of psychological science. Keywords: reproducibility; research methods; R; open data; open science Word count: 5155 Introduction package standard, with additional R authoring tools, provides a robust framework for organizing and sharing reproducible Research projects produce experiments, data, analyses, research products. manuscripts, posters, slides, stimuli and materials, computa- Some advances in data-sharing standards have emerged: It tional models, and more.
    [Show full text]
  • Reproducible Reports with Knitr and R Markdown
    Reproducible Reports with knitr and R Markdown https://dl.dropboxusercontent.com/u/15335397/slides/2014-UPe... Reproducible Reports with knitr and R Markdown Yihui Xie, RStudio 11/22/2014 @ UPenn, The Warren Center 1 of 46 1/15/15 2:18 PM Reproducible Reports with knitr and R Markdown https://dl.dropboxusercontent.com/u/15335397/slides/2014-UPe... An appetizer Run the app below (your web browser may request access to your microphone). http://bit.ly/upenn-r-voice install.packages("shiny") Or just use this: https://yihui.shinyapps.io/voice/ 2/46 2 of 46 1/15/15 2:18 PM Reproducible Reports with knitr and R Markdown https://dl.dropboxusercontent.com/u/15335397/slides/2014-UPe... Overview and Introduction 3 of 46 1/15/15 2:18 PM Reproducible Reports with knitr and R Markdown https://dl.dropboxusercontent.com/u/15335397/slides/2014-UPe... I know you click, click, Ctrl+C and Ctrl+V 4/46 4 of 46 1/15/15 2:18 PM Reproducible Reports with knitr and R Markdown https://dl.dropboxusercontent.com/u/15335397/slides/2014-UPe... But imagine you hear these words after you finished a project Please do that again! (sorry we made a mistake in the data, want to change a parameter, and yada yada) http://nooooooooooooooo.com 5/46 5 of 46 1/15/15 2:18 PM Reproducible Reports with knitr and R Markdown https://dl.dropboxusercontent.com/u/15335397/slides/2014-UPe... Basic ideas of dynamic documents · code + narratives = report · i.e. computing languages + authoring languages We built a linear regression model.
    [Show full text]
  • Rkward: a Comprehensive Graphical User Interface and Integrated Development Environment for Statistical Analysis with R
    JSS Journal of Statistical Software June 2012, Volume 49, Issue 9. http://www.jstatsoft.org/ RKWard: A Comprehensive Graphical User Interface and Integrated Development Environment for Statistical Analysis with R Stefan R¨odiger Thomas Friedrichsmeier Charit´e-Universit¨atsmedizin Berlin Ruhr-University Bochum Prasenjit Kapat Meik Michalke The Ohio State University Heinrich Heine University Dusseldorf¨ Abstract R is a free open-source implementation of the S statistical computing language and programming environment. The current status of R is a command line driven interface with no advanced cross-platform graphical user interface (GUI), but it includes tools for building such. Over the past years, proprietary and non-proprietary GUI solutions have emerged, based on internal or external tool kits, with different scopes and technological concepts. For example, Rgui.exe and Rgui.app have become the de facto GUI on the Microsoft Windows and Mac OS X platforms, respectively, for most users. In this paper we discuss RKWard which aims to be both a comprehensive GUI and an integrated devel- opment environment for R. RKWard is based on the KDE software libraries. Statistical procedures and plots are implemented using an extendable plugin architecture based on ECMAScript (JavaScript), R, and XML. RKWard provides an excellent tool to manage different types of data objects; even allowing for seamless editing of certain types. The objective of RKWard is to provide a portable and extensible R interface for both basic and advanced statistical and graphical analysis, while not compromising on flexibility and modularity of the R programming environment itself. Keywords: GUI, integrated development environment, plugin, R.
    [Show full text]
  • R Markdown Cheat Sheet I
    1. Workflow R Markdown is a format for writing reproducible, dynamic reports with R. Use it to embed R code and results into slideshows, pdfs, html documents, Word files and more. To make a report: R Markdown Cheat Sheet i. Open - Open a file that ii. Write - Write content with the iii. Embed - Embed R code that iv. Render - Replace R code with its output and transform learn more at rmarkdown.rstudio.com uses the .Rmd extension. easy to use R Markdown syntax creates output to include in the report the report into a slideshow, pdf, html or ms Word file. rmarkdown 0.2.50 Updated: 8/14 A report. A report. A report. A report. A plot: A plot: A plot: A plot: Microsoft .Rmd Word ```{r} ```{r} ```{r} = = hist(co2) hist(co2) hist(co2) ``` ``` Reveal.js ``` ioslides, Beamer 2. Open File Start by saving a text file with the extension .Rmd, or open 3. Markdown Next, write your report in plain text. Use markdown syntax to an RStudio Rmd template describe how to format text in the final report. syntax becomes • In the menu bar, click Plain text File ▶ New File ▶ R Markdown… End a line with two spaces to start a new paragraph. *italics* and _italics_ • A window will open. Select the class of output **bold** and __bold__ you would like to make with your .Rmd file superscript^2^ ~~strikethrough~~ • Select the specific type of output to make [link](www.rstudio.com) with the radio buttons (you can change this later) # Header 1 • Click OK ## Header 2 ### Header 3 #### Header 4 ##### Header 5 ###### Header 6 4.
    [Show full text]
  • R Generation [1] 25
    IN DETAIL > y <- 25 > y R generation [1] 25 14 SIGNIFICANCE August 2018 The story of a statistical programming they shared an interest in what Ihaka calls “playing academic fun language that became a subcultural and games” with statistical computing languages. phenomenon. By Nick Thieme Each had questions about programming languages they wanted to answer. In particular, both Ihaka and Gentleman shared a common knowledge of the language called eyond the age of 5, very few people would profess “Scheme”, and both found the language useful in a variety to have a favourite letter. But if you have ever been of ways. Scheme, however, was unwieldy to type and lacked to a statistics or data science conference, you may desired functionality. Again, convenience brought good have seen more than a few grown adults wearing fortune. Each was familiar with another language, called “S”, Bbadges or stickers with the phrase “I love R!”. and S provided the kind of syntax they wanted. With no blend To these proud badge-wearers, R is much more than the of the two languages commercially available, Gentleman eighteenth letter of the modern English alphabet. The R suggested building something themselves. they love is a programming language that provides a robust Around that time, the University of Auckland needed environment for tabulating, analysing and visualising data, one a programming language to use in its undergraduate statistics powered by a community of millions of users collaborating courses as the school’s current tool had reached the end of its in ways large and small to make statistical computing more useful life.
    [Show full text]
  • HGC: a Fast Hierarchical Graph-Based Clustering Method
    Package ‘HGC’ September 27, 2021 Type Package Title A fast hierarchical graph-based clustering method Version 1.1.3 Description HGC (short for Hierarchical Graph-based Clustering) is an R package for conducting hierarchical clustering on large-scale single-cell RNA-seq (scRNA-seq) data. The key idea is to construct a dendrogram of cells on their shared nearest neighbor (SNN) graph. HGC provides functions for building graphs and for conducting hierarchical clustering on the graph. The users with old R version could visit https://github.com/XuegongLab/HGC/tree/HGC4oldRVersion to get HGC package built for R 3.6. License GPL-3 Encoding UTF-8 SystemRequirements C++11 Depends R (>= 4.1.0) Imports Rcpp (>= 1.0.0), RcppEigen(>= 0.3.2.0), Matrix, RANN, ape, dendextend, ggplot2, mclust, patchwork, dplyr, grDevices, methods, stats LinkingTo Rcpp, RcppEigen Suggests BiocStyle, rmarkdown, knitr, testthat (>= 3.0.0) VignetteBuilder knitr biocViews SingleCell, Software, Clustering, RNASeq, GraphAndNetwork, DNASeq Config/testthat/edition 3 NeedsCompilation yes git_url https://git.bioconductor.org/packages/HGC git_branch master git_last_commit 61622e7 git_last_commit_date 2021-07-06 Date/Publication 2021-09-27 1 2 CKNN.Construction Author Zou Ziheng [aut], Hua Kui [aut], XGlab [cre, cph] Maintainer XGlab <[email protected]> R topics documented: CKNN.Construction . .2 FindClusteringTree . .3 HGC.dendrogram . .4 HGC.parameter . .5 HGC.PlotARIs . .6 HGC.PlotDendrogram . .7 HGC.PlotParameter . .8 KNN.Construction . .9 MST.Construction . 10 PMST.Construction . 10 Pollen . 11 RNN.Construction . 12 SNN.Construction . 12 Index 14 CKNN.Construction Building Unweighted Continuous K Nearest Neighbor Graph Description This function builds a Continuous K Nearest Neighbor (CKNN) graph in the input feature space using Euclidean distance metric.
    [Show full text]
  • Rmarkdown : : CHEAT SHEET RENDERED OUTPUT File Path to Output Document SOURCE EDITOR What Is Rmarkdown? 1
    rmarkdown : : CHEAT SHEET RENDERED OUTPUT file path to output document SOURCE EDITOR What is rmarkdown? 1. New File Write with 5. Save and Render 6. Share find in document .Rmd files · Develop your code and publish to Markdown ideas side-by-side in a single rpubs.com, document. Run code as individual shinyapps.io, The syntax on the lef renders as the output on the right. chunks or as an entire document. set insert go to run code RStudio Connect Rmd preview code code chunk(s) Plain text. Plain text. Dynamic Documents · Knit together location chunk chunk show End a line with two spaces to End a line with two spaces to plots, tables, and results with outline start a new paragraph. start a new paragraph. narrative text. Render to a variety of 4. Set Output Format(s) Also end with a backslash\ Also end with a backslash formats like HTML, PDF, MS Word, or and Options reload document to make a new line. to make a new line. MS Powerpoint. *italics* and **bold** italics and bold Reproducible Research · Upload, link superscript^2^/subscript~2~ superscript2/subscript2 to, or attach your report to share. ~~strikethrough~~ strikethrough Anyone can read or run your code to 3. Write Text run all escaped: \* \_ \\ escaped: * _ \ reproduce your work. previous modify chunks endash: --, emdash: --- endash: –, emdash: — chunk run options current # Header 1 Header 1 chunk ## Header 2 Workflow ... Header 2 2. Embed Code ... 11. Open a new .Rmd file in the RStudio IDE by ###### Header 6 Header 6 going to File > New File > R Markdown.
    [Show full text]
  • Statistics with Free and Open-Source Software
    Free and Open-Source Software • the four essential freedoms according to the FSF: • to run the program as you wish, for any purpose • to study how the program works, and change it so it does Statistics with Free and your computing as you wish Open-Source Software • to redistribute copies so you can help your neighbor • to distribute copies of your modified versions to others • access to the source code is a precondition for this Wolfgang Viechtbauer • think of ‘free’ as in ‘free speech’, not as in ‘free beer’ Maastricht University http://www.wvbauer.com • maybe the better term is: ‘libre’ 1 2 General Purpose Statistical Software Popularity of Statistical Software • proprietary (the big ones): SPSS, SAS/JMP, • difficult to define/measure (job ads, articles, Stata, Statistica, Minitab, MATLAB, Excel, … books, blogs/posts, surveys, forum activity, …) • FOSS (a selection): R, Python (NumPy/SciPy, • maybe the most comprehensive comparison: statsmodels, pandas, …), PSPP, SOFA, Octave, http://r4stats.com/articles/popularity/ LibreOffice Calc, Julia, … • for programming languages in general: TIOBE Index, PYPL, GitHut, Language Popularity Index, RedMonk Rankings, IEEE Spectrum, … • note that users of certain software may be are heavily biased in their opinion 3 4 5 6 1 7 8 What is R? History of S and R • R is a system for data manipulation, statistical • … it began May 5, 1976 at: and numerical analysis, and graphical display • simply put: a statistical programming language • freely available under the GNU General Public License (GPL) → open-source
    [Show full text]
  • Writing Reproducible Reports Knitr with R Markdown
    Writing reproducible reports knitr with R Markdown Karl Broman Biostatistics & Medical Informatics, UW–Madison kbroman.org github.com/kbroman @kwbroman Course web: kbroman.org/AdvData I To estimate a p-value? I To estimate some other quantity? I To estimate power? How many simulation replicates? 2 I To estimate a p-value? I To estimate some other quantity? How many simulation replicates? I To estimate power? 2 I To estimate some other quantity? How many simulation replicates? I To estimate power? I To estimate a p-value? 2 How many simulation replicates? I To estimate power? I To estimate a p-value? I To estimate some other quantity? 2 Data analysis reports I Figures/tables + email I Static Word document I LATEX + R ! PDF I R Markdown = knitr + Markdown ! Web page 3 What if the data change? What if you used the wrong version of the data? 4 rmarkdown.rstudio.com knitr in a knutshell kbroman.org/knitr_knutshell 5 knitr in a knutshell kbroman.org/knitr_knutshell rmarkdown.rstudio.com 5 knitr code chunks Input to knitr: We see that this is an intercross with `r nind(sug)` individuals. There are `r nphe(sug)` phenotypes, and genotype data at `r totmar(sug)` markers across the `r nchr(sug)` autosomes. The genotype data is quite complete. ```{r summary_plot, fig.height=8} plot(sug) ``` Output from knitr: We see that this is an intercross with 163 individuals. There are 6 phenotypes, and genotype data at 93 markers across the 19 autosomes. The genotype data is quite complete. ```r plot(sug) ``` ![plot of chunk summary_plot](RmdFigs/summary_plot.png) 6 html <!DOCTYPE html> <html> <head> <meta charset=utf-8"/> <title>Example html file</title> </head> <body> <h1>Markdown example</h1> <p>Use a bit of <strong>bold</strong> or <em>italics</em>.
    [Show full text]