Research scientist focusing on tropical forest dynamics, structure and function.
-
Northern Arizona University
- Flagstaff, AZ
- https://ecosci.nau.edu
- https://orcid.org/0000-0003-2358-9367
- ashenkin
- in/alexandershenkin
- @shenkin.bsky.social
Highlights
- Pro
Pinned Loading
-
-
-
Deviation (sum to zero) contrasts ar...
Deviation (sum to zero) contrasts are important to use in models when one is interested in grand mean parameters and per-level deviations from that mean. However, the usual method of coding these contrasts in R ends up throwing away the associated variable names. As long as you understand what deviation contrasts do, there is no danger in maintaining these names (some assert this is dangerous, but I really don't think it is). The code below sets deviation contrasts, and maintains the names of the factor levels. 1contr.sum.keepnames <- function(...) {
2# make deviation contrasts that don't lose the names of the factors in the model results
3# from https://stackoverflow.com/questions/10808853/why-does-changing-contrast-type-change-row-labels-in-r-lm-summary
4conS <- contr.sum(...)
5colnames(conS) = rownames(conS)[-length(rownames(conS))]
-
How to predict results from lme4's g...
How to predict results from lme4's glmer when fit with scaled data 1# We often fit LMM/GLMM's with scaled variables. However, making predictions using those models isn't straightforward (at least to me!)
2# It turns out that you have to re-scale your prediction data using the same parameters used to scale your original data frame used to fit the model
3# See below, and pay special attention to the section where the new data are rescaled.
45library(lme4)
-
You have a digital elevation model (...
You have a digital elevation model (DEM), and you want to make an elevation profile between two or more points. You want that elevation profile to reflect an average elevation across a swath, and not just a single point from a line. Here's one way to do it in R. Thanks to Forrest Stevens and other folks from the R-sig-geo list. 1# Thanks to Forrest Stevens. Some of the code here borrowed from him here: https://github.com/ForrestStevens/Scratch/blob/master/swath_slices.R
23library(raster)
4library(rgdal)
5library(sp)
-
R script to generate co-author lists...
R script to generate co-author lists often required by funding agencies 1# Alexander Shenkin 2023.
2# License: CC BY 4.0: https://creativecommons.org/licenses/by/4.0/. TLDR; Share and adapt with attribution.
3#
4# This script reads in a csv file of publications, and produces a list of coauthors
5# 1) To get the csv of publications, download a bibtex or other archive of desired pubs from ORCID or another publication search tool.
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.