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 20, 2018 in Data Analytics by Ali
• 10,450 points

edited Nov 20, 2018 by Ali 54 views

1 answer to this question.

0 votes

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

}) -> packages
answered Nov 20, 2018 by Maverick
• 10,040 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,040 points
108 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,040 points
247 views
0 votes
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(“ ...READ MORE

answered Nov 20, 2018 in Data Analytics by Maverick
• 10,040 points
182 views
0 votes
1 answer
0 votes
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,040 points
454 views