cis-ds / Discussion

Public discussion
10 stars 15 forks source link

03-reorder-urban #145

Closed bensoltoff closed 4 years ago

bensoltoff commented 4 years ago

Post your reproducible example here

sabreena-croteau commented 4 years ago
## Use the script below to generate a reproducible example
## using the reprex package. Once you generate it, post it on
## https://github.com/uc-cfss/Discussion/issues/145
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
#> Warning: package 'ggplot2' was built under R version 3.6.2
#> Warning: package 'tibble' was built under R version 3.6.2
#> Warning: package 'tidyr' was built under R version 3.6.2
#> Warning: package 'purrr' was built under R version 3.6.2
#> Warning: package 'dplyr' was built under R version 3.6.2
library(here)
#> here() starts at /private/var/folders/l0/bs3rcy9x525cvxqc7h9pxdbm0000gn/T/RtmpR8iNR9/reprex4cc26e503f28

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> Error: '/private/var/folders/l0/bs3rcy9x525cvxqc7h9pxdbm0000gn/T/RtmpR8iNR9/reprex4cc26e503f28/data/urbanization-state.csv' does not exist.

# how do I reorder the bars from largest to smallest?
ggplot(data = urban, mapping = aes(x = state, y = urbanindex)) +
  geom_col() +
  coord_flip()
#> Error in ggplot(data = urban, mapping = aes(x = state, y = urbanindex)): object 'urban' not found

Created on 2020-07-09 by the reprex package (v0.3.0)

IanGGG commented 4 years ago
library(tidyverse)
library(here)
#> here() starts at C:/Users/Xuefei Gao/AppData/Local/Temp/Rtmp2POEQC/reprex3274e415ef0

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> Error: 'C:/Users/Xuefei Gao/AppData/Local/Temp/Rtmp2POEQC/reprex3274e415ef0/data/urbanization-state.csv' does not exist.

# how do I reorder the bars from largest to smallest?
ggplot(data = urban, mapping = aes(x = state, y = urbanindex)) +
  geom_col() +
  coord_flip()
#> Error in ggplot(data = urban, mapping = aes(x = state, y = urbanindex)): 找不到对象'urban'

Created on 2020-07-09 by the reprex package (v0.3.0)

YinsuH commented 4 years ago
## Use the script below to generate a reproducible example
## using the reprex package. Once you generate it, post it on
## https://github.com/uc-cfss/Discussion/issues/145
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /private/var/folders/t2/b_0kv4zx0rxd31mtzgt3fmb40000gn/T/Rtmpb7kdsr/reprexfaf4ad28bb4

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> Error: '/private/var/folders/t2/b_0kv4zx0rxd31mtzgt3fmb40000gn/T/Rtmpb7kdsr/reprexfaf4ad28bb4/data/urbanization-state.csv' does not exist.

# how do I reorder the bars from largest to smallest?
ggplot(data = urban, mapping = aes(x = state, y = urbanindex)) +
  geom_col() +
  coord_flip()
#> Error in ggplot(data = urban, mapping = aes(x = state, y = urbanindex)): object 'urban' not found

Created on 2020-07-09 by the reprex package (v0.3.0)

Session info ``` r devtools::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 4.0.1 (2020-06-06) #> os macOS Catalina 10.15.5 #> system x86_64, darwin17.0 #> ui X11 #> language (EN) #> collate en_US.UTF-8 #> ctype en_US.UTF-8 #> tz Asia/Shanghai #> date 2020-07-09 #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date lib source #> assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.0.0) #> backports 1.1.8 2020-06-17 [1] CRAN (R 4.0.1) #> blob 1.2.1 2020-01-20 [1] CRAN (R 4.0.0) #> broom 0.5.6 2020-04-20 [1] CRAN (R 4.0.0) #> callr 3.4.3 2020-03-28 [1] CRAN (R 4.0.0) #> cellranger 1.1.0 2016-07-27 [1] CRAN (R 4.0.0) #> cli 2.0.2 2020-02-28 [1] CRAN (R 4.0.0) #> colorspace 1.4-1 2019-03-18 [1] CRAN (R 4.0.0) #> crayon 1.3.4 2017-09-16 [1] CRAN (R 4.0.0) #> DBI 1.1.0 2019-12-15 [1] CRAN (R 4.0.0) #> dbplyr 1.4.4 2020-05-27 [1] CRAN (R 4.0.0) #> desc 1.2.0 2018-05-01 [1] CRAN (R 4.0.0) #> devtools 2.3.0 2020-04-10 [1] CRAN (R 4.0.0) #> digest 0.6.25 2020-02-23 [1] CRAN (R 4.0.0) #> dplyr * 1.0.0 2020-05-29 [1] CRAN (R 4.0.0) #> ellipsis 0.3.1 2020-05-15 [1] CRAN (R 4.0.0) #> evaluate 0.14 2019-05-28 [1] CRAN (R 4.0.0) #> fansi 0.4.1 2020-01-08 [1] CRAN (R 4.0.0) #> forcats * 0.5.0 2020-03-01 [1] CRAN (R 4.0.0) #> fs 1.4.1 2020-04-04 [1] CRAN (R 4.0.0) #> generics 0.0.2 2018-11-29 [1] CRAN (R 4.0.0) #> ggplot2 * 3.3.2 2020-06-19 [1] CRAN (R 4.0.1) #> glue 1.4.1 2020-05-13 [1] CRAN (R 4.0.0) #> gtable 0.3.0 2019-03-25 [1] CRAN (R 4.0.0) #> haven 2.3.1 2020-06-01 [1] CRAN (R 4.0.0) #> here * 0.1 2017-05-28 [1] CRAN (R 4.0.0) #> highr 0.8 2019-03-20 [1] CRAN (R 4.0.0) #> hms 0.5.3 2020-01-08 [1] CRAN (R 4.0.0) #> htmltools 0.5.0 2020-06-16 [1] CRAN (R 4.0.1) #> httr 1.4.1 2019-08-05 [1] CRAN (R 4.0.0) #> jsonlite 1.6.1 2020-02-02 [1] CRAN (R 4.0.0) #> knitr 1.29 2020-06-23 [1] CRAN (R 4.0.1) #> lattice 0.20-41 2020-04-02 [1] CRAN (R 4.0.1) #> lifecycle 0.2.0 2020-03-06 [1] CRAN (R 4.0.0) #> lubridate 1.7.9 2020-06-08 [1] CRAN (R 4.0.0) #> magrittr 1.5 2014-11-22 [1] CRAN (R 4.0.0) #> memoise 1.1.0 2017-04-21 [1] CRAN (R 4.0.0) #> modelr 0.1.8 2020-05-19 [1] CRAN (R 4.0.0) #> munsell 0.5.0 2018-06-12 [1] CRAN (R 4.0.0) #> nlme 3.1-148 2020-05-24 [1] CRAN (R 4.0.1) #> pillar 1.4.4 2020-05-05 [1] CRAN (R 4.0.0) #> pkgbuild 1.0.8 2020-05-07 [1] CRAN (R 4.0.0) #> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.0.0) #> pkgload 1.1.0 2020-05-29 [1] CRAN (R 4.0.0) #> prettyunits 1.1.1 2020-01-24 [1] CRAN (R 4.0.0) #> processx 3.4.2 2020-02-09 [1] CRAN (R 4.0.0) #> ps 1.3.3 2020-05-08 [1] CRAN (R 4.0.0) #> purrr * 0.3.4 2020-04-17 [1] CRAN (R 4.0.0) #> R6 2.4.1 2019-11-12 [1] CRAN (R 4.0.0) #> Rcpp 1.0.4.6 2020-04-09 [1] CRAN (R 4.0.0) #> readr * 1.3.1 2018-12-21 [1] CRAN (R 4.0.0) #> readxl 1.3.1 2019-03-13 [1] CRAN (R 4.0.0) #> remotes 2.1.1 2020-02-15 [1] CRAN (R 4.0.0) #> reprex 0.3.0 2019-05-16 [1] CRAN (R 4.0.0) #> rlang 0.4.6 2020-05-02 [1] CRAN (R 4.0.0) #> rmarkdown 2.3 2020-06-18 [1] CRAN (R 4.0.1) #> rprojroot 1.3-2 2018-01-03 [1] CRAN (R 4.0.0) #> rvest 0.3.5 2019-11-08 [1] CRAN (R 4.0.0) #> scales 1.1.1 2020-05-11 [1] CRAN (R 4.0.0) #> sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 4.0.0) #> stringi 1.4.6 2020-02-17 [1] CRAN (R 4.0.0) #> stringr * 1.4.0 2019-02-10 [1] CRAN (R 4.0.0) #> testthat 2.3.2 2020-03-02 [1] CRAN (R 4.0.0) #> tibble * 3.0.1 2020-04-20 [1] CRAN (R 4.0.0) #> tidyr * 1.1.0 2020-05-20 [1] CRAN (R 4.0.0) #> tidyselect 1.1.0 2020-05-11 [1] CRAN (R 4.0.0) #> tidyverse * 1.3.0 2019-11-21 [1] CRAN (R 4.0.0) #> usethis 1.6.1 2020-04-29 [1] CRAN (R 4.0.0) #> vctrs 0.3.1 2020-06-05 [1] CRAN (R 4.0.0) #> withr 2.2.0 2020-04-20 [1] CRAN (R 4.0.0) #> xfun 0.15 2020-06-21 [1] CRAN (R 4.0.1) #> xml2 1.3.2 2020-04-23 [1] CRAN (R 4.0.0) #> yaml 2.2.1 2020-02-01 [1] CRAN (R 4.0.0) #> #> [1] /Library/Frameworks/R.framework/Versions/4.0/Resources/library ```
iallum commented 4 years ago
## Use the script below to generate a reproducible example
## using the reprex package. Once you generate it, post it on
## https://github.com/uc-cfss/Discussion/issues/145
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /tmp/RtmpDgZX9W/reprexb832e353bd07e

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> Error: '/tmp/RtmpDgZX9W/reprexb832e353bd07e/data/urbanization-state.csv' does not exist.

# how do I reorder the bars from largest to smallest?
ggplot(data = urban, mapping = aes(x = state, y = urbanindex)) +
  geom_col() +
  coord_flip()
#> Error in ggplot(data = urban, mapping = aes(x = state, y = urbanindex)): object 'urban' not found

Created on 2020-07-09 by the reprex package (v0.3.0)

psposa commented 4 years ago
## Use the script below to generate a reproducible example
## using the reprex package. Once you generate it, post it on
## https://github.com/uc-cfss/Discussion/issues/145
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /home/psposa/reproducible-examples-and-git-master

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> Parsed with column specification:
#> cols(
#>   state = col_character(),
#>   urbanindex = col_double()
#> )

# how do I reorder the bars from largest to smallest?
ggplot(data = urban, mapping = aes(x = state, y = urbanindex)) +
  geom_col() +
  coord_flip()

Created on 2020-07-09 by the reprex package (v0.3.0)

gmeyers405 commented 4 years ago
## Use the script below to generate a reproducible example
## using the reprex package. Once you generate it, post it on
## https://github.com/uc-cfss/Discussion/issues/145
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /tmp/RtmpphdgSq/reprexb86a8714ee49b

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> Error: '/tmp/RtmpphdgSq/reprexb86a8714ee49b/data/urbanization-state.csv' does not exist.

# how do I reorder the bars from largest to smallest?
ggplot(data = urban, mapping = aes(x = state, y = urbanindex)) +
  geom_col() +
  coord_flip()
#> Error in ggplot(data = urban, mapping = aes(x = state, y = urbanindex)): object 'urban' not found
yunshu3112 commented 4 years ago
## Use the script below to generate a reproducible example
## using the reprex package. Once you generate it, post it on
## https://github.com/uc-cfss/Discussion/issues/145
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
#> Warning: 程辑包'tidyverse'是用R版本4.0.2 来建造的
library(here)
#> Error in library(here): 不存在叫'here'这个名字的程辑包

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> Error in here("data", "urbanization-state.csv"): 没有"here"这个函数

# how do I reorder the bars from largest to smallest?
ggplot(data = urban, mapping = aes(x = state, y = urbanindex)) +
  geom_col() +
  coord_flip()
#> Error in ggplot(data = urban, mapping = aes(x = state, y = urbanindex)): 找不到对象'urban'

Created on 2020-07-09 by the reprex package (v0.3.0)

bensoltoff commented 4 years ago
## Use the script below to generate a reproducible example
## using the reprex package. Once you generate it, post it on
## https://github.com/uc-cfss/Discussion/issues/145
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /Users/soltoffbc/Projects/Computing for Social Sciences/exercises/reproducible-examples-and-git

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> Parsed with column specification:
#> cols(
#>   state = col_character(),
#>   urbanindex = col_double()
#> )

# how do I reorder the bars from largest to smallest?
ggplot(data = urban, mapping = aes(x = state, y = urbanindex)) +
  geom_col() +
  coord_flip()

Created on 2020-07-09 by the reprex package (v0.3.0)

Session info ``` r devtools::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 4.0.1 (2020-06-06) #> os macOS Catalina 10.15.5 #> system x86_64, darwin17.0 #> ui X11 #> language (EN) #> collate en_US.UTF-8 #> ctype en_US.UTF-8 #> tz America/Chicago #> date 2020-07-09 #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date lib source #> assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.0.0) #> backports 1.1.7 2020-05-13 [1] CRAN (R 4.0.0) #> blob 1.2.1 2020-01-20 [1] CRAN (R 4.0.0) #> broom 0.5.6 2020-04-20 [1] CRAN (R 4.0.0) #> callr 3.4.3 2020-03-28 [1] CRAN (R 4.0.0) #> cellranger 1.1.0 2016-07-27 [1] CRAN (R 4.0.0) #> cli 2.0.2 2020-02-28 [1] CRAN (R 4.0.0) #> colorspace 1.4-1 2019-03-18 [1] CRAN (R 4.0.0) #> crayon 1.3.4 2017-09-16 [1] CRAN (R 4.0.0) #> curl 4.3 2019-12-02 [1] CRAN (R 4.0.0) #> DBI 1.1.0 2019-12-15 [1] CRAN (R 4.0.0) #> dbplyr 1.4.4 2020-05-27 [1] CRAN (R 4.0.0) #> desc 1.2.0 2018-05-01 [1] CRAN (R 4.0.0) #> devtools 2.3.0 2020-04-10 [1] CRAN (R 4.0.0) #> digest 0.6.25 2020-02-23 [1] CRAN (R 4.0.0) #> dplyr * 1.0.0 2020-05-29 [1] CRAN (R 4.0.0) #> ellipsis 0.3.1 2020-05-15 [1] CRAN (R 4.0.0) #> evaluate 0.14 2019-05-28 [1] CRAN (R 4.0.0) #> fansi 0.4.1 2020-01-08 [1] CRAN (R 4.0.0) #> farver 2.0.3 2020-01-16 [1] CRAN (R 4.0.0) #> forcats * 0.5.0 2020-03-01 [1] CRAN (R 4.0.0) #> fs 1.4.1 2020-04-04 [1] CRAN (R 4.0.0) #> generics 0.0.2 2018-11-29 [1] CRAN (R 4.0.0) #> ggplot2 * 3.3.1 2020-05-28 [1] CRAN (R 4.0.0) #> glue 1.4.1 2020-05-13 [1] CRAN (R 4.0.0) #> gtable 0.3.0 2019-03-25 [1] CRAN (R 4.0.0) #> haven 2.3.1 2020-06-01 [1] CRAN (R 4.0.0) #> here * 0.1 2017-05-28 [1] CRAN (R 4.0.0) #> highr 0.8 2019-03-20 [1] CRAN (R 4.0.0) #> hms 0.5.3 2020-01-08 [1] CRAN (R 4.0.0) #> htmltools 0.4.0 2019-10-04 [1] CRAN (R 4.0.0) #> httr 1.4.1 2019-08-05 [1] CRAN (R 4.0.0) #> jsonlite 1.6.1 2020-02-02 [1] CRAN (R 4.0.0) #> knitr 1.28 2020-02-06 [1] CRAN (R 4.0.0) #> labeling 0.3 2014-08-23 [1] CRAN (R 4.0.0) #> lattice 0.20-41 2020-04-02 [1] CRAN (R 4.0.0) #> lifecycle 0.2.0 2020-03-06 [1] CRAN (R 4.0.0) #> lubridate 1.7.8 2020-04-06 [1] CRAN (R 4.0.0) #> magrittr 1.5 2014-11-22 [1] CRAN (R 4.0.0) #> memoise 1.1.0 2017-04-21 [1] CRAN (R 4.0.0) #> mime 0.9 2020-02-04 [1] CRAN (R 4.0.0) #> modelr 0.1.8 2020-05-19 [1] CRAN (R 4.0.0) #> munsell 0.5.0 2018-06-12 [1] CRAN (R 4.0.0) #> nlme 3.1-148 2020-05-24 [1] CRAN (R 4.0.0) #> pillar 1.4.4 2020-05-05 [1] CRAN (R 4.0.0) #> pkgbuild 1.0.8 2020-05-07 [1] CRAN (R 4.0.0) #> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.0.0) #> pkgload 1.1.0 2020-05-29 [1] CRAN (R 4.0.0) #> prettyunits 1.1.1 2020-01-24 [1] CRAN (R 4.0.0) #> processx 3.4.2 2020-02-09 [1] CRAN (R 4.0.0) #> ps 1.3.3 2020-05-08 [1] CRAN (R 4.0.0) #> purrr * 0.3.4 2020-04-17 [1] CRAN (R 4.0.0) #> R6 2.4.1 2019-11-12 [1] CRAN (R 4.0.0) #> Rcpp 1.0.4.6 2020-04-09 [1] CRAN (R 4.0.0) #> readr * 1.3.1 2018-12-21 [1] CRAN (R 4.0.0) #> readxl 1.3.1 2019-03-13 [1] CRAN (R 4.0.0) #> remotes 2.1.1 2020-02-15 [1] CRAN (R 4.0.0) #> reprex 0.3.0 2019-05-16 [1] CRAN (R 4.0.0) #> rlang 0.4.6.9000 2020-06-08 [1] Github (r-lib/rlang@10b32e8) #> rmarkdown 2.2 2020-05-31 [1] CRAN (R 4.0.0) #> rprojroot 1.3-2 2018-01-03 [1] CRAN (R 4.0.0) #> rvest 0.3.5 2019-11-08 [1] CRAN (R 4.0.0) #> scales 1.1.1 2020-05-11 [1] CRAN (R 4.0.0) #> sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 4.0.0) #> stringi 1.4.6 2020-02-17 [1] CRAN (R 4.0.0) #> stringr * 1.4.0 2019-02-10 [1] CRAN (R 4.0.0) #> testthat 2.3.2 2020-03-02 [1] CRAN (R 4.0.0) #> tibble * 3.0.1 2020-04-20 [1] CRAN (R 4.0.0) #> tidyr * 1.1.0 2020-05-20 [1] CRAN (R 4.0.0) #> tidyselect 1.1.0 2020-05-11 [1] CRAN (R 4.0.0) #> tidyverse * 1.3.0 2019-11-21 [1] CRAN (R 4.0.0) #> usethis 1.6.1 2020-04-29 [1] CRAN (R 4.0.0) #> vctrs 0.3.1 2020-06-05 [1] CRAN (R 4.0.1) #> withr 2.2.0 2020-04-20 [1] CRAN (R 4.0.0) #> xfun 0.14 2020-05-20 [1] CRAN (R 4.0.0) #> xml2 1.3.2 2020-04-23 [1] CRAN (R 4.0.0) #> yaml 2.2.1 2020-02-01 [1] CRAN (R 4.0.0) #> #> [1] /Library/Frameworks/R.framework/Versions/4.0/Resources/library ```
VanessaGuigon commented 4 years ago
## Use the script below to generate a reproducible example
## using the reprex package. Once you generate it, post it on
## https://github.com/uc-cfss/Discussion/issues/145
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /tmp/RtmpsFiLOu/reprexb78c935203417

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> Error: '/tmp/RtmpsFiLOu/reprexb78c935203417/data/urbanization-state.csv' does not exist.

# how do I reorder the bars from largest to smallest?
ggplot(data = urban, mapping = aes(x = state, y = urbanindex)) +
  geom_col() +
  coord_flip()
#> Error in ggplot(data = urban, mapping = aes(x = state, y = urbanindex)): object 'urban' not found

Created on 2020-07-09 by the reprex package (v0.3.0)

Session info ``` r devtools::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 4.0.1 (2020-06-06) #> os Red Hat Enterprise Linux 8.2 (Ootpa) #> system x86_64, linux-gnu #> ui X11 #> language (EN) #> collate en_US.UTF-8 #> ctype en_US.UTF-8 #> tz America/Chicago #> date 2020-07-09 #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date lib source #> assertthat 0.2.1 2019-03-21 [2] CRAN (R 4.0.1) #> backports 1.1.8 2020-06-17 [2] CRAN (R 4.0.1) #> blob 1.2.1 2020-01-20 [2] CRAN (R 4.0.1) #> broom 0.5.6 2020-04-20 [2] CRAN (R 4.0.1) #> callr 3.4.3 2020-03-28 [2] CRAN (R 4.0.1) #> cellranger 1.1.0 2016-07-27 [2] CRAN (R 4.0.1) #> cli 2.0.2 2020-02-28 [2] CRAN (R 4.0.1) #> colorspace 1.4-1 2019-03-18 [2] CRAN (R 4.0.1) #> crayon 1.3.4 2017-09-16 [2] CRAN (R 4.0.1) #> DBI 1.1.0 2019-12-15 [2] CRAN (R 4.0.1) #> dbplyr 1.4.4 2020-05-27 [2] CRAN (R 4.0.1) #> desc 1.2.0 2018-05-01 [2] CRAN (R 4.0.1) #> devtools 2.3.0 2020-04-10 [1] CRAN (R 4.0.1) #> digest 0.6.25 2020-02-23 [2] CRAN (R 4.0.1) #> dplyr * 1.0.0 2020-05-29 [2] CRAN (R 4.0.1) #> ellipsis 0.3.1 2020-05-15 [2] CRAN (R 4.0.1) #> evaluate 0.14 2019-05-28 [2] CRAN (R 4.0.1) #> fansi 0.4.1 2020-01-08 [2] CRAN (R 4.0.1) #> forcats * 0.5.0 2020-03-01 [2] CRAN (R 4.0.1) #> fs 1.4.1 2020-04-04 [2] CRAN (R 4.0.1) #> generics 0.0.2 2018-11-29 [2] CRAN (R 4.0.1) #> ggplot2 * 3.3.1 2020-05-28 [2] CRAN (R 4.0.1) #> glue 1.4.1 2020-05-13 [2] CRAN (R 4.0.1) #> gtable 0.3.0 2019-03-25 [2] CRAN (R 4.0.1) #> haven 2.3.1 2020-06-01 [2] CRAN (R 4.0.1) #> here * 0.1 2017-05-28 [2] CRAN (R 4.0.1) #> highr 0.8 2019-03-20 [2] CRAN (R 4.0.1) #> hms 0.5.3 2020-01-08 [2] CRAN (R 4.0.1) #> htmltools 0.4.0 2019-10-04 [2] CRAN (R 4.0.1) #> httr 1.4.1 2019-08-05 [2] CRAN (R 4.0.1) #> jsonlite 1.6.1 2020-02-02 [2] CRAN (R 4.0.1) #> knitr 1.28 2020-02-06 [2] CRAN (R 4.0.1) #> lattice 0.20-41 2020-04-02 [2] CRAN (R 4.0.1) #> lifecycle 0.2.0 2020-03-06 [2] CRAN (R 4.0.1) #> lubridate 1.7.9 2020-06-08 [2] CRAN (R 4.0.1) #> magrittr 1.5 2014-11-22 [2] CRAN (R 4.0.1) #> memoise 1.1.0 2017-04-21 [2] CRAN (R 4.0.1) #> modelr 0.1.8 2020-05-19 [2] CRAN (R 4.0.1) #> munsell 0.5.0 2018-06-12 [2] CRAN (R 4.0.1) #> nlme 3.1-148 2020-05-24 [2] CRAN (R 4.0.1) #> pillar 1.4.4 2020-05-05 [2] CRAN (R 4.0.1) #> pkgbuild 1.0.8 2020-05-07 [2] CRAN (R 4.0.1) #> pkgconfig 2.0.3 2019-09-22 [2] CRAN (R 4.0.1) #> pkgload 1.1.0 2020-05-29 [2] CRAN (R 4.0.1) #> prettyunits 1.1.1 2020-01-24 [2] CRAN (R 4.0.1) #> processx 3.4.2 2020-02-09 [2] CRAN (R 4.0.1) #> ps 1.3.3 2020-05-08 [2] CRAN (R 4.0.1) #> purrr * 0.3.4 2020-04-17 [2] CRAN (R 4.0.1) #> R6 2.4.1 2019-11-12 [2] CRAN (R 4.0.1) #> Rcpp 1.0.4.6 2020-04-09 [2] CRAN (R 4.0.1) #> readr * 1.3.1 2018-12-21 [2] CRAN (R 4.0.1) #> readxl 1.3.1 2019-03-13 [2] CRAN (R 4.0.1) #> remotes 2.1.1 2020-02-15 [2] CRAN (R 4.0.1) #> reprex 0.3.0 2019-05-16 [1] CRAN (R 4.0.1) #> rlang 0.4.6 2020-05-02 [2] CRAN (R 4.0.1) #> rmarkdown 2.2 2020-05-31 [2] CRAN (R 4.0.1) #> rprojroot 1.3-2 2018-01-03 [2] CRAN (R 4.0.1) #> rvest 0.3.5 2019-11-08 [2] CRAN (R 4.0.1) #> scales 1.1.1 2020-05-11 [2] CRAN (R 4.0.1) #> sessioninfo 1.1.1 2018-11-05 [2] CRAN (R 4.0.1) #> stringi 1.4.6 2020-02-17 [2] CRAN (R 4.0.1) #> stringr * 1.4.0 2019-02-10 [2] CRAN (R 4.0.1) #> testthat 2.3.2 2020-03-02 [2] CRAN (R 4.0.1) #> tibble * 3.0.1 2020-04-20 [2] CRAN (R 4.0.1) #> tidyr * 1.1.0 2020-05-20 [2] CRAN (R 4.0.1) #> tidyselect 1.1.0 2020-05-11 [2] CRAN (R 4.0.1) #> tidyverse * 1.3.0 2019-11-21 [1] CRAN (R 4.0.1) #> usethis 1.6.1 2020-04-29 [1] CRAN (R 4.0.1) #> vctrs 0.3.1 2020-06-05 [2] CRAN (R 4.0.1) #> withr 2.2.0 2020-04-20 [2] CRAN (R 4.0.1) #> xfun 0.14 2020-05-20 [2] CRAN (R 4.0.1) #> xml2 1.3.2 2020-04-23 [2] CRAN (R 4.0.1) #> yaml 2.2.1 2020-02-01 [2] CRAN (R 4.0.1) #> #> [1] /home/vanessag/R/x86_64-pc-linux-gnu-library/4.0 #> [2] /opt/R/4.0.1/lib/R/library ```
wmccullen commented 4 years ago
## Use the script below to generate a reproducible example
## using the reprex package. Once you generate it, post it on
## https://github.com/uc-cfss/Discussion/issues/145
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /Users/william/Desktop/reproducible-examples-and-git-master

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> Parsed with column specification:
#> cols(
#>   state = col_character(),
#>   urbanindex = col_double()
#> )

# how do I reorder the bars from largest to smallest?
ggplot(data = urban, mapping = aes(x = state, y = urbanindex)) +
  geom_col() +
  coord_flip()

Created on 2020-07-09 by the reprex package (v0.3.0)

fdicera commented 4 years ago
## Use the script below to generate a reproducible example
## using the reprex package. Once you generate it, post it on
## https://github.com/uc-cfss/Discussion/issues/145
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /Users/francescadicera/Desktop/reproducible-examples-and-git-master

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> Parsed with column specification:
#> cols(
#>   state = col_character(),
#>   urbanindex = col_double()
#> )

# how do I reorder the bars from largest to smallest?
ggplot(data = urban, mapping = aes(x = state, y = urbanindex)) +
  geom_col() +
  coord_flip()

Created on 2020-07-09 by the reprex package (v0.3.0)

klyzhng commented 4 years ago
## Use the script below to generate a reproducible example
## using the reprex package. Once you generate it, post it on
## https://github.com/uc-cfss/Discussion/issues/145
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at C:/Users/Family/Desktop/reproducible-examples-and-git-master

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> Parsed with column specification:
#> cols(
#>   state = col_character(),
#>   urbanindex = col_double()
#> )

# how do I reorder the bars from largest to smallest?
ggplot(data = urban, mapping = aes(x = state, y = urbanindex)) +
  geom_col() +
  coord_flip()

Created on 2020-07-09 by the reprex package (v0.3.0)

kathleencannell commented 4 years ago
## Use the script below to generate a reproducible example
## using the reprex package. Once you generate it, post it on
## https://github.com/uc-cfss/Discussion/issues/145
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /home/kcannell/reproducible-examples-and-git-master

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> Parsed with column specification:
#> cols(
#>   state = col_character(),
#>   urbanindex = col_double()
#> )

# how do I reorder the bars from largest to smallest?
ggplot(data = urban, mapping = aes(x = state, y = urbanindex)) +
  geom_col() +
  coord_flip()

Created on 2020-07-09 by the reprex package (v0.3.0)

cweis22 commented 4 years ago
## Use the script below to generate a reproducible example
## using the reprex package. Once you generate it, post it on
## https://github.com/uc-cfss/Discussion/issues/145
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /home/cweis22/reproducible-examples-and-git-master

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> Parsed with column specification:
#> cols(
#>   state = col_character(),
#>   urbanindex = col_double()
#> )

# how do I reorder the bars from largest to smallest?
ggplot(data = urban, mapping = aes(x = state, y = urbanindex)) +
  geom_col() +
  coord_flip()

Created on 2020-07-09 by the reprex package (v0.3.0)

Wendychenn commented 4 years ago
## Use the script below to generate a reproducible example
## using the reprex package. Once you generate it, post it on
## https://github.com/uc-cfss/Discussion/issues/145
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> Warning: package 'here' was built under R version 4.0.2
#> here() starts at C:/Users/Wendy/Desktop/reproducible-examples-and-git-master

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> Parsed with column specification:
#> cols(
#>   state = col_character(),
#>   urbanindex = col_double()
#> )

# how do I reorder the bars from largest to smallest?
ggplot(data = urban, mapping = aes(x = state, y = urbanindex)) +
  geom_col() +
  coord_flip()

Created on 2020-07-09 by the reprex package (v0.3.0)
rammkripa commented 4 years ago
## Use the script below to generate a reproducible example
## using the reprex package. Once you generate it, post it on
## https://github.com/uc-cfss/Discussion/issues/145
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /Users/ramkripa/Desktop/reproducible-examples-and-git-master

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> Parsed with column specification:
#> cols(
#>   state = col_character(),
#>   urbanindex = col_double()
#> )

# how do I reorder the bars from largest to smallest?
ggplot(data = urban, mapping = aes(x = state, y = urbanindex)) +
  geom_col() +
  coord_flip()

Created on 2020-07-09 by the reprex package (v0.3.0)

outfile = NA seems useful

VanessaGuigon commented 4 years ago
## Use the script below to generate a reproducible example
## using the reprex package. Once you generate it, post it on
## https://github.com/uc-cfss/Discussion/issues/145
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /home/vanessag/reproducible-examples-and-git-master

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> Parsed with column specification:
#> cols(
#>   state = col_character(),
#>   urbanindex = col_double()
#> )

# how do I reorder the bars from largest to smallest?
ggplot(data = urban, mapping = aes(x = state, y = urbanindex)) +
  geom_col() +
  coord_flip()

Created on 2020-07-09 by the reprex package (v0.3.0)

Session info ``` r devtools::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 4.0.1 (2020-06-06) #> os Red Hat Enterprise Linux 8.2 (Ootpa) #> system x86_64, linux-gnu #> ui X11 #> language (EN) #> collate en_US.UTF-8 #> ctype en_US.UTF-8 #> tz America/Chicago #> date 2020-07-09 #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date lib source #> assertthat 0.2.1 2019-03-21 [2] CRAN (R 4.0.1) #> backports 1.1.8 2020-06-17 [2] CRAN (R 4.0.1) #> blob 1.2.1 2020-01-20 [2] CRAN (R 4.0.1) #> broom 0.5.6 2020-04-20 [2] CRAN (R 4.0.1) #> callr 3.4.3 2020-03-28 [2] CRAN (R 4.0.1) #> cellranger 1.1.0 2016-07-27 [2] CRAN (R 4.0.1) #> cli 2.0.2 2020-02-28 [2] CRAN (R 4.0.1) #> colorspace 1.4-1 2019-03-18 [2] CRAN (R 4.0.1) #> crayon 1.3.4 2017-09-16 [2] CRAN (R 4.0.1) #> curl 4.3 2019-12-02 [2] CRAN (R 4.0.1) #> DBI 1.1.0 2019-12-15 [2] CRAN (R 4.0.1) #> dbplyr 1.4.4 2020-05-27 [2] CRAN (R 4.0.1) #> desc 1.2.0 2018-05-01 [2] CRAN (R 4.0.1) #> devtools 2.3.0 2020-04-10 [1] CRAN (R 4.0.1) #> digest 0.6.25 2020-02-23 [2] CRAN (R 4.0.1) #> dplyr * 1.0.0 2020-05-29 [2] CRAN (R 4.0.1) #> ellipsis 0.3.1 2020-05-15 [2] CRAN (R 4.0.1) #> evaluate 0.14 2019-05-28 [2] CRAN (R 4.0.1) #> fansi 0.4.1 2020-01-08 [2] CRAN (R 4.0.1) #> farver 2.0.3 2020-01-16 [2] CRAN (R 4.0.1) #> forcats * 0.5.0 2020-03-01 [2] CRAN (R 4.0.1) #> fs 1.4.1 2020-04-04 [2] CRAN (R 4.0.1) #> generics 0.0.2 2018-11-29 [2] CRAN (R 4.0.1) #> ggplot2 * 3.3.1 2020-05-28 [2] CRAN (R 4.0.1) #> glue 1.4.1 2020-05-13 [2] CRAN (R 4.0.1) #> gtable 0.3.0 2019-03-25 [2] CRAN (R 4.0.1) #> haven 2.3.1 2020-06-01 [2] CRAN (R 4.0.1) #> here * 0.1 2017-05-28 [2] CRAN (R 4.0.1) #> highr 0.8 2019-03-20 [2] CRAN (R 4.0.1) #> hms 0.5.3 2020-01-08 [2] CRAN (R 4.0.1) #> htmltools 0.4.0 2019-10-04 [2] CRAN (R 4.0.1) #> httr 1.4.1 2019-08-05 [2] CRAN (R 4.0.1) #> jsonlite 1.6.1 2020-02-02 [2] CRAN (R 4.0.1) #> knitr 1.28 2020-02-06 [2] CRAN (R 4.0.1) #> labeling 0.3 2014-08-23 [2] CRAN (R 4.0.1) #> lattice 0.20-41 2020-04-02 [2] CRAN (R 4.0.1) #> lifecycle 0.2.0 2020-03-06 [2] CRAN (R 4.0.1) #> lubridate 1.7.9 2020-06-08 [2] CRAN (R 4.0.1) #> magrittr 1.5 2014-11-22 [2] CRAN (R 4.0.1) #> memoise 1.1.0 2017-04-21 [2] CRAN (R 4.0.1) #> mime 0.9 2020-02-04 [2] CRAN (R 4.0.1) #> modelr 0.1.8 2020-05-19 [2] CRAN (R 4.0.1) #> munsell 0.5.0 2018-06-12 [2] CRAN (R 4.0.1) #> nlme 3.1-148 2020-05-24 [2] CRAN (R 4.0.1) #> pillar 1.4.4 2020-05-05 [2] CRAN (R 4.0.1) #> pkgbuild 1.0.8 2020-05-07 [2] CRAN (R 4.0.1) #> pkgconfig 2.0.3 2019-09-22 [2] CRAN (R 4.0.1) #> pkgload 1.1.0 2020-05-29 [2] CRAN (R 4.0.1) #> prettyunits 1.1.1 2020-01-24 [2] CRAN (R 4.0.1) #> processx 3.4.2 2020-02-09 [2] CRAN (R 4.0.1) #> ps 1.3.3 2020-05-08 [2] CRAN (R 4.0.1) #> purrr * 0.3.4 2020-04-17 [2] CRAN (R 4.0.1) #> R6 2.4.1 2019-11-12 [2] CRAN (R 4.0.1) #> Rcpp 1.0.4.6 2020-04-09 [2] CRAN (R 4.0.1) #> readr * 1.3.1 2018-12-21 [2] CRAN (R 4.0.1) #> readxl 1.3.1 2019-03-13 [2] CRAN (R 4.0.1) #> remotes 2.1.1 2020-02-15 [2] CRAN (R 4.0.1) #> reprex 0.3.0 2019-05-16 [1] CRAN (R 4.0.1) #> rlang 0.4.6 2020-05-02 [2] CRAN (R 4.0.1) #> rmarkdown 2.2 2020-05-31 [2] CRAN (R 4.0.1) #> rprojroot 1.3-2 2018-01-03 [2] CRAN (R 4.0.1) #> rvest 0.3.5 2019-11-08 [2] CRAN (R 4.0.1) #> scales 1.1.1 2020-05-11 [2] CRAN (R 4.0.1) #> sessioninfo 1.1.1 2018-11-05 [2] CRAN (R 4.0.1) #> stringi 1.4.6 2020-02-17 [2] CRAN (R 4.0.1) #> stringr * 1.4.0 2019-02-10 [2] CRAN (R 4.0.1) #> testthat 2.3.2 2020-03-02 [2] CRAN (R 4.0.1) #> tibble * 3.0.1 2020-04-20 [2] CRAN (R 4.0.1) #> tidyr * 1.1.0 2020-05-20 [2] CRAN (R 4.0.1) #> tidyselect 1.1.0 2020-05-11 [2] CRAN (R 4.0.1) #> tidyverse * 1.3.0 2019-11-21 [1] CRAN (R 4.0.1) #> usethis 1.6.1 2020-04-29 [1] CRAN (R 4.0.1) #> vctrs 0.3.1 2020-06-05 [2] CRAN (R 4.0.1) #> withr 2.2.0 2020-04-20 [2] CRAN (R 4.0.1) #> xfun 0.14 2020-05-20 [2] CRAN (R 4.0.1) #> xml2 1.3.2 2020-04-23 [2] CRAN (R 4.0.1) #> yaml 2.2.1 2020-02-01 [2] CRAN (R 4.0.1) #> #> [1] /home/vanessag/R/x86_64-pc-linux-gnu-library/4.0 #> [2] /opt/R/4.0.1/lib/R/library ```
Wendychenn commented 4 years ago
## Use the script below to generate a reproducible example
## using the reprex package. Use datapasta::dpasta() to create
## `urban` in the script rather than relying on the source
## CSV file. Once you generate it, post it on
## https://github.com/uc-cfss/Discussion/issues/146

library(tidyverse)
library(here)
#> Warning: package 'here' was built under R version 4.0.2
#> here() starts at C:/Users/Wendy/AppData/Local/Temp/RtmpCk9Tbj/reprex37042aa74db8

# import data file
urban <- tibble::tribble(
  ~state, ~urbanindex,
  "Alabama",    9.605935,
  "Alaska",    8.735964,
  "American Samoa",    11.08593,
  "Arizona",    11.29971,
  "Arkansas",    9.259444,
  "California",    12.19028,
  "Colorado",    11.15445,
  "Connecticut",    11.40968,
  "Delaware",    11.00999,
  "District of Columbia",    13.44057,
  "Florida",    11.46484,
  "Georgia",    10.55233,
  "Guam",    11.08593,
  "Hawaii",    11.08621,
  "Idaho",    9.593634,
  "Illinois",    11.62372,
  "Indiana",     10.4105,
  "Iowa",    9.593525,
  "Kansas",    10.12044,
  "Kentucky",    9.789536,
  "Louisiana",    10.17518,
  "Maine",    9.037091,
  "Maryland",    11.71105,
  "Massachusetts",    11.83973,
  "Michigan",    10.80559,
  "Minnesota",    10.45684,
  "Mississippi",    8.910859,
  "Missouri",    10.20212,
  "Montana",    8.470226,
  "Nebraska",    10.19912,
  "Nevada",    11.76972,
  "New Hampshire",    9.917139,
  "New Jersey",    12.23565,
  "New Mexico",    9.896993,
  "New York",    12.55857,
  "North Carolina",    10.32481,
  "North Dakota",    9.054678,
  "Northern Marianas",    11.08593,
  "Ohio",    10.87687,
  "Oklahoma",     9.93928,
  "Oregon",    10.71233,
  "Pennsylvania",    11.14623,
  "Puerto Rico",    11.57168,
  "Rhode Island",    11.72124,
  "South Carolina",    10.11142,
  "South Dakota",    8.728642,
  "Tennessee",    10.19729,
  "Texas",    11.17488,
  "Utah",    10.96281,
  "Vermont",    8.843222,
  "Virgin Islands",    11.08593,
  "Virginia",    10.90625,
  "Washington",    11.11933,
  "West Virginia",    9.111112,
  "Wisconsin",    10.19131,
  "Wyoming",    8.256294
)

# how do I reorder the bars from largest to smallest?
ggplot(data = urban, mapping = aes(x = state, y = urbanindex)) +
  geom_col() +
  coord_flip()

Created on 2020-07-09 by the reprex package (v0.3.0)