Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
stephlocke
New Member

PowerBI Desktop (latest version) R Script component not reading data.table or dplyr tables correctly

The R script component should be able to extract all objects of the class data.frame, produced by an R script.

 

If I simply produce standard data.frame objects, it will indeed pick them all up. If however, I use one of the common packages that enhance data.frame objects like data.table or dplyr, I start getting unstable behaviour.

 

Basic data.frames:

iris1<-iris
iris2<-iris

Using data.table:

library(data.table)
iris1<-iris              # shows up
iris2<-iris              # shows up
iris3<-setDT(copy(iris)) # shows up
iris4<-setDT(copy(iris)) # doesn't show up

Using dplyr:

library(dplyr)
iris1<-iris         # shows up
iris2<-iris         # shows up
iris3<-tbl_df(iris) # doesn't show up
iris4<-tbl_df(iris) # doesn't show up

Such behaviour could be related to how PowerBI interrogates the class of the objects in the R workspace. Ideally, it should see if objects `inherits()` data.frame and extract those that do

 

 

PowerBI desktop: Version: 2.32.4307.641 64-bit (February 2016)

R: 3.2.4

0 REPLIES 0

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors