Comments (5)
Again a tibble! That tibble brings so much pain.
Variables Richness
, Complexity
and Dist.Refuge
are not variables, but they are matrices. Please change them to variables (vectors). Currently their dimensions are given as [46, 1]
, but it should only read Richness: num -1.935, -0.935...
without those dimensions.
See issue #65 which is a duplicate of this.
from hmsc.
from hmsc.
Just a quick follow up... in this instance, the matrices that should have been vectors were generated using the scale function in base r. I had been avoiding the use of tibbles as I know they can be problematic in general.
dat$Richness = scale(dat$richAll) # this code created the matrices in the dataframe.
from hmsc.
@morgan-j-black You are right, base scale()
always returns a matrix, even if its argument is a vector, and matrix columns are allowed in base data.frame
s. Single-column matrices are converted to a vector by the data.frame()
constructor function, but this does not happen when they are assigned into an existing data.frame. Try dat$Richness = c(scale(dat$richAll))
to remove the dimension attribute.
(As an aside, as recently as 2018, tibble
was more restrictive than base data.frame
, and did not allow matrix columns by assignment.)
from hmsc.
I too hastily put the blame on tibble where we have seen this problem earlier. Actually, it is possible to have even more pathological data frames, such as with poly(x, 2)
which adds one variable that is a two-column matrix.
We (or probably I) added the test against matrix entries after issue #65. The basic Hmsc
and sampleMcmc
commands accept data frames with matrix entries, but then some posterior analysis tools fail for reasons that were outside the Hmsc package (that is, we called functions in other packages such as base and stats and these failed). So we considered it is better to catch these cases before sampleMcmc
run, and not weeks later when you finished with sampling and tried to do something with the result. The change was quick and dirty. The minimum is that we need to improve error reporting. I don't have an instant idea to automatically remove the matrix entries from the data frames stored in the result object. This really concerns those auxiliary methods that need access to the original data frame (most of analytic Hmsc
tools do not need data frame but they only operate on model matrix which is OK with matrix variables).
from hmsc.
Related Issues (20)
- Hmsc Error: 8 nodes produced errors; first error: the leading minor of order 4 is not positive definite HOT 9
- When to use expected vs realized predictions
- sampleMcmc Error in checkForRemoteErrors(val) : one node produced an error: NA/NaN/Inf in foreign function call HOT 1
- HSMC usage to infer microbial communities? [discussion] HOT 1
- Spatial random variable with 9,738 coordinates causes R to crash HOT 2
- Interpretation of model coefficients in a multivariate poisson GLM with spatial random effect
- incorrect number of dimensions HOT 3
- Can not predict at the same coordinates used to train the model
- Missing help for `importPosteriorFromHPC` function
- Error in cross validation: missing value where TRUE/FALSE needed
- predict with Yc instead of constructGradient to avoid "Error: vector memory exhausted (limit reached?)" ?
- Interpretation of `predictEtaMean` / `predictEtaMeanField` arguments of the predict function
- In cor(lbeta[[i]][k, ], lmu[[i]][k, ]) : the standard deviation is zero HOT 2
- Unexpected trace plots for alpha parameters of a GPP model HOT 4
- Error in `importPosteriorFromHPC` for GPP/Hmsc-hpc models with `alignPost = TRUE` HOT 1
- Spatial Model running extremely slow HOT 6
- Error while converting Hmsc model object to JSON: `Error in rcpp_to_json(x, unbox, digits, numeric_dates, factors_as_string, : negative length vectors are not allowed` HOT 3
- im getting this error in running the Uhlig code
- Question about making predictions when using a hurdle approach
- Inconsistency in spatial model variance partitioning
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 hmsc.