I think this is a simple question.
As for many languages, you need to provide the return type before you write a function. however I didn't find solution for R. the only way I can do right now is to make a call, and using str(),mode(),class() to check the returned value.
but if the function takes long time, I can't use this way Is there a simple way to know the return type of the function even before I call it?
by the way, I could find some of return type by typing ?function_name, but many helps didn't mention the return type of the function.
Okey, this is the senario why known this info could be so useful:
1.I need the return type to see, after I got the return value, how should I deal with the return, for simple case, if I don't know the return type is list or dataframe, I don't actually have the info to decide which function to use next~Sometimes you don't know you got S3 or S4 object, which made you don't know you should use @ or $ to deal with it
2.suppose there are two functions in two package do the same thing, one return me a connection and another return me a html object, if I knew the return type then I can easily pick which function I should use based on my case. Sometimes you only have limit times to connect to some places, then you will waste several of your chances to check out the return type