R Under development (unstable) (2024-05-04 r86521 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > ## These are tests that I will run to reproduce the part of the vignette > ## That depends on APSIM-X. In this way the vignette can be build independently > ## of APSIM-X, but the testing side-effect of the vignette is still present > require(apsimx) Loading required package: apsimx APSIM(X) not found. If APSIM(X) is installed in an alternative location, set paths manually using 'apsimx_options' or 'apsim_options'. You can still try as the package will look into the registry (under Windows) > apsimx_options(warn.versions = FALSE) > > extd.dir <- system.file("extdata", package = "apsimx") > > run.vignette <- get(".run.local.tests", envir = apsimx.options) > > tmp.dir <- tempdir() > > if(run.vignette){ + + ## Copy 'Maize.apsimx' to 'tmp.dir' + ex.dir <- auto_detect_apsimx_examples() + file.copy(from = paste0(ex.dir,"/","Maize.apsimx"), + to = tmp.dir, copy.mode = FALSE) + maize <- apsimx("Maize.apsimx", src.dir = tmp.dir) + + ## Running 'Wheat' example + file.copy(from = paste0(ex.dir,"/","Wheat.apsimx"), + to = tmp.dir, copy.mode = FALSE) + wheat <- apsimx("Wheat.apsimx", src.dir = tmp.dir) + + ## Running 'MaizeSoybean' example + file.copy(from = paste0(extd.dir,"/","Ames.met"), + to = tmp.dir) + file.copy(from = paste0(extd.dir,"/","MaizeSoybean.apsimx"), + to = tmp.dir) + maize.soy <- apsimx("MaizeSoybean.apsimx", src.dir = tmp.dir) + + ## The code below should only be run from my laptop and only when a new + ## version of APSIM-X is released + ## This updates the 'Wheat' and 'Maize' example files in case they have + ## changed + + aiu <- apsim_version(which = "inuse", verbose = FALSE) + + ## Need to change this for new versions of APSIM-X + ## apsimx.new.version <- as.numeric(strsplit(aiu, ".", fixed = TRUE)[[1]][4]) + + my.laptop <- grepl("fernandomiguez", Sys.info()[["user"]]) + ## This is only for my laptop + if(my.laptop && FALSE){ + my.extd <- "~/Dropbox/apsimx/inst/extdata" + file.copy(from = paste0(ex.dir,"/","Maize.apsimx"), + to = my.extd, copy.mode = FALSE, + overwrite = TRUE) + file.copy(from = paste0(ex.dir,"/","Wheat.apsimx"), + to = my.extd, copy.mode = FALSE, + overwrite = TRUE) + } + } > > proc.time() user system elapsed 0.54 0.04 0.59