TNC-NMFO / NWLAND

carbon accounting model
0 stars 0 forks source link

File paths too long for Windows Server 2012 #72

Open sbassett opened 3 years ago

sbassett commented 3 years ago

Hypothesis that "cannot open file" error is caused by path that is too long for Windows Server 2012. nchar("E:/Users/sbassett/Downloads/NWLAND-nwland_dev/outputs/2021_05_14_carbon_input_nwland_testB3_devAll_noOcean/figures/All_region/Developed_all/All_own/All_region_Developed_all_All_own_NWL_Proto_v1_Alt_A_protoA_hist_output_mean_BC1_NR120_ghg_ann_comp_diff_output.pdf") = 162

Maximum file path length is 260 cahracters.

Start plot_caland() at Fri Jul 02 10:25:36 2021 
Error in grDevices::pdf(file = filename, ..., version = version) : 
  cannot open file './outputs/2021_05_14_carbon_input_nwland_testB3_devAll_noOcean/figures/All_region/Developed_all/All_own/All_region_Developed_all_All_own_NWL_Proto_v1_Alt_A_protoA_hist_output_mean_BC1_NR120_ghg_ann_comp_diff_output.pdf'
In addition: There were 50 or more warnings (use warnings() to see the first 50)
> warnings()
Warning messages:
1: In dir.create(out_dir, recursive = TRUE) :
  '.\outputs\2021_05_14_carbon_input_nwland_testB3_devAll_noOcean\figures\All_region\All_land\All_own' already exists
2: In which(as.integer(names(scen_df_list[[i]])) > last_year) :
  NAs introduced by coercion
3: In if (lt == "All_land" & scen_sheets[i] == "Area") { ... :
  the condition has length > 1 and only the first element will be used
4: In which(as.integer(names(scen_df_list[[i]])) > last_year) :
  NAs introduced by coercion
...
sbassett commented 3 years ago

changing the outputs file name E:/Users/sbassett/Downloads/NWLAND-nwland_dev/outputs/a E:/Users/sbassett/Downloads/NWLAND-nwland_dev/outputs/2021_05_14_carbon_input_nwland_testB3_devAll_noOcean/

plot_caland(
  scen_fnames = c("NWL_Proto_v1_Hist_protoA_hist_output_mean_BC1_NR120.xls", 
                  "NWL_Proto_v1_Alt_A_protoA_hist_output_mean_BC1_NR120.xls"),
  scen_snames = c("Baseline","A"),
  data_dir = "./outputs/a",
  reg = c("All_region"), 
  lt = c("All_land", "Barren", "Cultivated", "Desert", "Developed_all", "Forest", "Grassland", "Ice", "Meadow", "Riparian", "Savanna", "Shrubland", "Sparse", "Water", "Wetland", "Woodland"),
  own = c("All_own"),
  figdir = "figures"
)