[R] Determine the data type of a function to an argument

2006-06-20 Thread Alex Restrepo
Hello All: How can I determing the types of args passed to an R function? For example, given the following: calculate - function(...) { args - list(...) argName = names(args) if (arg1 == character) cat(arg1 is a character) else

Re: [R] Determine the data type of a function to an argument

2006-06-20 Thread Francisco J. Zagmutt
Look at ?class and perhaps is?. i.e. x=c(1,2,3) class(x) [1] character x=c(1,2,3) class(x) [1] numeric I hope this helps Francisco Dr. Francisco J. Zagmutt College of Veterinary Medicine and Biomedical Sciences Colorado State University From: Alex Restrepo [EMAIL PROTECTED] To: