Select to view content in your preferred language

Empty Plot Output

1998
14
04-04-2022 10:06 AM
Ed_
by MVP Regular Contributor
MVP Regular Contributor

Hello, I am trying to create a simple "plotly" timeseries plot in Insights Desktop. But I am getting a blank output for some reason.

How can I fix this?

Code

 

library(tidyverse)

library(plotly)

# Import the air temperature dataset to create a plotly plot.
df = read.csv("O:/local_path.csv")

# Plot
month.gg.bwrd_clip = df %>%
#Calculating mean by year
group_by(year) %>%
summarise(tmean = mean(tmean,na.rm = TRUE)) %>%
ggplot(aes(x= year, y=tmean)) +
geom_line(stat = "identity") +
xlab("Year") +
ylab("Average Temperature")

ggplotly(month.gg.bwrd_clip)

 

 

SaadullahBaloch_0-1649091981835.png

 

 

Question | Analyze | Visualize
Tags (3)
0 Kudos
14 Replies
Ian_Muehlenhaus
Esri Contributor

Hi @Ed_ ,

I'm not an R person... I wish I was, though! Hopefully someday. 🙂

However, I use Jupyter kernel gateways for Python in Insights.  

So with that caveat (i.e., I *don't* have a definitive answer for you) I'm wondering if:

a) the libraries are definitely installed on your connection machine -- I presume they are, because I get the vibe you're an R Guru! :-), but I thought I would check just in case

b) have you installed all of ArcGIS Insights' R and Python dependencies? (Note: the dependencies vary between older versions of Insights and newer ones.) 

https://github.com/Esri/insights-scripting-guide/tree/master/gateway

You probably found the next link already, as it sounds like you're pretty far along. It may even be a link that Scott sent you last Friday, so apologies if it is, but here is the guide to setting up scripting environments in ArcGIS Insights. 

https://github.com/Esri/insights-scripting-guide

I'm sorry this isn't working for you.

Hopefully it's just a minor issue.

If not... please let us know, and I'll try to replicate the issue and report it as a bug to fix! 🙂

Better yet, hopefully a regular R user pops on here shortly with a solution!

Thanks, @Ed_

Ian 

 

 

 

-------------------
Ian Muehlenhaus
Location Analytics
Ed_
by MVP Regular Contributor
MVP Regular Contributor

Good day Ian,

Thank you for the quick response.

  1. Yes, I followed the "Insights scripting guide" step by step.
  2. Installed the libraries/packages via the Anaconda Navigator.
  3. Imported the packages in the Insights scripting console as seen in the code.
Question | Analyze | Visualize
Ian_Muehlenhaus
Esri Contributor
Awesome you did that but… Darnit! Then, I have no idea what the issue could be. 😕

I’ll ask around if anyone knows what the issue might be. Can’t promise how responsive they’ll be, as everyone is quite busy right now, but hopefully someone gets back to you soon.

Sorry again. We’ll try to get this figured out!

Ian
-------------------
Ian Muehlenhaus
Location Analytics
Ed_
by MVP Regular Contributor
MVP Regular Contributor

No worries, cheers for the help Ian.

Question | Analyze | Visualize
LindaBeale
Esri Contributor

Hi SaadullahBaloch 

I am not sure exactly where it's going wrong for you.  I just installed tidyverse and ran a quick example and managed to get a plot.  Maybe try this simple example and see if that works for you first? 

LindaBeale_0-1649181697978.png

 

Ed_
by MVP Regular Contributor
MVP Regular Contributor

Good day @LindaBeale ,

Thank you for the response, however, if you look at my code I am using "ggplotly" (you will have to install the "plotly" package for that). Basically, you first store the "ggplot" in an object, and then use that object with "ggplotly". 

Question | Analyze | Visualize
0 Kudos
Ed_
by MVP Regular Contributor
MVP Regular Contributor

@LindaBeale actually, since "plotly" interactive plots are not supported by Insights, this post could be considered as an idea to be included as a feature in a near future Insights release. 

Question | Analyze | Visualize
Ian_Muehlenhaus
Esri Contributor

@Ed_: This is great idea. We'll bring it up with the team for sure. Sorry this feature isn't "quite" there yet for you in this specific case. We'll try to get it there in the future! 🙂

Thanks again for using Insights!

Ian 

-------------------
Ian Muehlenhaus
Location Analytics
Ian_Muehlenhaus
Esri Contributor

Hi @Ed_

Whoops. Hold up... I heard from someone online that this feature exists already. I'm wrong. (More proof I'm not a bot and very human!)

Sorry for the misinformation. I am hopeful someone will help sort this issue out. 

Thanks again,

Ian

 

-------------------
Ian Muehlenhaus
Location Analytics