If playback doesn't begin shortly, try restarting your device.
•
You're signed out
Videos you watch may be added to the TV's watch history and influence TV recommendations. To avoid this, cancel and sign in to YouTube on your computer.
CancelConfirm
Share
An error occurred while retrieving sharing information. Please try again later.
Code:
setwd("C:/My Data Folder/Project1")
if (!require(readxl)) install.packages('readxl')
library(readxl)
d = read_excel("sampledatafoodsales.xlsx", sheet = "FoodSales")
Textbook: http://tinyurl.com/he902stats
Set working directory: http://tinyurl.com/RStudioSetWD
Entire code file from video:
LOAD EXCEL DATA IN R WITHIN RSTUDIO
##### All the code in one place, for intermediate or advanced users #####
setwd("C:/My Data Folder/Project1")
if (!require(readxl)) install.packages('readxl')
library(readxl)
d = read_excel("sampledatafoodsales.xlsx", sheet = "FoodSales")
Data source: Data source: Excel Sample Data. Contextures. https://www.contextures.com/xlsampled....
##### Detailed procedure, for beginners #####
Fix RStudio layout, if desiredMake new R script file (not shown in video)Prepare and inspect Excel file on your computerSet working directory (instructions: https://tinyurl.com/RStudioSetWD)
setwd("C:/My Data Folder/Project1")…...more
Load Excel Data into R (readxl package, code in description; quick code up front + details later)
14Likes
2,308Views
2021Jan 6
Code:
setwd("C:/My Data Folder/Project1")
if (!require(readxl)) install.packages('readxl')
library(readxl)
d = read_excel("sampledatafoodsales.xlsx", sheet = "FoodSales")
Textbook: http://tinyurl.com/he902stats
Set working directory: http://tinyurl.com/RStudioSetWD
Entire code file from video:
LOAD EXCEL DATA IN R WITHIN RSTUDIO
##### All the code in one place, for intermediate or advanced users #####
setwd("C:/My Data Folder/Project1")
if (!require(readxl)) install.packages('readxl')
library(readxl)
d = read_excel("sampledatafoodsales.xlsx", sheet = "FoodSales")
Data source: Data source: Excel Sample Data. Contextures. https://www.contextures.com/xlsampled....
##### Detailed procedure, for beginners #####
Fix RStudio layout, if desiredMake new R script file (not shown in video)Prepare and inspect Excel file on your computerSet working directory (instructions: https://tinyurl.com/RStudioSetWD)
setwd("C:/My Data Folder/Project1")
Inspect working directory in Files viewerMake sure Excel file is in working directoryData source: Data source: Excel Sample Data. Contextures. https://www.contextures.com/xlsampled....Load readxl package (and install if needed)
if (!require(readxl)) install.packages('readxl')
library(readxl)
See Environment tabLoad Excel data into R
d = read_excel("sampledatafoodsales.xlsx", sheet = "FoodSales")
See Environment tab againSee consoleInspect data in R (via Environment - Data or with View() command)
View(d)
Use the data in R (for example, you can make a table)
table(d$City)…...more