Forum Discussion
Using R in Query Editor
- 7 years ago
To me it looks like you aren't referencing the missing values column of completedData correctly.
When you load the data using dataset <-read.csv, by default it replaces the spaces within column names with periods. In particular, "SMI missing values" becomes "SMI.missing.values" so the last step in the R script doesn't do anything since it refers to a nonexistant column.
There are two easy fixes. Pick one or the other but not both.
- Change the last line.
output$completedValues <- completedData$"SMI missing values"
output$completedValues <- completedData$"SMI.missing.values" - Add an argument to read.csv to prevent this replacement.
dataset <- read.csv (file = "<path>", header = TRUE, sep = ",")
dataset <- read.csv (file = "<path>", header = TRUE, check.names=FALSE, sep = ",")
- Change the last line.
Hi MPereira
I test by following this link and i meet the same problem as you do.
But i'm not familiar with R language, so i'm consulting with senior engineers how to solve this problem.
For any workaround to use R in Power bi, you could refer to other links.
https://docs.microsoft.com/en-us/power-bi/desktop-r-ide
https://docs.microsoft.com/en-us/power-bi/desktop-r-visuals
Best Regards
Maggie
Hi v-juanli-msft.
Thank you so much for your help and your the senior engineers team!
However, AlexisOlson's response helped me solve the problem!
Thank you again!