r - R purrr pmap 无法从闭包中拔出
问题描述
我在这里做错了什么?:
library(tidyverse)
calling_dataset <- tibble(filepath="xxx.csv")
testfunction1 <-
getdrugdata <- function(filepath){
print(filepath)
}
test1 <- calling_dataset %>%
purrr::pmap_df(list(
.$filepath), testfunction1)
产生的错误是:错误:无法从闭包中取出。
解决方案
更改调用:
purrr::pmap_df(list(calling_dataset$filepath), testfunction1)
秩序恢复了宇宙。
推荐阅读
- php - 在PHP中将二进制字符串转换为图像?
- unit-testing - 当有人说“(仅)测试公共 api”时,“公共 api”到底是什么意思?
- javascript - 使用特殊字符解析 JSON 数组
- java - 比较我的数组中的元素以查找对,但不知道找到两对时该怎么做
- java - 通过 JMeter 正则表达式提取器从响应中提取 ID
- scala - 创建一个数组数组,每个数组都有索引
- arrays - 删除具有空数组的键
- orange - Orange3 build-macos-app.sh 显示自定义小部件类别,但不显示小部件本身
- arrays - 如何获取 REST API JSON 数据并将它们作为表格提取到 Google 电子表格?
- java - 在 Hibernate 5.3 上获取带有 id 的实体列表