I am an R beginner who is trying to look through all the top 500/1000 vote/frequent questions in StackOverflow.
I need a data.frame with two variables that contain the question and the hyperlink of this question, respectively.
The webpage is here and need hyperlinks like this:
<h3><a href="/questions/5963269/how-to-make-a-great-r-reproducible-example" class="question-hyperlink">How to make a great R reproducible example</a></h3>
output like this:
question link
1 how-to-make-a-great-r-reproducible-example <questions/5963269/how-to-make-a-great-r-reproducible-example>
2 ...
3 ...
sorry for my confused questions: I would like to have the hyperlink that can link to the webpage by clicking it. so I get the full url by
web <- data.frame(sapply(answer$link, function(x) {paste("https://stackoverflow.com",x, sep = "")}))
or
web <- data.frame(sapply(df[2], function(x) {paste("https://stackoverflow.com",x, sep = "")}))
web[1]
https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
like [here] (How to make a great R reproducible example)
I output this file to txt or CSV, but the links could not link the page when I click it.
could you improve it? thanks again
@DaveT @QHarr