Error saying Error in map df 1 function i could not find function map df in R

+1 vote

I have the following code wrt web scraping using R

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

But I end up with the following error, idk why?

Error in map_df(1, function(i) { : could not find function "map_df"
Nov 20, 2018 in Data Analytics by Ali
• 11,300 points
2,300 views

1 answer to this question.

0 votes

Make sure you’ve installed the package purr and in case you’ve already installed it and still facing the same error then load that into the library using the following command

library(purr)
answered Nov 20, 2018 by Maverick
• 10,840 points

Related Questions In Data Analytics

+3 votes
2 answers

Error: could not find function - R Programming

Yes, Just like @Maverik said, It happens ...READ MORE

answered Aug 22, 2019 in Data Analytics by anonymous
• 32,910 points
23,445 views
+1 vote
1 answer
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(&l ...READ MORE

answered Nov 20, 2018 in Data Analytics by Maverick
• 10,840 points
1,209 views
+1 vote
1 answer

Error saying "could not find function "shinyUI"" in shiny R

Its a small spelling mistake that you've ...READ MORE

answered Nov 28, 2018 in Data Analytics by Maverick
• 10,840 points
1,145 views
+1 vote
1 answer

Error saying "could not find function dashboardPage" in shiny R

Include this line in the code: Library(shinydashboard) READ MORE

answered Nov 28, 2018 in Data Analytics by Maverick
• 10,840 points
901 views