R/whichbutt.R

Defines functions `whichbutt`

`whichbutt` <-
function(v, buttons)
  {
  ##X## return which button was clicked   
    butts = rep(0, length(v$x))
    
    for(i in 1:length(butts))
      {
        
        KT = which(v$x[i]>buttons$x1 & v$x[i]<buttons$x2 & v$y[i]>buttons$y1 & v$y[i]<buttons$y2  )
        
        
        if(length(KT)>0)
          {
            
            butts[i] = KT
          }
      }
    
    return(butts)
    
  }

Try the RPMG package in your browser

Any scripts or data that you put into this service are public.

RPMG documentation built on Aug. 19, 2023, 5:12 p.m.