java数据分块后进行组合,使用分位数函数后组合数据帧的行向量

CI_95_outcomes_male

我想你忘了把 colnames 放在 CI_95_outcomes_male 左右 . 但是's another problem here. I'假设 mean_outcomes_male 是一个向量,在这种情况下 colnames(mean_outcomes_male) 是 NULL .

data.frame(mean_outcomes_male,CI_95_outcomes_male)

即使 CI_95_outcomes_male 是正确的,上面的命令也会产生一个4x5数据帧,第一列是 mean_outcomes_male 向量,第二列是第一个变量的 CI_95_outcomes_male 值(每行重复一次),......和第五列column是第四个变量的 CI_95_outcomes_male 值(每行重复一次) .

你需要做这样的事情:

set.seed(42)

# Generate a random dataset for outcomes_male_dt with 4 variables and n rows

n

outcomes_male_dt

# I'm assuming you want the 95th percentile of each variable in outcomes_male_dt and store them in CI_95_outcomes_male

ptl

CI_95_outcomes_male

# I'm going to assume that mean_outcomes_male is a vector of means for all the variables in outcomes_male_dt

mean_outcomes_male

# You want to end up with a 2x4 matrix - I'm assuming you meant row 1 will be the means, and row 2 will be the 95th percentiles, and the columns will be the variables

want

colnames(want)

row.names(want)

want # Resulting matrix

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值