Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flexdashboard does not works with Python chunk #1667

Closed
djouallah opened this issue Feb 4, 2019 · 5 comments
Closed

flexdashboard does not works with Python chunk #1667

djouallah opened this issue Feb 4, 2019 · 5 comments

Comments

@djouallah
Copy link

Knitr works fine with python chunks, but once I add a header to make it as a flexdashboard, I got this error

Error in py_call_impl(callable, dots$args, dots$keywords) : 
  TypeError: float() argument must be a string or a number, not 'list'

as an example

---
title: "Solar Far"
output: 
  flexdashboard::flex_dashboard
    
---

```{python echo=FALSE, reticulate=FALSE}
import altair as alt
floor_Plan = alt.topo_feature('https://raw.githubusercontent.com/djouallah/R_leaflet_MAP/master/foundation.json', 'foundation')
source = 'https://raw.githubusercontent.com/djouallah/R_leaflet_MAP/master/data/data.csv'
map = alt.Chart(floor_Plan).mark_geoshape().encode(
color='progress:Q',
tooltip=['properties.id:N','progress:N']).transform_lookup(
    lookup='properties.id',
    from_=alt.LookupData(source, 'id', ['progress']))

map.save('map.html')
map

if you removed the first section, everything works fine.
@yihui
Copy link
Owner

yihui commented Feb 4, 2019

You mean if you change flexdashboard::flex_dashboard to something like html_document, it will work?

I don't know much about Python and I have no idea what the error message means, so I cannot help you here. You may ask it on Stack Overflow or RStudio Community instead. Thanks!

BTW, I don't know what the chunk option reticulate=FALSE means; knitr doesn't support such an option. See https://bookdown.org/yihui/rmarkdown/language-engines.html#python for more info about the python engine.

@djouallah
Copy link
Author

You mean if you change flexdashboard::flex_dashboard to something like html_document, it will work?
yes correct, the issue is only with flexdashboard

@yihui
Copy link
Owner

yihui commented Feb 5, 2019

For the record, this was cross-posted at https://stackoverflow.com/q/54533761/559676

@afogarty85
Copy link

afogarty85 commented Jun 9, 2019

What the author was trying to say is that flexdashboard cannot run Python chunks.

Once you told the RMD that it was no longer a flexdashboard object, it runs correctly.

@github-actions
Copy link

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants