|
|
|
|
|
library(readxl) |
|
thePokemon <- read_xlsx("Pokemon.xlsx") |
|
write.csv(thePokemon,file="Pokemon.csv",row.names=FALSE) |
|
|
|
|
|
thePokemon <- read.csv("Pokemon.csv") |
|
library(writexl) |
|
write_xlsx(thePokemon,"Pokemon.xlsx") |
|
|
|
|
|
thePokemon <- do.call(rbind,lapply(1:8,function(x){ |
|
read.csv(sprintf("gen%02d.csv",x)) |
|
})) |
|
|
|
|
|
write.csv(thePokemon,file="Pokemon.csv",row.names=FALSE) |
|
|
|
|
|
|
|
generations <- 1:8 |
|
lapply(generations,function(x){ |
|
data <- thePokemon[thePokemon$Generation == x,] |
|
write.csv(data, |
|
sprintf("gen%02d.csv",x), |
|
row.names=FALSE) |
|
}) |
|
|
|
|
|
fileList <- unlist(lapply(generations,function(x){ |
|
sprintf("gen%02d.csv",x) |
|
})) |
|
if(file.exists("PokemonData.zip")) file.remove("PokemonData.zip") |
|
zip("PokemonData.zip",fileList) |
|
|
|
|
|
|
|
library(writexl) |
|
thePokemon <- do.call(rbind,lapply(1:8,function(x){ |
|
df <-read.csv(sprintf("gen%02d.csv",x)) |
|
write_xlsx(df,path=sprintf("gen%02d.xlsx",x)) |
|
})) |
|
|
|
|
|
fileList <- unlist(lapply(1:8,function(x){ |
|
sprintf("gen%02d.xlsx",x) |
|
})) |
|
if(file.exists("PokemonXLSX.zip")) file.remove("PokemonXLSX.zip") |
|
zip("PokemonXLSX.zip",fileList) |