Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R-使用'制作一个重复序列;代表';_R_Rep - Fatal编程技术网

R-使用'制作一个重复序列;代表';

R-使用'制作一个重复序列;代表';,r,rep,R,Rep,我想知道是否有一种更简单的方法来制作一个列表,例如10'4',20'6'和30'3',然后手工编写(example只需使用rep,两个参数都是所需的向量: x <- rep(c(4, 6, 3), c(10, 20, 30)) table(x) 3 4 6 30 10 20 x我想要的输出是:“444444466666666666666333333333333333333333333333333333333333333”rep(c(4,6,3),c(10,20,30))就是这

我想知道是否有一种更简单的方法来制作一个列表,例如10'4',20'6'和30'3',然后手工编写(
example只需使用
rep
,两个参数都是所需的向量:

x <- rep(c(4, 6, 3), c(10, 20, 30))
table(x)

 3  4  6 
30 10 20 

x我想要的输出是:“444444466666666666666333333333333333333333333333333333333333333”
rep(c(4,6,3),c(10,20,30))
就是这样!不需要表格部分,但其余的都很好用。谢谢!!