TNC-NMFO / NWLAND

carbon accounting model
0 stars 0 forks source link

cannot open file 'raw_data/': Permission denied #145

Open sbassett opened 2 years ago

sbassett commented 2 years ago
Start write_caland_inputs at Wed Mar 30 10:28:24 2022 
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") : cannot open file 'raw_data/': Permission denied
Called from: file(file, "rt")
sbassett commented 2 years ago

error originates near line 550 in write_caland_inputs.R

# first determine which file is the start year file
# the columns are: region code, region name, land type code, land type name, ownership code, ownership name, area
styr_ind = grep(start_year, area_gis_files_orig)
refyr_ind = grep(ref_year, area_gis_files_orig)
start_area_in = read.csv(paste0(in_dir, area_gis_files_orig[styr_ind]), header=FALSE, stringsAsFactors=FALSE)
start_area_in[,c(1,3,5)] <- as.numeric(unlist(start_area_in[,c(1,3,5)]))
ref_area_in = read.csv(paste0(in_dir, area_gis_files_orig[refyr_ind]), header=FALSE, stringsAsFactors=FALSE)
ref_area_in[,c(1,3,5)] <- as.numeric(unlist(ref_area_in[,c(1,3,5)]))

this line specificially: start_area_in = read.csv(paste0(in_dir, area_gis_files_orig[styr_ind]), header=FALSE, stringsAsFactors=FALSE)

sbassett commented 2 years ago

the grep can't find the start year, because I changed it to 2022 need to change start year back to 2021

> styr_ind
integer(0)
> start_year
[1] 2022
> area_gis_files_orig
[1] "landcat_area_sqm_2001_for2100_nm_rcp45.csv" "landcat_area_sqm_2021_baseline_nm.csv" 
sbassett commented 2 years ago

I think the start year can be adjusted later during processing and plotting, so changing start year back to 2021.

sbassett commented 2 years ago

New Mexico

Colorado