Getting Data In and Out of R Introduction to R, Part II

Slides:



Advertisements
Similar presentations
PRE-SCHOOL QUANT WORKSHOP II R THROUGH EXCEL. NEW YORK TIMES INFOGRAPHICS GALARY The Jobless Rate for People Like You Home Prices in Selected Cities For.
Advertisements

CS 221 Chapter 2 Excel. In Excel: A1 = 95 A2 = 95 A3 = 80 A4 = 0 =IF(A1
 Statistics package  Graphics package  Programming language  Can be used to share/reproduce analyses  Many new packages being created - can be downloaded.
Data in R. General form of data ID numberSexWeightLengthDiseased… 112m … 256f3.61 NA1… 3……………… 4……………… n91m5.1711… NOTE: A DATASET IS NOT A MATRIX!
Chapter 6 Section 1 Introduction. Probability of an Event The probability of an event is a number that expresses the long run likelihood that an event.
Statistical Software An introduction to Statistics Using R Instructed by Jinzhu Jia.
Programming in R Packages, functions, and apply. Functions, Packages, and apply() In this session, we will learn –What are functions. –A brief introduction.
Introduction to R Part 2. Working Directory The working directory is where you are currently saving data in R. What is the current working directory?
Programming in R Getting data into R. Importing data into R In this session we will learn: Some basic R commands How to enter data directly into R How.
R packages/libraries Data input/output Rachel Carroll Department of Public Health Sciences, MUSC Computing for Research I, Spring 2014.
Using Desktop Data in Kepler Dan Higgins – NCEAS Prepared for: Ecoinformatics Training for Ecologists LTER (Albuquerque) January 8-12, 2007
Learn R Toolkit D Kelly O'DayExcel & R WorldsMod 2 - Excel & R Worlds: 1 Module 2 Moving Between Excel & R Worlds Do See & HearRead Learning PowerPoint.
Hands-on Introduction to R. We live in oceans of data. Computers are essential to record and help analyse it. Competent scientists speak C/C++, Java,
Introduction to R and Data Science Tools in the Microsoft Stack Jamey Johnston.
Saving Everyone’s Time and Energy: Practical Tips for Database Design Cynthia Wilson Garvan PhD Statistics, MA Mathematics College of Nursing
How to recover damaged xls and xlsx file? To learn more visit - damaged-xls-and-xlxs-file /MS-Excel- Repair-Tool-
Introduction to Accessibility CREATING ACCESSIBLE DOCUMENTS WORD, EXCEL, POWERPOINT, AND.PDF DREW CHILES.
How to edit the P11 in PDF format June Open the file “P11 UNICEF.PDF” with Adobe Acrobat 9.3.
Introduction to R and Data Science Tools in the Microsoft Stack
TCP/IP (Original) Application Transport Internet Network Access TCP/IP
Alcatel-Lucent Security Products Configuration Example Series
Click Once installation
Sihua Peng, PhD Shanghai Ocean University
DATA MANAGEMENT MODULE: Getting Data Into and Out of R
Introduction to R Carolina Salge March 29, 2017.
Welcome to Math’s Tutorial Session-3 Data handling
Chapter 19 Notes Intensifying the Dominant
Logan-Hocking Schools
Chapter 2: Getting Data into SAS
Population Projections Workshop
Introduction to R Studio
Dynamic SQL Writing Efficient Queries on the Fly
Uploading and handling databases
Data Wrangling in the Tidyverse
Working with Data in Windows
DATA MANAGEMENT MODULE: Getting Data Into and Out of R
Intro To Design 1 Elementary School Library: User Sub-System Class Diagrams Software Engineering CSCI-3321 Dr. Tom Hicks Computer Science Department.
Chapter 1: Introduction to SAS
Lesson 1: Introduction to Trifacta Wrangler
Lesson 1: Introduction to Trifacta Wrangler
Data in…Data Out! EPID 799C Fall 2017
Lab 1 Introductions to R Sean Potter.
Lesson 1: Introduction to Trifacta Wrangler
Additional Resources Introduction to R, Part II
Sihua Peng, PhD Shanghai Ocean University
Chapter 1: Introduction
Rosa Fung Director, Business and Financial Analysis
Chapter 1: Introduction
ديبــــاجــــــة: صادق الكنيست الإسرائيلي في تاريخ على اقتراح قانون دائرة أراضي إسرائيل (تعديل رقم7) – 2009 الذي يشكّل، عمليًا، خطة إصلاح شاملة.
Exploring Data in R Introduction to R, Part II
Slides for Introduction to Stochastic Search and Optimization (ISSO) by J. C. Spall CHAPTER 15 SIMULATION-BASED OPTIMIZATION II: STOCHASTIC GRADIENT AND.
RULES FOR DATA SECURITY AND VISIBILITY
ACKNOWLEDGEMENTS (optional section)
Exporting Data Using H2 Central Office Query
Business Tech I File Extensions.
Writing Functions in R Introduction to R, Part II
Installing Packages Introduction to R, Part II
Basics of R, Ch Functions Help Managing your Objects
CSCI N317 Computation for Scientific Applications Unit R
Writing reports Wrea Mohammed
SCIENCE CLASS January 4th, 2017.
MIS2502: Data Analytics ICA #7 Introduction to R and RStudio - Recap
AP Statistics Chapter 12 Notes.
R for Epi Workshop Module 1: Learning Base R
Unit J: Creating a Database
Data Import : : CHEAT SHEET
Excel-eration Webinar
python
2
STAT 515 Statistical Methods I Lecture 1 August 22, 2019 Originally prepared by Brian Habing Department of Statistics University of South Carolina.
Presentation transcript:

Getting Data In and Out of R Introduction to R, Part II Anna Blackstock Statistician, Biostatistics and Information Management Office (BIMO) NCEZID/DFWED

Getting Data Into R You can create vectors and other data structures in R (which you already know)

Getting Data Into R In your work, though, you may not use simple vectors much! You probably have data saved that you will need to read into R. Luckily, R can read in (and save) data of many types.

Getting Data into R Type Read In (Extension) R Package Function General table Base R read.table() CSV (.csv) read.csv() readr read_csv()* Excel (.xlsx or .xls) readxl read_excel()* SAS (.sas7bdat) haven read_sas()* *Creates a data frame with bonus features called a “tibble.”

Getting Data into R: Tips Remember to look at the help for the functions you are using. What are the default parameter values? What parameters need to be changed? Always check your data before running analyses. Are data types appropriate? Are missing values being handled correctly?

Saving Datasets Many functions for reading data have counterparts for saving data. Type Saved (Extension) R Package Function General table Base R write.table() CSV (.csv) write.csv() readr write_csv() SAS (.sas7bdat) haven write_sas()

Saving R Objects You can also save and import R objects directly. Examples: saveRDS() and readRDS in base R write_rds() and read_rds() in “readr” package

Where to next? Check out the data import chapter of “R for Data Science”: http://r4ds.had.co.nz/data-import.html