I have a ggplot2 function that includes the following command:
sp <- sp + geom_point() + gs + scale_linetype_manual(values =
c('solid', 'longdash','dashed', 'twodash', 'dotdash', 'dotted'), labels=labls)
This is used by users with different datasets. If I define the object labls as a vector (e.g. labls=c("cow","horse","chicken")) this works fine, of course. However, I want it to refer to the default labeling when the object does not exist (in this case: 1, 2, 3).
Is there a quick and elegant way to include this condition? I've stumbled upon the "ifelse" function, but am not sure how to use this in reference to the object I'm letting "labels" request?
Thanks

