background preloader

Latex-R-Sweave

Facebook Twitter

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 library("<the package's name>") There are thousands of helpful R packages for you to use, but navigating them all can be a challenge.

To load data RMySQL, RPostgresSQL, RSQLite - If you'd like to read in data from a database, these packages are a good place to start. XLConnect, xlsx - These packages help you read and write Micorsoft Excel files from R. Foreign - Want to read a SAS data set into R? R can handle plain text files – no package required. To manipulate data tidyr - Tools for changing the layout of your data sets. To visualize data rgl - Interactive 3D visualizations with R. Templates | jekyll. Jekyll uses the Liquid templating language to process templates. All of the standard Liquid tags and filters are supported. To make common tasks easier, Jekyll even adds a few handy filters and tags of its own, all of which you can find on this page. Jekyll even lets you come up with your own tags via plugins. Filters Options for the slugify filter The slugify filter accepts an option, each specifying what to filter.

The default is default. None: no characters raw: spaces default: spaces and non-alphanumeric characters pretty: spaces and non-alphanumeric characters except for ._~! Includes If you have small page snippets that you want to include in multiple places on your site, save the snippets as include files and insert them where required, by using the include tag: {% include footer.html %} Jekyll expects all include files to be placed in an _includes directory at the root of your source directory. For more advanced information on using includes, see Includes. Code snippet highlighting. R - Figure position in markdown when converting to PDF with knitr and pandoc. The magick package: Advanced Image-Processing in R. Convert HTML/CSS to image (png, or any loseless format) in R. GitHub - bbucior/drposter: Generate Academic Posters in R Markdown based on 'reveal.js' Odeleongt/flexdashboard-poster: Minimal template for a flexdashboard poster.

Creating Scientific Posters using R, Latex, Beamer and Beamerposter | R-bloggers. A while ago I had the need to produce some posters that included lots of data (scientific style). Having recently got back into R and learning LaTex I googled for a way to do this using R. Here’s what I found and ended up with, using R, LaTex, Beamer and BeamerPoster. You can pull my beamerposter template and an example Sweave Rnw file from my Github. <img alt="beamerposter image" src="<a pearltreesdevid="PTD491" rel="nofollow" href=" class="vglnk"><span pearltreesdevid="PTD492">https</span><span pearltreesdevid="PTD494">://</span><span pearltreesdevid="PTD496">i1</span><span pearltreesdevid="PTD498">.

</span><span pearltreesdevid="PTD500">wp</span><span pearltreesdevid="PTD502">. </span><span pearltreesdevid="PTD504">com</span><span pearltreesdevid="PTD506">/</span><span pearltreesdevid="PTD508">www</span><span pearltreesdevid="PTD510">. Related September 18, 2012 In "R bloggers" November 23, 2011. Writing a MS-Word document using R (with as little overhead as possible) | R-bloggers. The problem: producing a Word (.docx) file of a statistical report created in R, with as little overhead as possible.The solution: combining R+knitr+rmarkdown+pander+pandoc (it is easier than it is spelled). If you get what this post is about, just jump to the “Solution: the workflow” section. Preface: why is this a problem (/still) Before turning to the solution, let’s address two preliminary questions: Q: Why is it important to be able to create report in Word from R?

A: Because many researchers we may work with are used to working with Word for editing their text, tracking changes and merging edits between different authors, and copy-pasting text/tables/images from various sources. This means that a report produced as a PDF file is less useful for collaborating with less-tech-savvy researchers (copying text or tables from PDF is not fun).

Even exchanging HTML files may appear somewhat awkward to fellow researchers.Q: But wasn’t this problem solved already? A: Yes and no. Sources/links. R Markdown: How to insert page breaks in a MS Word document | DataScience+ RStudio offers the opportunity to build MS Word documents from R Markdown files (.Rmd). However, since formatting options in Markdown are very limited, there is no ‘native’ Markdown code to insert page breaks in the final MS Word output file. In this blog post I explain, how to define page breaks in the RMarkdown document that will be kept in the final MS Word document (.docx). My post is based on Richard Layton’s article Happy collaboration with Rmd to docx which explains how to create a MS Word .docx template in order to modify the document design of a MS Word file created from a .Rmd-file in RStudio. The MS Word template In the first step, we create a MS Word template called ‘mystyles.docx’ (How to). Modify style ‘Heading 5’ In the next step, we modify a predefined style.

To modify this style, we select the ‘Home‘ ribbon tab and click the Styles window launcher in the Styles group (lower right corner, highlighted with red circle). We select ‘Heading 5’ in the Word document. Download. R Markdown: How to format tables and figures in .docx files | R-bloggers. In research, we usually publish the most important findings in tables and figures. When writing research papers using Rmarkdown (*.Rmd), we have several options to format the output of the final MS Word document (.docx).

Tables can be formated using either the knitr package’s kable() function or several functions of the pander package. Figure sizes can be determined in the chunk options, e.g. {r name_of_chunk, fig.height=8, fig.width=12}. However, options for customizing tables and figures are rather limited in Rmarkdown. The following two macros are very helpful to format drafts. The first macro called FormatTables customizes the format of all tables of the active MS Word document. The second macro called FormatFigures merely reduces the size of all figures in the active MS Word document to 45% of its original size.

Sub FormatFigures() Dim shp As InlineShape For Each shp In ActiveDocument.InlineShapes shp.ScaleHeight = 45 shp.ScaleWidth = 45 Next End Sub Related Post Related In "R bloggers" Scheduling R Markdown Reports via Email | R-bloggers. R Markdown is an amazing tool that allows you to blend bits of R code with ordinary text and produce well-formatted data analysis reports very quickly. You can export the final report in many formats like HTML, pdf or MS Words which makes it easy to share with others. And of course, you can modify or update it with fresh data very easily. I have recently been using it R Markdown for pulling data from various data source such Google Analytics API and MySQL database, perform several operations on it (merging for example) and present the outputs with tables, visualizations and insights (text).

But what about automating the whole report generation and emailing the final report as an attached document every month at a specific time? In this post I am going to explain how to do it in Windows. If you do a search on google, you will find several threads on stackoverflow and a few good specific posts on it. 1.

In RStudio create a new Rmarkdown document where you will enter your R code and texts. MarkdownReports by markdownreports. Latest Posts – Sebastian Sauer Stats Blog. Git Wars: GitHub vs Bitbucket. Git Wars: GitHub vs Bitbucket Introduction Now, you might think the answer I'm going to give you is already obvious because I'm using GiHub right now, but it's not. Both GitHub and Bitbucket offer great Git services, but each has its own features and pricing plans. In the following... thing, I'm going to compare the two and then offer a final solution that should work for most people.

TL;DR: Both. Interface and Functionality Both Bitbucket and GitHub really have the interface and functionality pinned down. Bitbucket Homescreen GitHub Homescreen Public Repos and Open Source Development GitHub is the clear winner here. Private Repos Bitbucket is the clear winner here. Pricing and Plans Bitbucket From All plans have: Unlimited private reposetc. GitHub From Unlimited collaboratorsetc. (unfortunately, no unlimited plan :() Note on Enterprise and Organizations Yes, I know they are different, but I'm not counting them. Conclusion Notes.

A successful Git branching model » nvie.com. In this post I present the development model that I’ve introduced for some of my projects (both at work and private) about a year ago, and which has turned out to be very successful. I’ve been meaning to write about it for a while now, but I’ve never really found the time to do so thoroughly, until now.

I won’t talk about any of the projects’ details, merely about the branching strategy and release management. Why git? ¶ For a thorough discussion on the pros and cons of Git compared to centralized source code control systems, see the web. But with Git, these actions are extremely cheap and simple, and they are considered one of the core parts of your daily workflow, really. As a consequence of its simplicity and repetitive nature, branching and merging are no longer something to be afraid of.

Enough about the tools, let’s head onto the development model. Decentralized but centralized ¶ Each developer pulls and pushes to origin. The main branches ¶ masterdevelop Supporting branches ¶ develop. Create and Update PowerPoint Reports using R | R-bloggers. In my sordid past, I was a data science consultant. One thing about data science that they don’t teach you at school is that senior managers in most large companies require reports to be in PowerPoint. Yet, I like to do my more complex data science in R – PowerPoint and R are not natural allies.

As a result, creating an updating PowerPoint reports using R can be painful. In this post, I discuss how to make R and PowerPoint work efficiently together. The underlying assumption is that R is your computational engine and that you are trying to get outputs into PowerPoint. Option 1: ReporteRs The first approach to getting R and PowerPoint to work together is to use David Gohel’s ReporteRs.

The code below creates 250 crosstabs, conducts significance tests, and, if the p-value is less than 0.05, presents a slide containing each. Below we see one of the admittedly ugly slides created using this code. Option 2: Displayr This has advantages and disadvantages relative to using ReporteRs. Option 3: Q. Microsoft Word MVP FAQ. Crsh/citr. Sans titre. Cox Proportional-Hazards Model - Easy Guides - Wiki - STHDA.

The Cox proportional-hazards model (Cox, 1972) is essentially a regression model commonly used statistical in medical research for investigating the association between the survival time of patients and one or more predictor variables. In the previous chapter (survival analysis basics), we described the basic concepts of survival analyses and methods for analyzing and summarizing survival data, including: the definition of hazard and survival functions,the construction of Kaplan-Meier survival curves for different patient groupsthe logrank test for comparing two or more survival curves The above mentioned methods - Kaplan-Meier curves and logrank tests - are examples of univariate analysis.

They describe the survival according to one factor under investigation, but ignore the impact of any others. Additionally, Kaplan-Meier curves and logrank tests are useful only when the predictor variable is categorical (e.g.: treatment A vs treatment B; males vs females). Where, In summary, Summary Infos. Survival Analysis - Easy Guides - Wiki - STHDA. Survival analysis corresponds to a set of statistical methods for investigating the time it takes for an event of interest to occur. In this chapter, we start by describing how to fit survival curves and how to perform logrank tests comparing the survival time of two or more groups of individuals.

We continue by demonstrating how to assess simultaneously the impact of multiple risk factors on the survival time using the Cox regression model. Finally, we describe how to check the validy Cox model assumptions. Survival analysis toolkits in R We’ll use two R packages for survival data analysis and visualization : the survival package for survival analyses,and the survminer package for ggplot2-based elegant visualization of survival analysis results For survival analyses, the following function [in survival package] will be used: For the visualization, we’ll use the following function available in the survminer package: These two packages can be installed as follow: Survival analysis Infos.

Chi-Square Test of Independence in R - Easy Guides - Wiki - STHDA. The chi-square test of independence is used to analyze the frequency table (i.e. contengency table) formed by two categorical variables. The chi-square test evaluates whether there is a significant association between the categories of the two variables. This article describes the basics of chi-square test and provides practical examples using R software. Data format: Contingency tables We’ll use housetasks data sets from STHDA: file_path <- " <- read.delim(file_path, row.names = 1) An image of the data is displayed below: Data format correspondence analysis The data is a contingency table containing 13 housetasks and their distribution in the couple: rows are the different tasksvalues are the frequencies of the tasks done : by the wife onlyalternativelyby the husband onlyor jointly Graphical display of contengency tables Chi-Square Test of Independence in R Chi-square test basics.

R Companion: Chi-square Test of Goodness-of-Fit. The tools in an R package developer’s toolbox | R-bloggers. Yihui Xie is the creator of several popular R packages, including knitr, animation and cranvas. In an interview with The Setup, he shares some of the software and hardware he uses in his data-to-day work, including (of course) R: For programming and data analysis, I primarily use R since I'm a statistician.

I have created a bunch of R packages including animation, knitr, formatR, Rd2roxygen, R2SWF, fun and cranvas, etc. I use other R packages like ggplot2, gWidgets, roxygen2, Shiny and XML. Emacs was my editor before I switched to RStudio; for small tasks, I just use the default editor gedit. I also use sed, awk, grep and shell scripts frequently. (Data Scientist John Myles White gave a similar interview back in July.) The Setup: Yihui Xie (via Karthik Ram) Related Integrate data and reporting on the Web with knitr Today's guest post comes from Yihui Xie, author of the knitr package — ed.

September 11, 2012 In "R bloggers" Shiny 0.8.0 released; Yihui Xie joins RStudio November 15, 2013. Knitr - Elegant, flexible, and fast dynamic report generation with R - Yihui Xie | 谢益辉. 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. You can also watch a 5-min video introduction. 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.

RStudio Support. Write your thesis or paper in R Markdown! Tips and Tricks for R Markdown html. HTML inside markdown | The Statamic Lodge. Github - Error Code 403 fatal: Pushing to Git ==colaborator with other username. Using GitHub with R and RStudio. RefManageR RHTML. Network analysis with R and igraph: NetSci X Tutorial. Laurenorsini.github.io/index.html at master · laurenorsini/laurenorsini.github.io. How to reshape data in R: tidyr vs reshape2 | R-bloggers. The Pandoc Markdown rabbit hole · Garrick Aden-Buie. Googleformr at Work: Pneumatic Road Tube Allegory | TRinker's R Blog. Googleformr on CRAN. Googleformr at Work: Pneumatic Road Tube Allegory | TRinker's R Blog.

Google spreadsheets + google forms + R = Easily collecting and importing data for analysis | R-statistics blog. HTML entity encoder/decoder. FileFormat.Info Site Search. &what search "check mark" Unicode characters & entities.

Plot-Image-ggplot

Multiple RMarkdown Reports, Multiple Data Sets, Single File – VP Nagraj. How to select all objects (pictures and charts) easily in Excel? How to Select All Tables in Word 2007/2010? Dplyr 0.4.0 | R-bloggers. Ridge regression model selection with R – Data Insight blog. How and when: ridge regression with glmnet. Using captioner. Create Awesome HTML Table with knitr::kable and kableExtra. Cheatsheets – RStudio. Quick list of useful R packages. R - wrong labeling in ggplot pie chart.

GitHub - rosannav/thesis_in_rmarkdown. R - Colouring and shading/texture of bars according to grouping ggplot2. Gantt charts with R. R - Conditional formatting tables in RMarkdown documents. Write your thesis or paper in R Markdown! Writing your thesis with R Markdown (3) – Figures, R code and tables | Rosanna's Research. Rmarkdown cheatsheet Vietnamese. A Stargazer Cheatsheet. Understanding R for Epidemiologists. Correcting bias in meta-analyses: What not to do (meta-showdown Part 1) | R-bloggers. Using knitr and pandoc to create reproducible scientific reports. An Introduction to the printr Package - Yihui Xie | 谢益辉. How to install the ‘RWordPress’ package in R | Scripts & Statistics. Writing R packages: A guide for scientists.

R Markdown | RStudio Blog. Bookdown: Easy Book Publishing with R Markdown. Bookdown: Authoring Books and Technical Documents with R Markdown. Introduction to pacman. Wilcoxon-Mann-Whitney rank sum test (or test U) | R-bloggers. Dealing with non-proportional hazards in R. Java - rJava load error in RStudio/R after "upgrading" to OSX Yosemite. List of useful RStudio addins made by useRs (a github repo) | R-bloggers.

Knsv/mermaid. DiagrammeR - Documentation. Why R is the best data science language to learn today | R-bloggers. Reading .docx [MS Word] Transcripts into R · trinker/qdap Wiki. How to import a .csv file that uses UTF-8 character encoding | Information Technology Group. Create and format PowerPoint documents from R software. Why I would rather use ReporteRs than RMarkdown | Mango Solutions. Create and format Word documents using R software and Reporters package - Easy Guides - Wiki - STHDA. Posts. Posts. Jobname - How to influence the name of the pdf file created with pdfLaTeX (from within the source code)? Osx - Installing R on Mac - Warning messages: Setting LC_CTYPE failed, using "C"

GitHub - nguyenkhacdung/LatexSweaveR: presentation-these-projection. Kinh nghiệm làm và báo cáo PhD proposal - Hỗ trợ sinh viên du học Đức.

Latex-Sweave

CTAN: Packages. Options: Chunk options and package options | knitr. R - Suppress library comments from ouput with knitr. Authoring R Presentations. Function to Clear the Console in R. Zotero-Biblio.