首页 > 解决方案 > 在 R 的 GoogleWay 库中使用 Places API 时出现 next_page_token 错误

问题描述

我在 R 中使用带有 Googleway 包的 Places API 来提取 near_places。

最初,在提供密钥后,我输入查询并获取值。

have_places <- google_places(location = c(1.4434068, 103.7769701),
                         radius = 500,
                         simplify = FALSE,
                         key = key)

之后,当我设置令牌时,出现以下错误。

> token <- have_places$next_page_token
Error in have_places$next_page_token : 
 $ operator is invalid for atomic vectors

关于出了什么问题的任何建议?

我确实搜索了互联网,当我输入以下命令时;

令牌 <- have_places[3]

我可以获得 next_page_token,但是带有一些垃圾值。

标签: rgoogleway

解决方案


推荐阅读