我需要完成列,只要有文字在其他列与
当前帧
first_column <- c("eeer","","","sdfdfdsf", "sdfsdfdsf","faffa", "we", "", "", "", "", "", "eeee", "", "wqwq", "", "ttetxg", "", "sf", "sf","f", "dfsdf", "sqdweg", "sfsfdsdvghhh", "")
second_column <- c("","", "","", "", "", "", "renato paulo", "", "", "", "", "", "carlos gomes", "", "", "", "vitor", "","","","","","", "Cassia rabelo")
current_dataframe <- data.frame(first_column, second_column)
字符串
期望输出
first_column <- c("eeer","","","sdfdfdsf", "sdfsdfdsf","faffa", "we", "", "", "", "", "", "eeee", "", "wqwq", "", "ttetxg", "", "sf", "sf","f", "dfsdf", "sqdweg", "sfsfdsdvghhh", "")
second_column <- c("","", "","renato paulo", "renato paulo", "renato paulo", "renato paulo", "", "", "", "", "", "carlos gomes", "", "", "", "vitor", "", "Cassia rabelo","Cassia rabelo","Cassia rabelo","Cassia rabelo","Cassia rabelo","Cassia rabelo", "")
desired_output <- data.frame(first_column, second_column)
型
我试着使用fill downup功能,它不像我需要的那样工作。有人能帮助我吗?
1条答案
按热度按时间6ojccjat1#
一种方法,包括将 second_column 上移1。
字符串