我以前也尝试过这种方法,但是当我再次尝试使用dplyr库时,它总是无法使用select命令显示数据。有人能提供反馈吗?
Manufaktur `Layar(inci)` `Harga(Dollar)`
<chr> <dbl> <dbl>
1 Sharp 46 736
2 Samsung 52 1150
3 Samsung 46 895
4 Sony 40 625
5 Sharp 42 773
6 Samsung 46 961
7 Samsung 40 686
8 Sharp 37 574
9 Sharp 46 1000
10 Sony 40 722当我想用select(tv$'Layar(inci)')显示表中的数据时,会出现这样的错误:Error in UseMethod("select") :no applicable method for 'select' applied to an object of class "c('double', 'numeric')"
发布于 2021-06-24 01:51:36
select需要一个data.framework/tibble(基于?select)
.data :数据帧、数据帧扩展(例如tibble)或延迟数据帧(例如来自dbplyr或dtplyr)。
而不是向量(tv$'Layar(inci)' )
library(dplyr)
tv %>%
dplyr::select(`Layar(inci)`)使用可复制的示例
data(iris)
dplyr::select(iris$Petal.Length)
Error in UseMethod("select") :
no applicable method for 'select' applied to an object of class "c('double', 'numeric')"与正确的语法一起使用时
iris %>%
dplyr::select(Petal.Length) %>%
head
Petal.Length
1 1.4
2 1.4
3 1.3
4 1.5
5 1.4
6 1.7https://stackoverflow.com/questions/68108724
复制相似问题