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.