Create Dataframe

Create Dataframe with random NA
datelist = seq(ymd_hms('1980-01-01 00:00:00'),ymd_hms('1980-07-01 00:00:00'), by = '60 mins') df = data.frame(replicate(4,sample(0:130,4369,rep=TRUE))) nbr_missing<-1000 y<-data.frame(row=sample(nrow(df),size = nbr_missing,replace = T),               col=sample(ncol(df),size = nbr_missing,replace = T)) y<-y[!duplicated(y),] df[as.matrix(y)]<-NA testframe = as.data.frame(cbind(datelist,df))