Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ec9f912

Browse files
michaelbabynJoseph Damiba
authored and
Joseph Damiba
committed
update value to array in bar-error examples
1 parent 641d928 commit ec9f912

File tree

2 files changed

+9
-54
lines changed

2 files changed

+9
-54
lines changed

_posts/r/statistical/2016-02-22-error-bars.Rmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ data <- rename(data, c("data_sd.length" = "sd"))
5050
data$dose <- as.factor(data$dose)
5151
5252
p <- plot_ly(data = data[which(data$supp == 'OJ'),], x = ~dose, y = ~length, type = 'bar', name = 'OJ',
53-
error_y = ~list(value = sd,
53+
error_y = ~list(array = sd,
5454
color = '#000000')) %>%
5555
add_trace(data = data[which(data$supp == 'VC'),], name = 'VC')
5656
@@ -78,7 +78,7 @@ data$dose <- as.factor(data$dose)
7878
7979
p <- plot_ly(data = data[which(data$supp == 'OJ'),], x = ~dose, y = ~length, type = 'scatter', mode = 'markers',
8080
name = 'OJ',
81-
error_y = ~list(value = sd,
81+
error_y = ~list(array = sd,
8282
color = '#000000')) %>%
8383
add_trace(data = data[which(data$supp == 'VC'),], name = 'VC')
8484
@@ -106,7 +106,7 @@ data$dose <- as.factor(data$dose)
106106
107107
p <- plot_ly(data = data[which(data$supp == 'OJ'),], x = ~dose, y = ~length, type = 'scatter', mode = 'lines+markers',
108108
name = 'OJ',
109-
error_y = ~list(value = sd,
109+
error_y = ~list(array = sd,
110110
color = '#000000')) %>%
111111
add_trace(data = data[which(data$supp == 'VC'),], name = 'VC')
112112

_posts/r/statistical/2016-02-22-error-bars.md

Lines changed: 6 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -48,32 +48,17 @@ data <- rename(data, c("data_sd.length" = "sd"))
4848
data$dose <- as.factor(data$dose)
4949

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

5555
# Create a shareable link to your chart
5656
# Set up API credentials: https://plot.ly/r/getting-started
5757
chart_link = api_create(p, filename="error-bar")
58-
```
59-
60-
```
61-
## Error: Client error: (400) Bad Request
62-
## 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')]
63-
```
64-
65-
```r
6658
chart_link
6759
```
6860

69-
```
70-
## Error in eval(expr, envir, enclos): object 'chart_link' not found
71-
```
72-
73-
74-
```
75-
## Error in eval(expr, envir, enclos): object 'chart_link' not found
76-
```
61+
<iframe src="https://plot.ly/~RPlotBot/5505.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>
7762

7863
### Scatterplot with Error Bars
7964

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

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

9782
# Create a shareable link to your chart
9883
# Set up API credentials: https://plot.ly/r/getting-started
9984
chart_link = api_create(p, filename="error-scatter")
100-
```
101-
102-
```
103-
## Error: Client error: (400) Bad Request
104-
## 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')]
105-
```
106-
107-
```r
10885
chart_link
10986
```
11087

111-
```
112-
## Error in eval(expr, envir, enclos): object 'chart_link' not found
113-
```
114-
115-
116-
```
117-
## Error in eval(expr, envir, enclos): object 'chart_link' not found
118-
```
88+
<iframe src="https://plot.ly/~RPlotBot/5507.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>
11989

12090
### Line Graph with Error Bars
12191

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

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

139109
# Create a shareable link to your chart
140110
# Set up API credentials: https://plot.ly/r/getting-started
141111
chart_link = api_create(p, filename="error-line")
142-
```
143-
144-
```
145-
## Error: Client error: (400) Bad Request
146-
## 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')]
147-
```
148-
149-
```r
150112
chart_link
151113
```
152114

153-
```
154-
## Error in eval(expr, envir, enclos): object 'chart_link' not found
155-
```
156-
157-
158-
```
159-
## Error in eval(expr, envir, enclos): object 'chart_link' not found
160-
```
115+
<iframe src="https://plot.ly/~RPlotBot/5509.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>
161116

162117
### Reference
163118

0 commit comments

Comments
 (0)