我正在尝试从API查询数据并将其作为表格获取。 这是我的代码:
source("keys.R")
base_uri_google <- "https://www.googleapis.com/civicinfo/v2/representatives"
params <- list(address = "Seattle,WA", key = google.key)
google_response <- GET(base_uri_google, query = params)
request_body <- content(google_response)
offices_body <- request_body$offices
officials_body <- request_body$officials
offices_table <- offices_body %>% select(name)
officials_table <- officials_body %>% select(name)
每当我运行最后两行代码时,它就会向我显示所需的数据,但随后出现:
Selection:
Enter an item from the menu, or 0 to exit.
然后当我尝试访问这两个变量时,找不到它们。
我该如何解决?