Import CSV, TXT and EXCEL (XLSX) files into R

Опубликовано: 01 Октябрь 2024
на канале: Joys of Data
60
1

Click "Show More" To See Code.

*Note YouTube does not allow assignment operators, therefore I have used an equal sign below. Please replace with assignment operator in your code.

#IMPORT CSV
x = read.csv("StudentsPerformance.csv")
head(x)
install.packages("readr")
library(readr)
read_csv("StudentsPerformance.csv")

#IMPORT TXT
y = "Volcanoes.txt"
read_tsv(y)
read.table(y, header = TRUE, sep = "/", stringsAsFactors = FALSE)

#IMPORT EXCEL
install.packages("readxl")
library(readxl)
x = "2021OlympicsTeams.xlsx"
read_excel(x)
excel_sheets(x)
args(read_excel)
read_excel(x, sheet = "Details", skip = 10)

Import CSV, TXT and EXCEL (XLSX) files into R #R #csv #txt #excel #importingdata #dataanalysis