Closed DillonHammill closed 6 years ago
Hi guys,
This is probably a simple question, but what is the best way to work with character string gating arguments in the GatingTemplate? See example below:
# Function for finding gate coordinates - take argument type with options "beads" and "cells" coords <- function(type){ if(type == "beads"){ "Do something" }else if(type == "cells"){ "Do something else" } } # Gating function gate_coords <- function(fr, pp_res, channels, filterId = "", type = NULL, ...){ type <- type # error object 'beads' not found # Calls coords() with type argument coords(type = type) } # GatingTemplate template <- add_pop( gs, alias = "name", parent = "root", pop = "+", dims = "FSC-A,SSC-A", gating_method = "", gating_args = "type=beads" )
I would like to pass the argument to gating function by not sure of the conversions required - the argument is being treated as an unknown R object.
How can I convert this argument to character string that I can use?
Thanks for your help!
Dillon
Tried single quotes within the string? gating_args = "type='beads'"
Perfect! Thanks @SamGG, I did not know that you could do that!
Hi guys,
This is probably a simple question, but what is the best way to work with character string gating arguments in the GatingTemplate? See example below:
I would like to pass the argument to gating function by not sure of the conversions required - the argument is being treated as an unknown R object.
How can I convert this argument to character string that I can use?
Thanks for your help!
Dillon