Please what mistakes are in this? I'm just learning R

Install.packages("httr")
Install.packages("rvest")

library(httr)
library(rvest)

base_URL <- "https://en.wikipedia.org/w/index.php"
URL_parameter <- "title=Template:COVID-19_testing_by_country"

get_wiki_covid19_page <- function() {
wiki_base_url <- read_html(base_URL)
#wiki_URL_parameter <- read_html("title=Template:COVID-19_testing_by_country")
contn_URL <- paste(wiki_base_url, URL_parameter, sep = "?")
get_request <- GET(contn_URL)
return(get_request)

}

The most obvious issue is the lack of library() statements. read_html and GET are not base functions

Appreciate your response.

Although not shown above, I have actually done the below before running the code:
Install.packages("httr")
Install.packages("rvest")

library(httr)
library(rvest)

library(httr)
library(rvest)

base_URL <- "https://en.wikipedia.org/w/index.php"
URL_parameter <- "title=Template:COVID-19_testing_by_country"
contn_URL <- paste(base_URL, URL_parameter, sep = "?")
  html_content <- read_html(contn_URL)
  alternative_html_content <- GET(contn_URL)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.