@@ -77,11 +77,12 @@ for (lvl in names(access_summary)) {
7777}
7878
7979# Keep only public records (access_level == 4)
80- non_public <- sum(traitsview $ access_level != 4 , na.rm = TRUE )
80+ # Explicit NA check; rows with NA access_level are not public
81+ non_public <- sum(traitsview $ access_level != 4 | is.na(traitsview $ access_level ))
8182if (non_public > 0 ) {
82- log_info(sprintf(" Removing %d non-public records (access_level != 4)" , non_public ))
83- traitsview <- traitsview [traitsview $ access_level == 4 , ]
83+ log_info(sprintf(" Removing %d non-public records (access_level != 4 or NA)" , non_public ))
8484}
85+ traitsview <- traitsview [traitsview $ access_level == 4 & ! is.na(traitsview $ access_level ), ]
8586
8687# Drop access_level column (all remaining records are public)
8788traitsview $ access_level <- NULL
@@ -184,6 +185,10 @@ datasets <- c("traitsview", "species", "sites", "variables", "citations",
184185 " managements" , " entities" , " pfts_species" , " pfts_priors" ,
185186 " managements_treatments" , " cultivars_pfts" )
186187
188+ # NOTE: paths are relative to the repo root, not installed package.
189+ # data-raw/ is excluded from the built package via .Rbuildignore.
190+ # These paths are for provenance, they point to the source CSVs
191+ # in the repository, not files shipped with installed package.
187192resources <- lapply(datasets , function (nm ) {
188193 df <- get(nm )
189194 base <- list (
0 commit comments