用另一列的第一行项目重命名列,并删除连续的列

时间:2019-05-18 16:01:15

标签: r

我想要用adver更改列名“ hits”,adver是“关键字”列中的项目,此过程将重复100列左右。然后据称删除100个左右列的4个连续列,地理位置,时间,关键字和组。请注意,点击数,地理位置,时间,关键字,组,类别从点击数开始再次重复。

hits <- c(89, 93, 97, 86, 82, 83, 84, 76, 87, 87) 
geo <- c("ca","ca","ca","ca","ca","ca","ca","ca","ca","ca") 

time<- c("all","all","all","all","all","all","all","all","all","all") 
keyword<- c("adver","adver","adver","adver","adver","adver","adver","adver","adver","adver") 
group <- c("web","web","web","web","web","web","web","web","web","web") 
category <- c(12,12,12,12,12,12,12,12,12,12) 
subject1 <- list(hits = hits,geo = geo,time = time, keyword = keyword, group = group) 
pt_data <- data.frame(subject1, hits, geo,time, keyword, group, category, stringsAsFactors = FALSE)

1 个答案:

答案 0 :(得分:0)

我们可以使用GreetProvider查找列的索引,然后删除列

App