Stat 406 - Example R programs
R programs that have been discussed in lab (or in class) are included
- Introduction to R
- Introduction to the sp package.
- spIntro.r R code for the Introduction to the sp package.
- sample.r How to draw random samples
- simsample.r Illustration of using simulation to evaluate properties
- prediction1.r R code and comments for inv. dist. weighting and trend surfaces.
- prediction2.r R code and comments for ordinary kriging 'by hand'.
- prediction3.r R code and comments for semivariogram estimation.
- R matrix.pdf Notes on read various data formats into R and working with matrices.
- prediction4.r R code and comments for fitting a variogram model and ordinary (simple, universal) kriging
- prediction5.r R code and comments for other types of kriging
- google.r Using google maps with base and ggplot2 graphics. Some about sp objects.
- erode Map.r Using google maps with the IL erosion data
- symbols.r Adding points or polygons to a spplot
- spacetime.r Space time visualization, Empirical Orthogonal Functions, and ST kriging
- areal1.r Construct neighbor lists and weight lists,
compute Moran's I and Geary'c and local Moran's I
- areal2.r Spatial smoothing of areal data
- point1.r Describing spatial point processes:
estimating G(x), F(x), K(x), and g(x)
- point2.r Estimating intensity; fitting processes with clustering or inhibition; modeling intensity
- point3.r Summary (max, integral) tests and bootstrapping point patterns.
- areal3.r Fit OLS, SAR and CAR models to areal data. Moran's I for residuals from OLS.
- alliance.r Fitting ANOVA with spatial correlations, usign lsmeans library for ANOVA followup
- alliance.sas SAS code to fit ANOVA with spatial correlations
- point4.r R code for multi-type point patterns