我有一个这样的数据帧:
players<-data.frame(
stringsAsFactors = FALSE,
seat = c("Seat 1","Seat 2","Seat 3",
"Seat 4","Seat 5","Seat 6"),
jugador = c("MSC1266","Cereghetti16",
"Trytopredict","klariti","P.H.F.17","FerzRu"),
stack = c("1.90 ", "2.03 ", "2 ", "2.60 ", "1.52 ", "3.99 "),
posicion = c("BU", "SB", "BB", "EP", "MP", "CO"),
hand = c("218755078355","218755078355",
"218755078355","218755078355","218755078355",
"218755078355"))
我想将它嵌套在"hand“列中,以便有一行,该列的所有值都在一个向量中。但是当我这样做的时候:
jugadores %>% nest(hand)
# A tibble: 6 x 5
seat jugador stack posicion data
<chr> <chr> <chr> <chr> <list>
1 Seat 1 MSC1266 "1.90 " BU <tibble [1 x 1]>
2 Seat 2 Cereghetti16 "2.03 " SB <tibble [1 x 1]>
3 Seat 3 Trytopredict "2 " BB <tibble [1 x 1]>
4 Seat 4 klariti "2.60 " EP <tibble [1 x 1]>
5 Seat 5 P.H.F.17 "1.52 " MP <tibble [1 x 1]>
6 Seat 6 FerzRu "3.99 " CO <tibble [1 x 1]>
Warning message:
All elements of `...` must be named.
Did you want `data = c(hand)`? 发布于 2020-09-29 23:54:08
players %>%
group_by(hand) %>%
nest()或
players %>%
group_nest(hand)https://stackoverflow.com/questions/64123091
复制相似问题