Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
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:
| Date | Facility | WFD | VisitCount | AvgTIY |
| 3/3/2022 | ABC | 188 | 979 | 67 |
| 3/4/2022 | ABC | 43 | 679 | 47.03 |
| 3/5/2022 | ABC | 132 | 1015 | 34.34 |
| 3/6/2022 | ABC | 122 | 995 | 94.72 |
| 3/7/2022 | ABC | 50 | 657 | 32.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.
Hoping someone can lend me the assistance I need to generate the plot.
Thanks in advance and Best Regards,
Solved! Go to Solution.
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")
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")
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 37 | |
| 34 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 72 | |
| 72 | |
| 38 | |
| 35 | |
| 26 |