Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I am trying to publish a barplot that shows the top 10 words by frequency. The issue I am having is the words attached below each bar do now show when published, but do show in Power BI. The only package I am using is tm, which is on the supported list of R packages. I am not going to included any tm_map cleaning of the dataset because it does not seem necessary, but I will provide if requested. The sample data provided has already been converted into a data.frame. Thanks in advance for the help!
Sample data (top 20)
word freq account account 333 child child 64 date date 47 family family 44 email email 43 access access 39 birth birth 38 time time 38 change change 37 adult adult 34 prod1 prod1 32 company company 28 permission permission 27 card card 26 years years 26 problem problem 25 log log 21 atari atari 21 son son 21 put put 20
Code
# ATTEMPT 1 tdm <- as.matrix(tdm) freq.df <- data.frame(Word = rownames(tdm), Freq = rowSums(tdm), row.names = NULL) ordered.results <- with(freq.df, freq.df[order(-Freq),]) bp <- barplot(ordered.results$Freq[1:10], las = 2, col = '#015C55', names.arg = ordered.results$Word[1:10], cex.names = .9 ) text(bp, ordered.results$Freq[1:10], ordered.results$Freq[1:10], cex=.8,pos=1, offset = .2,col = '#ffffff') # ATTEMPT 2 m <- as.matrix(tdm) v <- sort(rowSums(m), decreasing = TRUE) d <- data.frame(word = names(v), freq = v) head(d,20) bp1 <- barplot( d[1:10,]$freq, las = 2, names.arg = d[1:10,]$word, col = '#015C55') text(bp1, d[1:10,]$freq, d[1:10,]$freq, cex=.8,pos=1, offset = .2,col = '#ffffff') # I added below text() field to see if it would publish with the names inside the bars, but
# they did not display once published. I'm not sure if this means there's an issue with publishing
# characters
text(bp1, d[1:10,]$word, d[1:10,]$word, cex=.8,pos=3,col = '#ffffff')
Hi @Ski900,
I'd like to suggest you take a look at limitations about r visual:
Creating R visuals in the Power BI service
R visuals in the Power BI service have a few limitations:
Chinese, Japanese and Korean fonts require all of the additional following steps to work properly in the Power BI service:
Regards,
Xiaoxin Sheng
Thank you for the in depth response! I have a few questions though.
1.) When you say there is no support for custom packages, does this also include the packages listed here? The package I used is listed here which is why I ask. I do not actually do the visualization with this package, it is simply used to build a corpus. On the other hand, the data frame is built with it. Also, I use barplot() which is a base function. I had previously created a subset based on frequecy and the words displayed at that time.
2.) Just for confirmation, when you say publish to the web, you are referring to publishing a report to msit.powerbi.com, correct?
3.) Are there plans to expand R capabilities within Power BI?
Hi @Ski900,
#1. Yes, that link list the packages which power bi service allowed.
#2. Nope, publish to web feature measure a feature which used to share reports to networks, you can take a look at following link to know more about this feature.
#3. I'm not so sure if power bi team has a plan on expand R script. Maybe you can direct contact team to ensure this.
In addition, did same issue appears on other web browsers? If this is a case, it may related to compatibility with power bi service. (For e.g. service has script calculation timeout limit, I think it might contains other limitation on formula calculation)
Regards,
Xiaoxin Sheng
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
97 | |
80 | |
67 | |
62 |
User | Count |
---|---|
145 | |
111 | |
104 | |
84 | |
64 |