我试图将此StatsBomb数据写入CSV,但我不断收到以下错误消息:Error in stream_delim_(df, path, ..., bom = bom, quote_escape = quote_escape) : Don't know how to handle vector of type list.
我迷路了(尝试了很多东西),不确定我在这里做错了什么。有人知道怎么解决这个问题吗?我把代码写在下面。
library(StatsBombR)
library(tidyverse)
### Read in all free events and matches from the FAWSL
data <- StatsBombFreeEvents()
matches <- FreeMatches(Competitions = 72)
### Clean and separate all data loaded above
dataclean <- allclean(data)
### Filter event data to include only FAWSL data.
data1 <- dataclean %>%
filter(dataclean$competition_id == 72)
### Join event and match data by "match_id"
data1 <- left_join(data1, matches, by = "match_id")
FullData <- data1 %>%
select(-c(related_events, tactics.lineup, shot.freeze_frame, location, pass.end_location, shot.end_location, goalkeeper.end_location))
setwd()
write_csv(FullData, "StatsBomb_FullData.csv")
2条答案
按热度按时间0lvr5msh1#
我也有同样的问题。取消列表修复了我的。
qvsjd97n2#
创建一个不带vector的 Dataframe 和另一个vector的 Dataframe :