Recent content by sarahgrogan

  1. S

    Write a loop to calculate own indices and test correlation with another file

    I could really use some help developing some code to create and calculate indices automatically, probably in a loop, and testing the correlation with a separate file. The research is part of a PhD project, and could really add to the research to test my own indices rather than limiting these to...
  2. S

    Create simple function to average column over different ranges of rows

    I've learned how to subset a group of rows I am interested in from a matrix, and average those values. The data set shows the percent of light reflected at many different wavelengths (rows). If I want to know the average amount of light reflected at ~900 nm, I use the following code to...
  3. S

    Averaging rows from a matrix

    I'm fairly new to using R, and wonder if someone could give me some help subsetting large data matrices in specific ways. I've attached a data file. It measures the percent of light reflected off of plants at 2048 different wavelengths. The first column is wavelength, which ranges from 339.99...