为什么这不会导致错误?
> str(u)
'data.frame': 8879 obs. of 2 variables:
$ bundle_qty: int 1 1 1 1 1 1 1 1 1 1 ...
$ mail_a : num 1 1 1 1 0 0 0 1 1 0 ...
> head(u$mail)
[1] 1 1 1 1 0 0
Run Code Online (Sandbox Code Playgroud)
变量mail不在data.frame中u!不应该u$mail回来NULL?
即使我从头开始使用虚拟数据:
> rm(list=ls())
> u <- data.frame( bundle_qty = c(1,1,1,1), mail_a = c(1,1,1,1))
> str(u)
'data.frame': 4 obs. of 2 variables:
$ bundle_qty: num …Run Code Online (Sandbox Code Playgroud) 所以我创造了这个变量,被称为mc_split_device该数据表称为内mc_with_devices。但是,如果键入,mc_with_devices$mc_split我将获得列的值,mc_split_device而我从未使用name创建任何变量mc_split。