Forum Discussion
R script as data source in Power BI Desktop
- 8 years ago
OK, and this might very well be my misunderstanding of R but the way that I have worked with R dataframes in the past (limited) is that I have R code that reads some source and then I compose it into a dataframe within the R code, so something like:
N <- 100 u <- rnorm(N) x1 <- rnorm(N) x2 <- rnorm(N) y <- 1 + x1 + x2 + u mydat <- data.frame(y,x1,x2)
I guess what I was suggesting is that you put the code that creates/updates your data frame into the query as an R query or R query step. Are you saying that you have the R dataframe saved to a file as if you did something like this?
save(foo,file="data.Rda")
If that is the case, couldn't you do something like:
load("data.Rda")In the first line of your R query or R query step?
OK, and this might very well be my misunderstanding of R but the way that I have worked with R dataframes in the past (limited) is that I have R code that reads some source and then I compose it into a dataframe within the R code, so something like:
N <- 100 u <- rnorm(N) x1 <- rnorm(N) x2 <- rnorm(N) y <- 1 + x1 + x2 + u mydat <- data.frame(y,x1,x2)
I guess what I was suggesting is that you put the code that creates/updates your data frame into the query as an R query or R query step. Are you saying that you have the R dataframe saved to a file as if you did something like this?
save(foo,file="data.Rda")
If that is the case, couldn't you do something like:
load("data.Rda")In the first line of your R query or R query step?
Hi,
I have another query regarding the Data Update in PowerBI,
As I saved the Data in .Rda file how can I update the same table in PowerBI,
I can update the .Rda file from R but again I have to change the source in the Settings Tab for the PowerBI.