Skip to content

Instantly share code, notes, and snippets.

@leipzig
Created April 4, 2019 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leipzig/c4d61da68e3f4ea21b75fec73e08422e to your computer and use it in GitHub Desktop.
Save leipzig/c4d61da68e3f4ea21b75fec73e08422e to your computer and use it in GitHub Desktop.
selecting photos
mz<-c('007','011','017','020','025','046','076','077','090','102','104')
sa<-c('008', '017', '037', '058', '069', '109', '097', '102','028')
jl<-c('075','060','061','106','066','070','104','059','017','001','015','014','038','010','005','039','006','020','031','094')
rn<-str_pad(seq(1,109), 3, pad = "0")
pics<-data.frame(id=rn,mz=FALSE,sa=FALSE,jl=FALSE)
pics[pics$id %in% mz,"mz"]<-TRUE
pics[pics$id %in% sa,"sa"]<-TRUE
pics[pics$id %in% jl,"jl"]<-TRUE
pics$tot<-rowSums(pics[c("mz","sa","jl")])
pics[1:15,"type"]<-"tablechat"
pics[16:21,"type"]<-"stairs"
pics[22:34,"type"]<-"headshot"
pics[35:54,"type"]<-"office"
pics[55:88,"type"]<-"meeting"
pics[89:100,"type"]<-"headshot"
pics[101:109,"type"]<-"groupshot"
selection<-pics[unique(c(which(pics$mz==TRUE),which(pics$tot>1),which(pics$type=="headshot" & pics$tot>0))),"id"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment