error in importing XML data from the website

i will appreciate if someone help me to figure out the following 5 errors when i follow the script for download XML data from website:

  1. script:

Import XML data from web (must be online)

df <- "http://ergast.com/api/f1/1954/results/1.xml" %>%
XML2Obs() %>%
collapse_obs() %>%
print()

error message from console

Error in function (type, msg, asError = TRUE) :
Could not resolve host:

  1. script:

df %<>% # %<>% is the compound assignment pipe operator
as_tibble() %>% # Save as tibble
select( # Select data
Race = matches("RaceName"), # Get race name
FirstName = matches("GivenName"), # Get first name
LastName = matches("FamilyName"), # Get last name
Team = matches("Constructor//Name") # Get team name
) %>%
print() # Each column is a list with two values (oops)

error msg in console

Error: C stack usage 15922912 is too close to the limit

  1. script:

df %<>% # %<>% is the compound assignment pipe operator
as_tibble() %>% # Save as tibble
select( # Select data
Race = matches("RaceName"), # Get race name
FirstName = matches("GivenName"), # Get first name
LastName = matches("FamilyName"), # Get last name
Team = matches("Constructor//Name") # Get team name
) %>%
print() # Each column is a list with two values (oops)

error message on console screen

Error: C stack usage 15922912 is too close to the limit

  1. script:

Rewrite columns to keep just the "XML_value"

df %<>% # %<>% is the compound assignment pipe operator
mutate_all(~ (.[,"XML_value"])) %>%
print()

error msg on console

Error in UseMethod("tbl_vars") :
no applicable method for 'tbl_vars' applied to an object of class "function"

  1. script

FILTER & PRINT DATA

Select just the Grand Prix races.

df %<>%
filter(str_detect(Race,"Prix")) %>%
print()

error message on console

Error in UseMethod("filter") :
no applicable method for 'filter' applied to an object of class "function"

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.