Created
July 19, 2021 22:49
-
-
Save Aphellirus/d2f378c7844f38719b782cc6e200a094 to your computer and use it in GitHub Desktop.
Handling CSV with R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Write csv in R | |
df <- data.frame(name = c("Jon", "Winston", "Suzy"), | |
age = c(23, 41, 32)) | |
write.csv(df,"C:\\Users\\Matheus\\Desktop\\MyData.csv", row.names = FALSE) | |
# Read csv with R | |
data <- read.csv("input.csv") | |
print(data) | |
# Write to csv with R | |
write.csv(Your DataFrame,"Path where you'd like to export the DataFrame\\File Name.csv", row.names = FALSE) | |
#Import csv file with R | |
read.csv("yourdata.csv", sep = ';') | |
#Read csv with R | |
library(readr) | |
data <- read_csv("input.csv") | |
# Parse csv with R | |
planetsDistance <- read.csv(file = 'data/planets-distances.csv') | |
head(planetsDistance) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment