Passer au contenu

This function calculate distances between plot and TNT (Non Treated Treatment) and find the nearest TNT for each plot.

Utilisation

nearest_tnt(self, scale_factor_x = 2.5, scale_factor_y = 1, code_tnt = "TNT")

Arguments

self

an instance of the UserData R6 class containing metadata with plot_desc and moda_desc

scale_factor_x

multiplier factor for calculating distances along the x axis (default = 2.5, assuming x axis for vines rows)

scale_factor_y

multiplier factor for calculating distances along the y axis (default = 1)

code_tnt

string to identify in TNT in the row of the dataframe, by default "TNT"

Valeur de retour

a dataframe with plot_id associated with one (or more) tnt_id, and their calculated distance

Détails

This function use the plot description, that must have plot_x and plot_y given for each plot. Plot description is merged with modality description, assuming that xp_trt_name contains "TNT" to identify plot with TNT treatment. The results is stored in self$plot_tnt_association$nearest_association