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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
rsbin
Community Champion
Community Champion

Help with R Script - First Timer

Hello,

Looking for help from anyone experienced in R Scripts

First time trying to use the R Script Visual to create an x-y scatter plot.

I have the following table of sample data:

DateFacilityWFDVisitCountAvgTIY
3/3/2022ABC18897967
3/4/2022ABC4367947.03
3/5/2022ABC132101534.34
3/6/2022ABC12299594.72
3/7/2022ABC5065732.25

Facility will be used as a Filter or Slicer so not needed in the plot itself.

My hypothesis is that AvgTIY is influenced by WFD and VisitCount.

Each Date should represent a single point in the plot.

x=WFD, y=VisitCount, size= AvgTIY.  After watching several videos, I have got to this point:

 

# The following code to create a dataframe and remove duplicated rows is always executed and acts as a preamble for your script: 

# dataset <- data.frame(WFD, VisitCount, AvgTIY)
# dataset <- unique(dataset)

# Paste or type your script code here:
library(ggplot2)
ggplot(data=dataset, aes(x=VisitCount, 
                        y=WFD))
   geom_point(aes(size=AvgTIY), color= "Blue")

 

But my visual is empty.

rsbin_0-1646839045416.png

Hoping someone can lend me the assistance I need to generate the plot.

 

Thanks in advance and Best Regards,

1 ACCEPTED SOLUTION
rsbin
Community Champion
Community Champion

After more research, I believe I found my issue.

Missed the "+" sign, which I now know is required in order for R to keep reading the code.

 

# The following code to create a dataframe and remove duplicated rows is always executed and acts as a preamble for your script: 

# dataset <- data.frame(WFD, VisitCount, AvgTIY)
# dataset <- unique(dataset)

# Paste or type your script code here:
library(ggplot2)
ggplot(data=dataset, aes(x=VisitCount, 
                        y=WFD)) +
   geom_point(aes(size=AvgTIY), color= "Blue")

 

View solution in original post

1 REPLY 1
rsbin
Community Champion
Community Champion

After more research, I believe I found my issue.

Missed the "+" sign, which I now know is required in order for R to keep reading the code.

 

# The following code to create a dataframe and remove duplicated rows is always executed and acts as a preamble for your script: 

# dataset <- data.frame(WFD, VisitCount, AvgTIY)
# dataset <- unique(dataset)

# Paste or type your script code here:
library(ggplot2)
ggplot(data=dataset, aes(x=VisitCount, 
                        y=WFD)) +
   geom_point(aes(size=AvgTIY), color= "Blue")

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.