相关疑难解决方法(0)

在LHS中为一行分配多个新变量

我想在R中的一行中分配多个变量.是否可以这样做?

values # initialize some vector of values
(a, b) = values[c(2,4)] # assign a and b to values at 2 and 4 indices of 'values'
Run Code Online (Sandbox Code Playgroud)

通常我想在一行中分配大约5-6个变量,而不是多行.还有其他选择吗?

variables tuples r variable-assignment assign

79
推荐指数
10
解决办法
5万
查看次数

标签 统计

assign ×1

r ×1

tuples ×1

variable-assignment ×1

variables ×1