I have a very simple R code that reads the input of two variables (x, y) and makes a polynomial regression. I want to output the "summary", but I don't know how. I can print in the Messages, but is it possible to put it in a output anchor (with the command "write.Alteryx()?)
My code so far:
a <- read.Alteryx("#1", mode="data.frame")
x<-a$x
y<-a$y
fit<-lm(y~x+I(x^2))
print(summary(fit))
Hi @bruno_
If you want to output to the output anchor, use this:
write.Alteryx(data.out, nOutput = 1)
Use this cheat sheet for reference:
Pedro.
Hi Pedro,
Actually my question is what to put in "data.out" of this function to output the Summary. I tried something like this:
write.Alteryx(summary(fit), nOutput = 1)
In this case would be the variable, the table, the object you are trying to output. Is the variable "fit" ? Then just write "fit".
I tried "write.Alteryx(fit, 1)" but it returns an error.
In your case the object is a string. In my case is a whole summary. I think that is not possible to output this kind of object, or I'm just doing it wrong.
You can try to convert it to a data frame and then output it
Pedro.