Automate User-Defined Function to Process Dataframes

I'd like to create a code that takes a varying number of dataframes X1, X2, X3...XN containing four columns of data time, height, start, group and automatically runs them through a user-defined function HL_plot from Vulntookit . I'm guessing I could use a for loop, but am still very new to R and a little stuck on this step. If I use the function manually, the code looks like this:

HL.plot (level = X1[, 2], time = X1[, 1], period = 0.3, 
         phantom = TRUE, tides = "H")
HL.plot (level = X2[, 2], time = X2[, 1], period = 0.3, 
         phantom = TRUE, tides = "H")
HL.plot (level = X3[, 2], time = X3[, 1], period = 0.3, 
         phantom = TRUE, tides = "H")
HL.plot (level = XN[, 2], time = XN[, 1], period = 0.3, 
         phantom = TRUE, tides = "H")

The function plots the second height and first time columns of data.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.