kevinwolz / hisafer

An R toolbox for the Hi-sAFe biophysical agroforestry model
6 stars 4 forks source link

Facilitate selecting variables #79

Closed FrancescoReyes closed 6 years ago

FrancescoReyes commented 6 years ago

Hi-sAFe has lots of variables and you might not know the name of the most interesting variable for the analysis you want to carry on. Currently, the distance matrix method to identify the variable names closest to your search sometimes returns only limited results.

You could search in which variable names the input variable_name is contained within the dataframe:

var_names <- function( dati, string_in_variableName ){ return( names( dati )[ which( grepl( string_in_variableName, names( dati ) ) ) ] ) }

Variable names could also be grouped according to biological or physical compartments present on the scene, such as "tree", "crop" "soil". This in order to be able to see together all the variables related to one of these compartments.

kevinwolz commented 6 years ago

This functionality already exists in hip_params() and hop_params(). There must be a bug.