# Create a temporary directory
temp_dir <- tempfile()
dir.create(temp_dir)
# Set the working directory to the temporary directory
old_dir <- setwd(temp_dir)
#Generate example trade data
GeneratedTradeData <- data.frame(
t = c(2020, 2020, 2020),
i = c(4, 710, 710),
j = c(842, 124, 251),
k = c(842410, 110220, 845210),
v = c(4.776, 0.088, 0.057),
q = c(0.025, 0.007, 0.005)
)
# Use your function with generated trade data
IOPS(
CountryCode = 710,
tradeData = GeneratedTradeData,
ComplexMethod = "reflections",
iterCompl = 2,
GVCMapping = NULL,
tradedigit = 6
)
# \donttest{
# Use your function with real trade data
IOPS(
CountryCode = 710,
tradeData = ExampleTradeData,
ComplexMethod = "reflections",
iterCompl = 2,
GVCMapping = NULL,
tradedigit = 6
)
# }
# Clean up the temporary directory
setwd(old_dir) # Restore the original working directory
unlink(temp_dir, recursive = TRUE)
Run the code above in your browser using DataLab