Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ベクトルの各インデックスに対して上限 (入力が整数でない場合) または 1 つ大きい整数 (入力が整数の場合) を取得するエレガントな方法はありますか?
たとえば、ベクトル x
x = c(0, 4, 5.3333, 6.25)
ベクトルyになる
1, 5, 6, 7
これは問題について少し異なる方法で考えます
y <- floor(x+1)
> y [1] 1 5 6 7