Problems with R polymorphic UDTF
I'm attempting to write a polymorphic kmeans function that returns all the input fields AND the integer cluster identifier. I have user defined scalar functions working just fine, the example transform function and I have managed a polymorphic input transform. The problem is when I want the output to be polymorphic. I have defined outtypecallback and a related function. The outtypecallback function is being called and (by saving objects to file from within the code) I figured out the inbound spec for x in my outtypecallback function and hence, I assume, the spec for the return object. Here's what the return object looks like given 2 float inputs and the cluster identifier (integer) > x datatype length scale name 1 float 0 0 p1 2 float 0 0 p2 3 int 0 0 Cluster > str(x) 'data.frame': 3 obs. of 4 variables: $ datatype: Factor w/ 2 levels "float","int": 1 1 2 $ length : chr "0" "0" "0" $ scale : chr "0" "0" "0" $ name : Factor w/ 3 levels "Cluster","p1",..: 2 3 1 As far as I can tell (by adding logging into the code) this is the last (of my functions) that it calls before failing with this error below. I can see repeated calls to the factory function, a couple to the parametercallback function and this last one to the outtypecallback function. It's not getting to the main clustering routine at all.
Any ideas ???
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.