Introduction to R Studio and some useful packages

  • Slides: 16
Download presentation
Introduction to R Studio and some useful packages Presented by Asst. Prof. Mahajan Uchita

Introduction to R Studio and some useful packages Presented by Asst. Prof. Mahajan Uchita V. Department of Statistics, KCE’s Society PGCSTR, Jalgaon.

Contents • Introduction to R studio • Overview of different windows of R studio

Contents • Introduction to R studio • Overview of different windows of R studio • Some useful packages in R studio namely : ggplot 2 dplyr Packages qcc foreign

How to import and export the files • To import files : 1. 2.

How to import and export the files • To import files : 1. 2. 3. 4. 5. data=read. csv(file. choose(), header=T) data=read. delim(file. choose(), header=T) data=read. table(file. choose(), header=T , sep=“, ”) data=read. table(file. choose(), header=T , sep=“ ”) We can also import files in R studio with the help of path of the file. • To export files: • Similalry we can send the files using “write. table”, ”write. csv”

Some useful packages in R studio What is ggplot 2? • An implementation of

Some useful packages in R studio What is ggplot 2? • An implementation of the Grammer of Graphics by Leland Wilkinson • Written by Handley Wickham • A “third” graphics system for R (along with base and lattice) • Available from CRAN via install. packages() • “Shorten the distance from mind to page” • Automatically deals with spacing, text, titles.

 • • • Provides a “grammer “ for data manipulation Developed by Handley

• • • Provides a “grammer “ for data manipulation Developed by Handley Wickham An optimized version of plyr package Greately simplifies exsiting functionality in R studio Is very fast since the key operations are coded in C++ Basically it works with five verbs(commands) contd….

 • • select: return a subset of the columns of data frame. filter:

• • select: return a subset of the columns of data frame. filter: extract a subset of rows from a data frame. arrange: reorders the rows of data in the way we want. mutate: add new variables(columns) or transform existing variables. • rename: rename variables in dataframe.

 • The qcc package for the R studio statistical environment allows to: •

• The qcc package for the R studio statistical environment allows to: • plot Shewhart quality control charts for continuous, attribute and count data • plot Cusum and EWMA charts for continuous data • draw operating characteristic curves • perform process capability analyses • draw Pareto charts and cause-and-effect diagram

 • Reading and writing data stored by some versions of Epi Info, Minitab,

• Reading and writing data stored by some versions of Epi Info, Minitab, S, SAS, SPSS, Stata, Systat, Weka, and for reading and writing some d. Base files. • lookup. xport : Lookup Information on a SAS XPORT Format Library • read. spss: Read an SPSS Data File • read. ssd : Obtain a Data Frame from a SAS Permanent Dataset, via read. xport • read. mtp: Read a Minitab Portable Worksheet

Some another useful packages in R studio To model data: • lme 4 or

Some another useful packages in R studio To model data: • lme 4 or nlme - Linear and Non-linear mixed effects models. • vcd - Visualization tools and tests for categorical data

To report results: • shiny - Easily make interactive, web apps with R. A

To report results: • shiny - Easily make interactive, web apps with R. A perfect way to explore data and share findings with nonprogrammers. • R Markdown - The perfect workflow for reproducible reporting. Write R code in your markdown reports. When you run render, R Markdown will replace the code with its results and then export your report as an HTML, pdf, or MS Word document, or a HTML or pdf slideshow.

To write your own R packages : • devtools - An essential suite of

To write your own R packages : • devtools - An essential suite of tools for turning your code into an R package. • testthat • roxygen 2 • You can also read about the entire package development process online in Hadley Wickham's R Packages book

Summary : • An introduction to R studio • Some useful packages in R

Summary : • An introduction to R studio • Some useful packages in R studio: 1. ggplot 2: offers a powerful graphics language for creating elegant and complex plots. 2. dplyr: It provides simple functions that correspond to the most common data manipulation tasks, to help you translate your thoughts into code.

3. qcc: Create an object of class 'qcc' to perform statistical quality control. This

3. qcc: Create an object of class 'qcc' to perform statistical quality control. This object may then be used to plot Shewhart charts, drawing OC curves, computes capability indices, and more. 4. foreign: contains functions that will allow you to import data files from some of the most commonly used statistical software packages such as SAS, Stata and SPSS.

References: • https: //www. rdocumentation. org • https: //youtu. be/ayw. Fompr 1 F 4

References: • https: //www. rdocumentation. org • https: //youtu. be/ayw. Fompr 1 F 4 • Maria Dolores Ugarte, Ana F. Militino, Alan T. Arnholt. 2008. PROBABILITY and STATISTICS WITH R. New York: CRC press.