Skip to content

Commit

Permalink
update value to array in bar-error examples
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbabyn committed Oct 25, 2018
1 parent ea375d4 commit d74534a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 54 deletions.
6 changes: 3 additions & 3 deletions _posts/r/statistical/2016-02-22-error-bars.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ data <- rename(data, c("data_sd.length" = "sd"))
data$dose <- as.factor(data$dose)
p <- plot_ly(data = data[which(data$supp == 'OJ'),], x = ~dose, y = ~length, type = 'bar', name = 'OJ',
error_y = ~list(value = sd,
error_y = ~list(array = sd,
color = '#000000')) %>%
add_trace(data = data[which(data$supp == 'VC'),], name = 'VC')
Expand Down Expand Up @@ -78,7 +78,7 @@ data$dose <- as.factor(data$dose)
p <- plot_ly(data = data[which(data$supp == 'OJ'),], x = ~dose, y = ~length, type = 'scatter', mode = 'markers',
name = 'OJ',
error_y = ~list(value = sd,
error_y = ~list(array = sd,
color = '#000000')) %>%
add_trace(data = data[which(data$supp == 'VC'),], name = 'VC')
Expand Down Expand Up @@ -106,7 +106,7 @@ data$dose <- as.factor(data$dose)
p <- plot_ly(data = data[which(data$supp == 'OJ'),], x = ~dose, y = ~length, type = 'scatter', mode = 'lines+markers',
name = 'OJ',
error_y = ~list(value = sd,
error_y = ~list(array = sd,
color = '#000000')) %>%
add_trace(data = data[which(data$supp == 'VC'),], name = 'VC')
Expand Down
57 changes: 6 additions & 51 deletions _posts/r/statistical/2016-02-22-error-bars.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,32 +48,17 @@ data <- rename(data, c("data_sd.length" = "sd"))
data$dose <- as.factor(data$dose)

p <- plot_ly(data = data[which(data$supp == 'OJ'),], x = ~dose, y = ~length, type = 'bar', name = 'OJ',
error_y = ~list(value = sd,
error_y = ~list(array = sd,
color = '#000000')) %>%
add_trace(data = data[which(data$supp == 'VC'),], name = 'VC')

# Create a shareable link to your chart
# Set up API credentials: https://plot.ly/r/getting-started
chart_link = api_create(p, filename="error-bar")
```

```
## Error: Client error: (400) Bad Request
## Figure field is invalid. Reason: Raw data arrays are not allowed at this endpoint. Use grid references instead. Raw data found at the following paths in the figure [('data', 0, u'error_y', u'value'), ('data', 1, u'error_y', u'value')]
```

```r
chart_link
```

```
## Error in eval(expr, envir, enclos): object 'chart_link' not found
```


```
## Error in eval(expr, envir, enclos): object 'chart_link' not found
```
<iframe src="https://plot.ly/~RPlotBot/5505.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>

### Scatterplot with Error Bars

Expand All @@ -90,32 +75,17 @@ data$dose <- as.factor(data$dose)

p <- plot_ly(data = data[which(data$supp == 'OJ'),], x = ~dose, y = ~length, type = 'scatter', mode = 'markers',
name = 'OJ',
error_y = ~list(value = sd,
error_y = ~list(array = sd,
color = '#000000')) %>%
add_trace(data = data[which(data$supp == 'VC'),], name = 'VC')

# Create a shareable link to your chart
# Set up API credentials: https://plot.ly/r/getting-started
chart_link = api_create(p, filename="error-scatter")
```

```
## Error: Client error: (400) Bad Request
## Figure field is invalid. Reason: Raw data arrays are not allowed at this endpoint. Use grid references instead. Raw data found at the following paths in the figure [('data', 0, u'error_y', u'value'), ('data', 1, u'error_y', u'value')]
```

```r
chart_link
```

```
## Error in eval(expr, envir, enclos): object 'chart_link' not found
```


```
## Error in eval(expr, envir, enclos): object 'chart_link' not found
```
<iframe src="https://plot.ly/~RPlotBot/5507.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>

### Line Graph with Error Bars

Expand All @@ -132,32 +102,17 @@ data$dose <- as.factor(data$dose)

p <- plot_ly(data = data[which(data$supp == 'OJ'),], x = ~dose, y = ~length, type = 'scatter', mode = 'lines+markers',
name = 'OJ',
error_y = ~list(value = sd,
error_y = ~list(array = sd,
color = '#000000')) %>%
add_trace(data = data[which(data$supp == 'VC'),], name = 'VC')

# Create a shareable link to your chart
# Set up API credentials: https://plot.ly/r/getting-started
chart_link = api_create(p, filename="error-line")
```

```
## Error: Client error: (400) Bad Request
## Figure field is invalid. Reason: Raw data arrays are not allowed at this endpoint. Use grid references instead. Raw data found at the following paths in the figure [('data', 0, u'error_y', u'value'), ('data', 1, u'error_y', u'value')]
```

```r
chart_link
```

```
## Error in eval(expr, envir, enclos): object 'chart_link' not found
```


```
## Error in eval(expr, envir, enclos): object 'chart_link' not found
```
<iframe src="https://plot.ly/~RPlotBot/5509.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>

### Reference

Expand Down

0 comments on commit d74534a

Please sign in to comment.