plotly heatmap doesn't take a dataframe
Open
Nobody has claimed this yet.
documentation
enhancement
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
The figure reference documentation says
plot_ly(df, type="heatmap"[, ...])
the df in the code above indicates a data frame
The code below doesn't work
url <- "http://datasets.flowingdata.com/ppg2008.csv"
nba_players <- read.csv(url, row.names = 1)
plot_ly(nba_players, type = "heatmap")
A solution is to use a data.matrix
plot_ly(z = data.matrix(nba_players),
x = colnames(nba_players),
y = row.names(nba_players),
type = "heatmap")
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the documented plot_ly(nba_players, type = "heatmap") example with the supplied CSV, then inspect the heatmap figure-reference path. Done means either a data frame is accepted as documented or the reference clearly explains the required matrix conversion and its x/y labels.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- plotly, r
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100