Comments (6)
I mean, if you have code to transform an array into a raster stack, let me know
from r-package.
I'm not sure what your point on rds files is. You can save rasters as rds files the same way as any other object in R (mostly true, but irrelevant here where not)...and internally there is no place where the list of environments is saved directly as an rds. They all get mangled into the landscapes.rds format...
As for the dataframe to raster thing:
assume # temp <- list(of_data.frames)
library(raster)
What format are your data frames?
If they are in the form of x,y,data you can call:
temp <- lapply(temp, rasterFromXYZ)
If they are cell grids you can do this (with a detour over matrices):
temp <- lapply(temp, function(x){raster(as.matrix(x), xmn = 0.5, xmx = 31.5, ymn = 0.5, ymx = 31.5)})
?raster
_# S4 method for signature 'matrix'
_# raster(x, xmn=0, xmx=1, ymn=0, ymx=1, crs=NA, template=NULL)
_# note the _mn=0.5, _mx=31.5 boundaries, they put your cell centers at 1:31 instead of 0.5:30.5
from r-package.
My point is that it does not make much sense that the user who creates his/her own landscapes needs to create a list of rasters from a list of data frames (x,y,data) if the create_input() will turn the rasters to a rds file. So, the create_input() should be able to accept a list of data frames directly.
from r-package.
I will try to turn the array of data frames into a list of rasters to check if the function works though.
from r-package.
? I think you are confusing data.frames with the file extension .rds . Data.frames ( or rasters for that matter) are objects within R while .rds is just a convention for how to name the serialized storage of almost any R object. There is no close relationship between these. As such there is no advantage or requirement for a user to create his landscape as data.frames rather than rasters as is currently required...
I agree that we might want to expand the range of accepted input formats at some point, but this is not a priority right now...
from r-package.
This could be solved fairly easly by a internal loop in input_creation, however I am not sure how the col names will withstand the convertion data.frame to rater and back to data.frame
from r-package.
Related Issues (20)
- plot_summary fails if simulation ends before reaching step 0
- axis label for time series in summary plot is wrong
- specificy alternatives on plot_summary documentaiton regarding the sgen3sis.rds
- starting richness plots and range plots(pdfs) are not the same as when called for the first timestep in the call_observer function.
- multiple richenss plot with tag -1 when simulation starts with multiple species
- introduction vignette, richness plot
- versions history HOT 1
- Color palett of the ouput for color-blind people HOT 2
- misplaced loop_ecology() call HOT 1
- implement CI HOT 16
- South America distances missing HOT 4
- build package NOTE
- vignette problems in CRAN Should be corrected by 2021-10-19 to safely retain gen3sis on CRAN. HOT 1
- add colaborations file to git
- CRAN Fixes gen3sis 1.4 HOT 1
- add new check functions? HOT 1
- potential improvement of distance matrix calculation HOT 3
- NEWS version history HOT 1
- Check package for dependencies expiring soon. HOT 3
- accounting problem for speciation followed by extinction HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from r-package.