library(knitr)
opts_knit$set(root.dir="../..") # file paths are relative to the root of the project directory
library(tradeflows)
library(dplyr)

Load data

load("data/sawnwood.RData")
size1 <- file.info("data/sawnwood.RData")$size
size1

Save to RDATA

# drop the product column which has large text
sawnwood  <- sawnwood %>% select(-product)
save(sawnwood, file="data/sawnwood2.RData")
size2 <- file.info("data/sawnwood2.RData")$size
(size1 - size2) / size1 *100
# 6.4 % difference in file size

# drop the flowcode column which has only 1, 2 and 4 values
sawnwood  <- sawnwood %>% select(-flowcode)
save(sawnwood, file="data/sawnwood2.RData")
size2 <- file.info("data/sawnwood2.RData")$size
(size1 - size2) / size1 *100
# 0,1 % difference in file size


paul4forest/tradeflows documentation built on Oct. 8, 2019, 10:35 a.m.