Custom visual in power BI - RHTML visual
1) I created R html visual from following command
pbiviz new sampleRHTMLVisual -t rhtml
2) But I am not able to bind data
Question is how R script Access Power BI table data.
Demo file shows only uses default data in Rscript
See also questions close to this topic
how to use the PCs (resulting from PCA) on my dataset in R?
I am an R learner. I am working on 'Human Activity Recognition' dataset from internet. It has 563 variables, the last variable being the class variable 'Activity' which has to be predicted.
I am trying to use KNN algorithm here from CARET package of R.
I have created another dataset with 561 numeric variables excluding the last 2 - subject and activity.
I ran the PCA on that and decided that I will use the top 20 PCs.
pca1 <- prcomp(human2, scale = TRUE)
I saved the data of those PCs in another dataset called 'newdat'
newdat <- pca1$x[ ,1:20]
Now I am tryig to run the below code : but it gives me error because, this newdat doesn't have my class variable
trctrl <- trainControl(method = "repeatedcv", number = 10, repeats = 3) set.seed(3333) knn_fit <- train(Activity ~., data = newdat, method = "knn", trControl=trctrl, preProcess = c("center", "scale"), tuneLength = 10)
I tried to extract the last column 'activity' from the raw data and appending it using cbind() with 'newdat' to use that on knn-fit (above) but its not getting appended.
any suggestions how to use the PCs ?
How to take flexible number of text inputs in R shiny?
I want to take flexible number of text inputs in shiny
For single input I am using
textInput("symbol","Enter the stock symbol",value = "SPY")
How can I take multiple inputs in the same text input box in the way that user submits one and then enters the next input in the same box?
I want to fetch data for all the symbols entered by the user.
TukeyHSD Subscript out of bounds
I'm getting an error with TukeyHSD after running a seemingly simple ANOVA.
My data structure is in the following example format, with a total of 5 groups in my actual data:
data_frame: A B Group 1 2 Group 1 3 Group 1 5 Group 2 1 Group 2 7 Group 2 8
Results below are from * actual output from my data, not from example above *
aov(VA~as.factor(Etiologies),data_frame) as.factor(Etiologies) Residuals Sum of Squares 37.85416 110.45051 Deg. of Freedom 5 81 Residual standard error: 1.167727 Estimated effects may be unbalanced summary(ANOVA_finalVA_all) Df Sum Sq Mean Sq F value Pr(>F) as.factor(Etiologies) 5 37.85 7.571 5.552 0.00019 *** Residuals 81 110.45 1.364 ---
Then when I run Tukey HSD I get the following error
TukeyHSD(ANOVA_finalVA_all) Error in FUN(X[[i]], ...) : subscript out of bounds
The error traceback:
8. lapply(args, "[[", "coefficients") 7. combine_mtables(...) 6. c.mtable(`Grand mean` = gmtable, tables) 5. c(`Grand mean` = gmtable, tables) 4. model.tables.aov(x, "means") 3. model.tables(x, "means") 2. TukeyHSD.aov(ANOVA_finalVA_all) 1. TukeyHSD(ANOVA_finalVA_all)
Something I guess is wrong with the "coefficients"? Here is the coefficients produced from the ANOVA table
(Intercept) Anova_VA_atFinal$EtiologiesA Anova_VA_atFinal$EtiologiesB 1.73910734 -0.78246714 1.26089266 Anova_VA_atFinal$EtiologiesC Anova_VA_atFinal$EtiologiesD Anova_VA_atFinal$EtiologiesE 0.07053282 0.07662614 1.09099566
From what I can tell this seems like normal ANOVA behavior, and I have ensured that my Group variables are factors. I cannot seem to figure out why I am getting this error despite a normal ANOVA result. Any help in troubleshooting this error would be greatly appreciated!
Displays incorrect values after created Date Dimension table in Power BI
My Fact table "Premiums" has Premium value and DateTime column (EffectiveDate). If I look at the Premium by MONTH(EffectiveDate) - it looks correct. Sorry, its not sorted.
But then if I create table Dates, join it to Premiums table on EffectiveDate column and try to look at Premiums by Month - it looks completely different.
I tried two different ways to create Calendar table. Still the same incorrect values.
What am I doing wrong?
Callback not being invoked
I am trying to mount a Bing Map, the docs look like this:
The URL to the script has a
callbackquerystring param that includes the name of the function to invoke.
Given I don't have access to the markup, I'm trying to do everything dyncamically in my visualization's constructor. I create a function, move it to global scope, and then I add the querystring var to reference it, but it never gets invoked. Anyone see anything I might be missing?
New Power BI Embedded pricing model - page render
I am not sure I understand totally the term page render in new Power BI Embedded pricing model.
We need to measure how often our clients load Power BI in order to charge them properly. But we still got the confusion how page render is counted under the hood.
From the definition:
A page render is counted any time Power BI visuals are loaded on a page. A page refresh counts as a page render, as does any other page interactivity, like slice and dice, filtering, etc. Typically, multiple queries running on the backend cores translate to a page render.
How we can understand Page Render in both cases Import and Direct Query mode for Report Embedding.
Scenario 1 with import mode:
Assume one page in our application embeds an report with import mode. This report has 2 tabs inside and each tab has 5 visual. So, this report has 10 visuals in total.
How many page render if user visits this page: 1 render (based on the whole report), or 2 (based on 2 tabs), or 10 (based on 10 visuals).
If user switches between two tabs in the report, is there any page render is count?
Now assume there is datetime slicer in the tab 1, if user use this slicer to do filtering. One render is counted on this case?
Scenario 2 with direct query:
The same with the scenario 1 with direct query report.