background preloader

Knitr: Elegant, flexible and fast dynamic report generation with R

Knitr: Elegant, flexible and fast dynamic report generation with R
Overview The knitr package was designed to be a transparent engine for dynamic report generation with R, solve some long-standing problems in Sweave, and combine features in other add-on packages into one package (knitr ≈ Sweave + cacheSweave + pgfSweave + weaver + animation::saveLatex + R2HTML::RweaveHTML + highlight::HighlightWeaveLatex + 0.2 * brew + 0.1 * SweaveListingUtils + more). This package is developed on GitHub; for installation instructions and FAQ’s, see README. This website serves as the full documentation of knitr, and you can find the main manual, the graphics manual and other demos / examples here. For a more organized reference, see the knitr book. Motivation One of the difficulties with extending Sweave is we have to copy a large amount of code from the utils package (the file SweaveDrivers.R has more than 700 lines of R code), and this is what the two packages mentioned above have done. Features Acknowledgements Misc

Related:  RStudio-PackagesREducación - investigacionR

Packrat: Reproducible package management for R Packrat is a dependency management system for R. R package dependencies can be frustrating. Have you ever had to use trial-and-error to figure out what R packages you need to install to make someone else’s code work–and then been left with those packages globally installed forever, because now you’re not sure whether you need them? Have you ever updated a package to get code in one of your projects to work, only to find that the updated package makes code in another project stop working? We built packrat to solve these problems. R: Estimate Spectral Density of an Irregularly Sampled Time... Description The most commonly used method of computing the spectrum on unevenly spaced time series is periodogram analysis, see Lomb (1975) and Scargle (1982). The Lomb-Scargle method for unevenly spaced data is known to be a powerful tool to find, and test significance of, weak perriodic signals. The Lomb-Scargle periodogram possesses the same statistical properties of standard power spectra.

A GUI for R - Deducer Manual An R Graphical User Interface (GUI) for Everyone Deducer is designed to be a free easy to use alternative to proprietary data analysis software such as SPSS, JMP, and Minitab. It has a menu system to do common data manipulation and analysis tasks, and an excel-like spreadsheet in which to view and edit data frames. The goal of the project is two fold. Introduction to stringr Strings are not glamorous, high-profile components of R, but they do play a big role in many data cleaning and preparations tasks. R provides a solid set of string operations, but because they have grown organically over time, they can be inconsistent and a little hard to learn. Additionally, they lag behind the string operations in other programming languages, so that some things that are easy to do in languages like Ruby or Python are rather hard to do in R. The stringr package aims to remedy these problems by providing a clean, modern interface to common string operations. More concretely, stringr:

Lomb-Scargle periodogram for unevenly sampled time series In the natural sciences, it is common to have incomplete or unevenly sampled time series for a given variable. Determining cycles in such series is not directly possible with methods such as Fast Fourier Transform (FFT) and may require some degree of interpolation to fill in gaps. An alternative is the Lomb-Scargle method (or least-squares spectral analysis, LSSA), which estimates a frequency spectrum based on a least squares fit of sinusoid. R Statistical Programming Language Since R is freely available there is quite a bit of educational material available for free as well. While there are dozens online, not all are worth your time. You'll be safe with any (or all) of these.

Leaflet for R - Introduction Leaflet is one of the most popular open-source JavaScript libraries for interactive maps. It’s used by websites ranging from The New York Times and The Washington Post to GitHub and Flickr, as well as GIS specialists like OpenStreetMap, Mapbox, and CartoDB. This R package makes it easy to integrate and control Leaflet maps in R. Features Interactive panning/zoomingCompose maps using arbitrary combinations of: Map tilesMarkersPolygonsLinesPopupsGeoJSONCreate maps right from the R console or RStudioEmbed maps in knitr/R Markdown documents and Shiny appsEasily render Spatial objects from the sp package, or data frames with latitude/longitude columnsUse map bounds and mouse events to drive Shiny logic ggExtra: R package for adding marginal histograms to ggplot2 My first CRAN package, ggExtra, contains several functions to enhance ggplot2, with the most important one being ggExtra::ggMarginal() - a function that finally allows easily adding marginal density plots or histograms to scatterplots. Availability You can read the full README describing the functionality in detail or browse the source code on GitHub.

The R programming language for programmers coming from other programming languages IntroductionAssignment and underscoreVariable name gotchasVectorsSequencesTypesBoolean operatorsListsMatricesMissing values and NaNsCommentsFunctionsScopeMisc.Other resources Ukrainian translation Other languages: Powered by Introduction to roxygen2 Documentation is one of the most important aspects of good code. Without it, users won’t know how to use your package, and are unlikely to do so. Documentation is also useful for you in the future (so you remember what the heck you were thinking!), and for other developers working on your package. The goal of roxygen2 is to make documenting your code as easy as possible.

Computing and visualizing PCA in R Following my introduction to PCA, I will demonstrate how to apply and visualize PCA in R. There are many packages and functions that can apply PCA in R. In this post I will use the function prcomp from the stats package. I will also show how to visualize PCA in R using Base R graphics. R Commander John Fox and Milan Bouchet-Valat Please Read the Rcmdr Installation Notes (click on the image for a larger view) For more details, see my paper on the R Commander in the Journal of Statistical Software (which is somewhat out of date) and the introductory manual distributed with the package (accessible via the Help -> Introduction to the R Commander menu). The R-Commander GUI consists of a window containing several menus, buttons, and information fields. (The menu tree, etc., are shown below.)

Quick list of useful R packages Many useful R function come in packages, free libraries of code written by R's active user community. To install an R package, open an R session and type at the command line install.packages("<the package's name>") R will download the package from CRAN, so you'll need to be connected to the internet. Once you have a package installed, you can make its contents available to use in your current R session by running