-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path17_spatialObjectExample.R
More file actions
67 lines (47 loc) · 1.93 KB
/
17_spatialObjectExample.R
File metadata and controls
67 lines (47 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Benjamin Glass
# Last Update: July 2, 2021
# Script Overview: this master script iterates over all FFP output files
# and extracts spatial statistics for each decimal Day in each year of
# FFP output data. The spatial input data includes Megaplot proportions,
# Lidar, and TCT landsat 8 imagery.
library(tidyverse)
library(rgdal)
#read in source files
setwd("/Users/benjaminglass/HF21-Scripts")
source("10_getMGP_stats.R")
setwd("/Users/benjaminglass/HF21-Scripts")
source("12_getLIDAR_stats.R")
setwd("/Users/benjaminglass/HF21-Scripts")
source("13_getTCT_stats.R")
setwd("/Users/benjaminglass/Desktop/HF21/00_Datasets/FFP_data/EMS_FFP_lines_17-20")
#get all FFP output files for EMS tower
temp = list.files(pattern="*.csv")
#create master results file (which will be our final product)
masterResults_all <- data.frame(year=NA,
decDay=NA,
MGP_C_mean = NA,
MGP_C_std = NA,
MGP_D_mean = NA,
MGP_D_std = NA,
L_mean = NA,
L_std = NA,
TCTb_mean=NA,
TCTb_std=NA,
TCTg_mean=NA,
TCTg_std=NA,
TCTw_mean=NA,
TCTw_std=NA)
doneFiles <- data.frame(file=NA)
#variable to count files completed for debugging
iter <- 0
#===================== FOR LOOP ==========================
#looping over all files in temp
for (currentFile in temp) {
iter <- iter+1
#printing
print("============================================================")
print(paste0("FFP FILE ",iter," OF ",length(temp),": ",currentFile))
print("============================================================")
#get year of FFP file
year <- substr(currentFile,14,15)
}