You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the pre-attributed background points database background_CONUS.sqlite contains camelCase variable names in the "geo*" series of predictors, e.g., geoClay, geoSDune.
Downstream, this causes the specific model-run attribute database (<cutecode>_yyyymmdd_hhmmss_att.sqlite) to have those camelCase conventions.
When 3_createModel.R runs it loads:
envvar_list <- The environmental variable names from the tracking database (db = SDM_lookupAndTracking.sqlite; column = lkpEnvVars.gridName) which are lowercase.
df.abs <- The actual background points from the model run (<cutecode>_yyyymmdd_hhmmss_att.sqlite) which are in camelcase
Line 82 is using the names from df.abs, so the camelCase version in df.abs won't pick up the lowercase versions in envvar_list, thus unintentionally dropping those from writing out the metadata in tblModelResultsVarsUsed in SDM_lookupAndTracking.sqlite
envvar_list<- names(df.abs)[names(df.abs) %in%envvar_list] # gets a list of environmental variables
Two possible solutions:
force tolower()
names(df.abs) <- tolower(names(df.abs))
Fix the column names in background_CONUS.sqlite.
Option 1 is easy and only one line extra, but curious if you think Option 2 is also a good idea.
The text was updated successfully, but these errors were encountered:
Good sleuthing! Yes, we are in a bit of flux as the names in earlier versions of SDM_lookupAndTracking.sqlite were also in camelcase. You are right that in the long-term we should take option 2 and set it up as best practice to always use only lower case for gridnames.
Sounds like it is also safest to always account for that best practice to be broken; which means we should take your option 1 no matter what.
Currently, the pre-attributed background points database
background_CONUS.sqlite
contains camelCase variable names in the "geo*" series of predictors, e.g.,geoClay
,geoSDune
.Downstream, this causes the specific model-run attribute database (
<cutecode>_yyyymmdd_hhmmss_att.sqlite
) to have those camelCase conventions.When
3_createModel
.R runs it loads:envvar_list <-
The environmental variable names from the tracking database (db =SDM_lookupAndTracking.sqlite
; column =lkpEnvVars.gridName
) which are lowercase.df.abs <-
The actual background points from the model run (<cutecode>_yyyymmdd_hhmmss_att.sqlite
) which are in camelcaseLine 82 is using the names from
df.abs
, so the camelCase version indf.abs
won't pick up the lowercase versions inenvvar_list
, thus unintentionally dropping those from writing out the metadata intblModelResultsVarsUsed
inSDM_lookupAndTracking.sqlite
Two possible solutions:
tolower()
background_CONUS.sqlite
.Option 1 is easy and only one line extra, but curious if you think Option 2 is also a good idea.
The text was updated successfully, but these errors were encountered: