Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2014
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. getValue = function(pos, start, end, genes) {
  2. temp = filter(pos, start <= pos, pos <= end)
  3. small=genes[genes$check %in% temp,]
  4. justgenes=small$char
  5. justpos=small$pos
  6. outlist=list("pos"=justpos,"genes"=justgenes)
  7. return(outlist)
  8. }
  9.  
  10. x=seq(1,100,by=5)
  11. y=seq(3,100,by=5)
  12. comb=cbind(x,y)
  13. comb=as.data.frame(comb)
  14. check=c(1,1,1,2,3,3,2,3,61,61,62,62)
  15. chars=c("A","B","C","D","E","F","G","H","I","J","K","L")
  16. table=cbind(check,genes)
  17. output=sapply(check, getValue, start=x, end=y, genes=table)
  18.  
  19. Error in match.arg(method) : 'arg' must be NULL or a character vector
  20.  
  21. getValue = function(pos, start, end, genes) {
  22. pos=as.character(pos)
  23. temp = filter(pos, start <= pos, pos <= end)
  24. small=genes[genes$check %in% temp,]
  25. justgenes=small$char
  26. justpos=small$pos
  27. outlist=list("pos"=justpos,"genes"=justgenes)
  28. return(outlist)
  29. }
  30.  
  31. Error in UseMethod("filter") :
  32. no applicable method for 'filter' applied to an object of class "character"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement