Error saying Error object packages not found when trying to web scrap using r

0 votes

I'm trying to scrap a webpage and this is my code.

url_base <- "https://cran.r-project.org/web/packages/available_packages_by_name.html"
map_df(1:100, function(i){
                page <- read_html(sprintf(url_base,i))
                data.frame(IssueID = html_text(html_nodes(page,"h1")),
                       heading = html_text(html_nodes(page,"td")),
                       description = html_text(html_nodes(page,"td")))
}) <- packages

I end up with the following error. 

Error: object 'packages' not found

Excuse me if its a very stupid doubt. Thank you :)

Nov 21, 2018 in Data Analytics by Ali
• 11,360 points

edited Nov 21, 2018 by Ali 1,138 views

1 answer to this question.

0 votes

Hey @Ali, Its a very silly mistake. change the last line to this:

}) -> packages
answered Nov 21, 2018 by Maverick
• 10,840 points

Related Questions In Data Analytics

0 votes
1 answer

Error saying "Error in df$item : object of type 'closure' is not subsettable" when trying to use arules package

Try replacing ID <- c("A123","A123","A123","A123","B456","B456","B456") item <- c("bread", "butter", ...READ MORE

answered Nov 15, 2018 in Data Analytics by Maverick
• 10,840 points
1,818 views
0 votes
1 answer
0 votes
1 answer

Error saying "duplicate 'row.names' are not allowed" when trying to setup my data for the mlogit-package

Take out the chid.var argument in your call to mlogit.data, ...READ MORE

answered Nov 12, 2018 in Data Analytics by Maverick
• 10,840 points
2,082 views
+1 vote
1 answer
0 votes
1 answer

Error saying "could not find function "read_html"" when trying to use read_html function

Hey @Ali, Execute the following two commands: install.packages(&l ...READ MORE

answered Nov 21, 2018 in Data Analytics by Maverick
• 10,840 points
4,826 views
0 votes
1 answer
+1 vote
1 answer

"Error in eval(ei, envir) : object 'RDX2' not found" when trying to source the code in R

This is a very common issue that ...READ MORE

answered Oct 30, 2018 in Data Analytics by Maverick
• 10,840 points
5,140 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP