I have a df with two curve definitions, each consists of two points and a curvature value. The goal is to plot two individual curves using ggplot2
You could use a for loop to build up your ggplot call as a text string and evaluate the string once the for loop finishes.
graphString <- "ggplot(df) "
for(i in 1:nrow(df)){
newCurve <- paste(" + geom_curve(data = df[",i,", ], aes(x = x, y = y, xend = xend, yend = yend), curvature = df$curvature[",i,"])", sep="")
graphString <- paste(graphString, newCurve,sep="")
}
eval(parse(text = graphString))