【发布时间】:2020-05-22 20:21:10
【问题描述】:
给定一个长度为n 的数据框,我运行了一个应用函数并将结果分配给数据框上的一个新列:
my_df$index <- sapply(my_df$local_db_uuid,function(x) which(my_df$remote_db_uuid== x))
但是,我注意到以下内容:
join_ref_id_complete$index %>% length()
# returns length of dataframe rows
对比:
join_ref_id_complete$index %>% unlist() %>% length()
# returns less than length of dataframe rows
这里的长度是怎么回事?这些是缺失值吗?
【问题讨论】: