#Supplement 1 # Fricker, G.A., Wolf, J.A., Saatchi, S.S., Gillespie, T.W. #Predicting spatial variations of tree species richness in tropical forests from high resolution remote sensing. Ecological Applications. # File name: 2015_02_03_bci_main.r #is the r-code for reading in all data files and creating correlation matrices. #Also contains the base linear model used for the OLS regression models. #The Input tables are the plot and remote sensing statistics for each subplot in the 50-ha plot at the 1-ha scale #Each row is a subplot with the geographic location of each plot center (utm 17N m) #Plot variables include species richness (sr), stems (stem) and basal area (ba). #Remote Sensing predictory variables are listed in the readme document #Main tables for the OLS pairwise regression analysis for each size class #change all directory paths d200 = read.csv(file = 'D:\\bci_publication\\r\\in\\gls\\200.csv', header=T) d100 = read.csv(file = 'D:\\bci_publication\\r\\in\\gls\\100.csv', header=T) d10 = read.csv(file = 'D:\\bci_publication\\r\\in\\gls\\10.csv', header=T) d10_100 = read.csv(file = 'D:\\bci_publication\\r\\in\\gls\\10_100.csv', header=T) d10_200 = read.csv(file = 'D:\\bci_publication\\r\\in\\gls\\10_200.csv', header=T) #Pairwise correlation matrices for OLS regression cor(d10_100) cor(d10_200) #excluded from final manuscript, but included as a reference. cor(d10) cor(d100) cor(d200) #Each remote sensing variables can be analyzed individually by computing a linear model #example #linear regression between the species richness amongst all stems and the TWI (sd) #variables can be changed as necessary linear_model = lm(sr_all~twi_sd, data=d10) summary(linear_model)