diff --git a/index.html b/index.html index fe83410..09daa6e 100644 --- a/index.html +++ b/index.html @@ -83,7 +83,9 @@
Then load the rosetta-soil
module by loading the R package. If you do not have an available python
installation or rosetta-soil
module you will be notified.
library(rosettaPTF)
+#> Error in system2(command = python, args = shQuote(script), stdout = TRUE, :
+#> 'CreateProcess' failed to run 'C:\Users\ANDREW~1.BRO\ONEDRI~1\DOCUME~1\VIRTUA~1\R-RETI~1\Scripts\python.exe "C:/Users/Andrew.G.Brown/AppData/Local/R/win-library/4.3/reticulate/config/config.py"' "C:/Users/Andrew.G.Brown/OneDrive - USDA/Documents/.virtualenvs/r-reticulate/Scripts/python.exe"
rosetta-soil
Python module
@@ -136,14 +138,13 @@ python
binaries
rosettaPTF::find_python()
-#> [1] "C:/Users/Andrew/OneDrive/Documents/.virtualenvs/r-reticulate/Scripts/python.exe"
find_python()
provides heuristics for setting up {reticulate} to use Python in commonly installed locations.
The first attempt makes use of Sys.which()
to find installations available in the user path directory.
rosetta-soil
Py
You can use install_rosetta()
to install into custom environments by specifying envname
as needed. After installing a new version of the module you should restart your R session.
rosettaPTF::install_rosetta()
-#> Using virtual environment "C:/Users/Andrew/OneDrive/Documents/.virtualenvs/r-reticulate" ...
-#> + "C:/Users/Andrew/OneDrive/Documents/.virtualenvs/r-reticulate/Scripts/python.exe" -m pip install --upgrade --no-user rosetta-soil
+#> Using virtual environment "~/.virtualenvs/r-reticulate" ...
#> [1] TRUE
Alternately, to install the module manually with pip
you can run the following command. This assumes a Python 3 binary called python
can be found on your path.
library(soilDB)
library(terra)
-#> terra 1.7.55
-library(rosettaPTF)
+#> Warning: package 'terra' was built under R version 4.3.3
+#> terra 1.7.78
+library(rosettaPTF)
# obtain mukey map from SoilWeb Web Coverage Service (800m resolution SSURGO derived)
res <- mukey.wcs(aoi = list(aoi = c(-114.16, 47.65,-114.08, 47.68), crs = 'EPSG:4326'))
-#> Loading required namespace: sf
-
+#> Loading required namespace: sf
+
# request input data from SDA
varnames <- c("sandtotal_r", "silttotal_r", "claytotal_r", "dbthirdbar_r")
resprop <- get_SDA_property(property = varnames,
@@ -237,8 +240,9 @@ Soil Data Acce
# run Rosetta on the mapunit-level aggregate data
system.time(resrose <- run_rosetta(soildata[,varnames]))
#> user system elapsed
-#> 0.19 0.03 0.22
-
+#> 0.03 0.00 0.06
+
# transfer mukey to result
resprop$mukey <- as.numeric(resprop$mukey)
resrose$mukey <- as.numeric(soildata$mukey)
@@ -260,7 +264,7 @@
The above example shows how to create raster output based on discrete (SSURGO polygon derived) data. A more general case is when each raster cell has “unique” values (i.e. continuous raster inputs). run_rosetta()
has an S3 method defined for SpatRaster input.
We previously merged the input data from SDA (an ordinary data.frame) into the RAT of res
; exploiting the linkage between mukey
and raster cells to make the map. For comparison with the mukey
results above we stack de-ratified input layers and create a new SpatRaster.
-
+
res3 <- rast(list(
res2[["sandtotal_r"]],
res2[["silttotal_r"]],
@@ -271,8 +275,9 @@
# SpatRaster to data.frame interface (one call on all cells)
system.time(test2 <- run_rosetta(res3))
#> user system elapsed
-#> 51.77 5.69 56.06
-
+#> 6.20 0.55 14.42
+
+
# make a plot of the predicted Ksat (identical to mukey-based results)
plot(test2, "log10_Ksat_mean")
@@ -286,7 +291,7 @@ Extended Output with Rosett
Make a Rosetta class instance for running extended output methods
Note that each instance of Rosetta has a fixed version and model code, so if you have heterogeneous input you need to iterate over model code.
-
+
# defaults are version 3 and model code 3 (4 parameters: sand, silt, clay and bulk density)
my_rosetta <- Rosetta(rosetta_version = 3, model_code = 3)
@@ -294,7 +299,7 @@ Make
predict()
Rosetta Parameter Values and Standard Deviations from a Rosetta instance
-
+
predict(my_rosetta, list(c(30, 30, 40, 1.5), c(55, 25, 20, 1.1)))
#> [[1]]
#> [,1] [,2] [,3] [,4] [,5]
@@ -310,7 +315,7 @@ Extended Rosetta Predictions, Parameter Distributions and Summary Statistics after Zhang & Schaap (2017) with ann_predict()
-
+
ann_predict(my_rosetta, list(c(30, 30, 40, 1.5), c(55, 25, 20, 1.1)))
#> ann_predict() is defined for objects with class Rosetta; see `Rosetta()` to create a new instance
#> $var_names
@@ -450,7 +455,7 @@ Developers
Dev status
diff --git a/pkgdown.yml b/pkgdown.yml
index 038bad6..4f1f317 100644
--- a/pkgdown.yml
+++ b/pkgdown.yml
@@ -2,5 +2,5 @@ pandoc: 3.1.11
pkgdown: 2.0.9
pkgdown_sha: ~
articles: {}
-last_built: 2024-05-28T18:47Z
+last_built: 2024-05-28T18:49Z
diff --git a/reference/figures/README-unnamed-chunk-10-1.png b/reference/figures/README-unnamed-chunk-10-1.png
index 94f341b..e19f4bb 100644
Binary files a/reference/figures/README-unnamed-chunk-10-1.png and b/reference/figures/README-unnamed-chunk-10-1.png differ
diff --git a/reference/figures/README-unnamed-chunk-11-1.png b/reference/figures/README-unnamed-chunk-11-1.png
index 94f341b..4e1cc4e 100644
Binary files a/reference/figures/README-unnamed-chunk-11-1.png and b/reference/figures/README-unnamed-chunk-11-1.png differ