0

I am trying really hard to undestand how tableau and r works together.

SCRIPT_REAL("mydata <- data.frame(cbind([Exports]=.arg1,
             [Crop Year]=.arg2,
             [Calendar Date]=.arg3,)); 
             fit <- lm(Exports ~.,data=mydata")

The following error I receive:

Script real is being called with string.

Can someone help me with this?

1
  • Are all of your arguments numeric? Especially, Calendar Date may be string in R. Commented Jul 27, 2017 at 11:35

1 Answer 1

1

Let's try something like this

SCRIPT_REAL('
mydata <- data.frame(cbind(Exports=.arg1, Crop_Year=.arg2, Calendar_Date=.arg3));
fit <- lm(Exports ~ Crop_Year + Calendar_Date, data=mydata)',
[tableau_Exports_columnname],[tableau_CropYear_columnname],[tableau_CalendarDate_columnname])


Don't forget to let us know if it solved your problem :)

Sign up to request clarification or add additional context in comments.

1 Comment

Since Script_Real is a table calc, you also need to define the partitioning and addressing dimensions to specify how to block up the data to send to R (i.e. one large vector, a series of small vectors etc) Right click on your calc pill and edit Table Calc. If you are lucky the default settings will work as desired, but in general you should specify these settings (aka "compute using"). See the online help

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.