I have a data frame with with some data to plot and also a link to a website.
I want to create an r markdown document with a graph in the left column and a link and maybe some more text and stats in the right column. For the next line in the data frame, I start a new column in the table.
df <- data.frame(yval=c(1,2,3), links=c('http://u.com/1.html','http://u.com/2.html','http://u.com/3.html'))
for(line in seq(nrow(df))) {
ggplot(df[line,], aes(x=factor(1),y=yval)) + geom_bar(stat='identity')
print(df[line,'links'])
}
Actually, the table would be nice to have, I could also life with just image, link, image, link... But actually I have no idea how to produce a link out of my for loop and also creating the plot in the same loop.