[英]Creating a new column based on values obtained from different column, using mutate() and case_when function in R
[英]Add new column using case_when of other column in R
這應該有效:
library(lubridate)
library(dplyr)
df %>%
mutate(
result = wday(created_at - hours(9), label = TRUE)
)
如果您有問題,請使用dput()
發布可重現的數據樣本。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.