nick-gauthier / anthromes Goto Github PK
View Code? Open in Web Editor NEWAn R package for analyzing historical land use and population on regional to global scales.
Home Page: https://nick-gauthier.github.io/anthromes/
License: Other
An R package for analyzing historical land use and population on regional to global scales.
Home Page: https://nick-gauthier.github.io/anthromes/
License: Other
Would be useful for users to be able to download the ArchaeoGLOBE region shapefiles and data from https://dataverse.harvard.edu/dataverse/ArchaeoGLOBE for making regional comparisons. Could use the same Dataverse interface as hyde_download()?
Hi Nick,
I am trying to run the analysis.Rmd file provided in the R research compendium (from Ellis et al. 2021 PNAS) but saw that the function read_anthromes is not defined. Basically it reads e.g. the an12_dgg_baseline.csv file as a stars object for the ease of downstream analysis. May I ask the function could still be provided, or alternatively, how would you suggest to read the an12_dgg_baseline.csv file into R so that it has the same class as the output of the anthrome_classify function?
Thank you!
Hi, I'm trying to read in HYDE raw data and inputs and cropping to my area of interest (across the tropics) with hyde_read
and st_crop
, then classifying the anthromes with anthrome_classify
. However I run into the following error message
Error in dat/inputs["land_area"] : non-numeric argument to binary operator In addition: Warning message: In dplyr::mutate(., used = crops + grazing + urban, trees = pot_veg %in% : Incompatible methods ("Ops.stars_proxy", "Ops.stars") for "/"
So I tried to specify the data as a stars object with
anthromes_tropics <- anthrome_classify(st_as_stars(hyde_tropics), inputs_tropics)
, however I get a different error message that I'm not sure how to resolve
Error in st_crop.stars(x = x, y = y, crop = crop, epsilon = epsilon) : for cropping, the CRS of both objects have to be identical
As I have checked using st_crs
that the CRS of both objects are identical.
I'm not quite sure how this can be resolved, if this is an issue with stars
package and how stars proxy objects are dealt with, or if it's possible to read the hyde data as a stars object instead of stars proxy object?
If it helps, this is what I did to read the data in
> hyde <- hyde_read(dir = "../Data/Ellis2021-Anthromes")
> hyde
stars_proxy object with 6 attributes in 6 file(s):
$cropland
[1] "[...]/cropland.tif"
$grazing
[1] "[...]/grazing.tif"
$ir_rice
[1] "[...]/ir_rice.tif"
$popc
[1] "[...]/popc.tif"
$tot_irri
[1] "[...]/tot_irri.tif"
$uopp
[1] "[...]/uopp.tif"
dimension(s):
from to offset delta refsys point values x/y
x 1 4320 -180 0.0833333 WGS 84 FALSE NULL [x]
y 1 2160 89.9999 -0.0833333 WGS 84 FALSE NULL [y]
time 1 75 NA NA NA NA 10000BC,...,2017AD
> inputs <- hyde_read(vars="inputs", dir="../Data/Ellis2021-Anthromes")
> inputs
stars object with 2 dimensions and 5 attributes
attribute(s), summary of first 1e+05 cells:
land_area pot_veg regions iso
Min. : NA Tropical Evergreen Woodland : 0 Africa : 0 Min. : NA
1st Qu.: NA Tropical Deciduous Woodland : 0 Asia : 0 1st Qu.: NA
Median : NA Temperate Broadleaf and Evergreen Woodland : 0 Eurasia : 0 Median : NA
Mean :NaN Temperate Needleleaf and Evergreen Woodland: 0 Europe : 0 Mean :NaN
3rd Qu.: NA Temperate Deciduous Woodland : 0 Latin America and Caribbean: 0 3rd Qu.: NA
Max. : NA (Other) : 0 (Other) : 0 Max. : NA
NA's :1e+05 NA's :100000 NA's :100000 NA's :1e+05
pot_vill
Min. : NA
1st Qu.: NA
Median : NA
Mean :NaN
3rd Qu.: NA
Max. : NA
NA's :1e+05
dimension(s):
from to offset delta refsys point values x/y
x 1 4320 -180 0.0833333 WGS 84 FALSE NULL [x]
y 1 2160 89.9999 -0.0833333 WGS 84 FALSE NULL [y]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.