cis-ds / Discussion

Public discussion
10 stars 15 forks source link

03-reorder-urban-example #182

Closed bensoltoff closed 2 years ago

bensoltoff commented 3 years ago

Post your reproducible example here

liu15611 commented 3 years ago
library(tidyverse)
library(here)
#> here() starts at /tmp/Rtmpc6RIB0/reprex17f9912d344898

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> Error: '/tmp/Rtmpc6RIB0/reprex17f9912d344898/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 2021-02-18 by the reprex package (v0.3.0)

jthedu commented 3 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/182
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /home/duj/uc-cfss-reproducible-examples-and-git-47116e5

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> 
#> ── 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 2021-02-18 by the reprex package (v0.3.0)

jthedu commented 3 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/182
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /home/duj/uc-cfss-reproducible-examples-and-git-47116e5

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> 
#> ── 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 2021-02-18 by the reprex package (v0.3.0)

bensoltoff commented 3 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/182
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /tmp/RtmpyRPUuS/reprex17fb0050e025b6

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> Error: '/tmp/RtmpyRPUuS/reprex17fb0050e025b6/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 2021-02-18 by the reprex package (v0.3.0)

liu15611 commented 3 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/182
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /home/liu15/uc-cfss-reproducible-examples-and-git-47116e5

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> 
#> ── 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 2021-02-18 by the reprex package (v0.3.0)

bensoltoff commented 3 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/182
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /home/soltoffbc/uc-cfss-reproducible-examples-and-git-47116e5

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> 
#> ── 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 2021-02-18 by the reprex package (v0.3.0)

nearridge commented 3 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/182
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /home/neerajs/uc-cfss-reproducible-examples-and-git-47116e5

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> 
#> ── 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 2021-02-18 by the reprex package (v0.3.0)

vinsgromeo commented 3 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/182
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /home/romeov/uc-cfss-reproducible-examples-and-git-47116e5

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> 
#> ── 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 2021-02-18 by the reprex package (v0.3.0)

lisettegonzalez commented 3 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/182
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /home/lisettegonzalez/uc-cfss-reproducible-examples-and-git-47116e5

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> 
#> ── 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 2021-02-18 by the reprex package (v0.3.0)

mnjones323 commented 3 years ago
library(tidyverse)
library(here)
#> here() starts at /home/mnjones/uc-cfss-reproducible-examples-and-git-47116e5

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> 
#> ── 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 2021-02-18 by the reprex package (v0.3.0)

lkataja commented 3 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/182
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /home/kataja/uc-cfss-reproducible-examples-and-git-47116e5

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> 
#> ── 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 2021-02-18 by the reprex package (v0.3.0)

sterlingfearing commented 3 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/182
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /Users/sterlingfearing/Desktop/uc-cfss-reproducible-examples-and-git-47116e5

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> 
#> ── 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 2021-02-18 by the reprex package (v1.0.0)

ellamarrero commented 3 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/182
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /private/var/folders/zv/rv8z4v813mx97x8xfjqm7jy00000gn/T/RtmpA7FsqV/reprex153e66e26c291

# 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 2021-02-18 by the reprex package (v1.0.0)

chidatlam commented 3 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/182
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /home/dlam8/uc-cfss-reproducible-examples-and-git-47116e5
library(datapasta)

# 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 2021-02-18 by the reprex package (v0.3.0)

avivawaldman commented 3 years ago
library(tidyverse)
library(here)
#> here() starts at C:/Users/aviva/AppData/Local/Temp/Rtmp8iPnQ6/reprex420878867657
library(datapasta)
# 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 2021-02-18 by the reprex package (v0.3.0)

gdicera commented 3 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/182
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /home/giuseppedicera/uc-cfss-reproducible-examples-and-git-4cced8f

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> 
#> ── 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 2021-07-13 by the reprex package (v2.0.0)

agodinez711 commented 3 years ago
mean(rnorm(100))
#> [1] -0.02342822

Created on 2021-07-13 by the reprex package (v2.0.0)

Session info ``` r sessioninfo::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 4.0.1 (2020-06-06) #> os Red Hat Enterprise Linux 8.4 (Ootpa) #> system x86_64, linux-gnu #> ui X11 #> language (EN) #> collate en_US.UTF-8 #> ctype en_US.UTF-8 #> tz America/Chicago #> date 2021-07-13 #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date lib source #> backports 1.2.1 2020-12-09 [2] CRAN (R 4.0.1) #> cli 2.5.0 2021-04-26 [1] CRAN (R 4.0.1) #> crayon 1.4.1 2021-02-08 [2] CRAN (R 4.0.1) #> digest 0.6.27 2020-10-24 [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.2 2021-01-15 [2] CRAN (R 4.0.1) #> fs 1.5.0 2020-07-31 [2] CRAN (R 4.0.1) #> glue 1.4.2 2020-08-27 [2] CRAN (R 4.0.1) #> highr 0.8 2019-03-20 [2] CRAN (R 4.0.1) #> htmltools 0.5.1.1 2021-01-22 [2] CRAN (R 4.0.1) #> knitr 1.31 2021-01-27 [2] CRAN (R 4.0.1) #> lifecycle 1.0.0 2021-02-15 [2] CRAN (R 4.0.1) #> magrittr 2.0.1 2020-11-17 [2] CRAN (R 4.0.1) #> pillar 1.5.1 2021-03-05 [2] CRAN (R 4.0.1) #> pkgconfig 2.0.3 2019-09-22 [2] CRAN (R 4.0.1) #> purrr 0.3.4 2020-04-17 [2] CRAN (R 4.0.1) #> reprex 2.0.0 2021-04-02 [1] CRAN (R 4.0.1) #> rlang 0.4.10 2020-12-30 [2] CRAN (R 4.0.1) #> rmarkdown 2.7 2021-02-19 [2] CRAN (R 4.0.1) #> sessioninfo 1.1.1 2018-11-05 [2] CRAN (R 4.0.1) #> stringi 1.5.3 2020-09-09 [2] CRAN (R 4.0.1) #> stringr 1.4.0 2019-02-10 [2] CRAN (R 4.0.1) #> styler 1.4.1 2021-03-30 [2] CRAN (R 4.0.1) #> tibble 3.1.0 2021-02-25 [2] CRAN (R 4.0.1) #> utf8 1.2.1 2021-03-12 [2] CRAN (R 4.0.1) #> vctrs 0.3.7 2021-03-29 [2] CRAN (R 4.0.1) #> withr 2.4.1 2021-01-26 [2] CRAN (R 4.0.1) #> xfun 0.22 2021-03-11 [2] CRAN (R 4.0.1) #> yaml 2.2.1 2020-02-01 [2] CRAN (R 4.0.1) #> #> [1] /home/agodinez7/R/x86_64-pc-linux-gnu-library/4.0 #> [2] /opt/R/4.0.1/lib/R/library ```
bethwang06 commented 3 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/182
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /Users/bethwang/Desktop/uc-cfss-reproducible-examples-and-git-4cced8f

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> 
#> ── 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 2021-07-13 by the reprex package (v2.0.0)

Session info ``` r sessioninfo::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 4.1.0 (2021-05-18) #> os macOS Big Sur 10.16 #> system x86_64, darwin17.0 #> ui X11 #> language (EN) #> collate en_US.UTF-8 #> ctype en_US.UTF-8 #> tz America/Chicago #> date 2021-07-13 #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date lib source #> assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.1.0) #> backports 1.2.1 2020-12-09 [1] CRAN (R 4.1.0) #> broom 0.7.7 2021-06-13 [1] CRAN (R 4.1.0) #> cellranger 1.1.0 2016-07-27 [1] CRAN (R 4.1.0) #> cli 2.5.0 2021-04-26 [1] CRAN (R 4.1.0) #> colorspace 2.0-1 2021-05-04 [1] CRAN (R 4.1.0) #> crayon 1.4.1 2021-02-08 [1] CRAN (R 4.1.0) #> curl 4.3.1 2021-04-30 [1] CRAN (R 4.1.0) #> DBI 1.1.1 2021-01-15 [1] CRAN (R 4.1.0) #> dbplyr 2.1.1 2021-04-06 [1] CRAN (R 4.1.0) #> digest 0.6.27 2020-10-24 [1] CRAN (R 4.1.0) #> dplyr * 1.0.7 2021-06-18 [1] CRAN (R 4.1.0) #> ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.1.0) #> evaluate 0.14 2019-05-28 [1] CRAN (R 4.1.0) #> fansi 0.5.0 2021-05-25 [1] CRAN (R 4.1.0) #> farver 2.1.0 2021-02-28 [1] CRAN (R 4.1.0) #> forcats * 0.5.1 2021-01-27 [1] CRAN (R 4.1.0) #> fs 1.5.0 2020-07-31 [1] CRAN (R 4.1.0) #> generics 0.1.0 2020-10-31 [1] CRAN (R 4.1.0) #> ggplot2 * 3.3.4 2021-06-16 [1] CRAN (R 4.1.0) #> glue 1.4.2 2020-08-27 [1] CRAN (R 4.1.0) #> gtable 0.3.0 2019-03-25 [1] CRAN (R 4.1.0) #> haven 2.4.1 2021-04-23 [1] CRAN (R 4.1.0) #> here * 1.0.1 2020-12-13 [1] CRAN (R 4.1.0) #> highr 0.9 2021-04-16 [1] CRAN (R 4.1.0) #> hms 1.1.0 2021-05-17 [1] CRAN (R 4.1.0) #> htmltools 0.5.1.1 2021-01-22 [1] CRAN (R 4.1.0) #> httr 1.4.2 2020-07-20 [1] CRAN (R 4.1.0) #> jsonlite 1.7.2 2020-12-09 [1] CRAN (R 4.1.0) #> knitr 1.33 2021-04-24 [1] CRAN (R 4.1.0) #> labeling 0.4.2 2020-10-20 [1] CRAN (R 4.1.0) #> lifecycle 1.0.0 2021-02-15 [1] CRAN (R 4.1.0) #> lubridate 1.7.10 2021-02-26 [1] CRAN (R 4.1.0) #> magrittr 2.0.1 2020-11-17 [1] CRAN (R 4.1.0) #> mime 0.10 2021-02-13 [1] CRAN (R 4.1.0) #> modelr 0.1.8 2020-05-19 [1] CRAN (R 4.1.0) #> munsell 0.5.0 2018-06-12 [1] CRAN (R 4.1.0) #> pillar 1.6.1 2021-05-16 [1] CRAN (R 4.1.0) #> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.1.0) #> purrr * 0.3.4 2020-04-17 [1] CRAN (R 4.1.0) #> R6 2.5.0 2020-10-28 [1] CRAN (R 4.1.0) #> Rcpp 1.0.6 2021-01-15 [1] CRAN (R 4.1.0) #> readr * 1.4.0 2020-10-05 [1] CRAN (R 4.1.0) #> readxl 1.3.1 2019-03-13 [1] CRAN (R 4.1.0) #> reprex 2.0.0 2021-04-02 [1] CRAN (R 4.1.0) #> rlang 0.4.11 2021-04-30 [1] CRAN (R 4.1.0) #> rmarkdown 2.9 2021-06-15 [1] CRAN (R 4.1.0) #> rprojroot 2.0.2 2020-11-15 [1] CRAN (R 4.1.0) #> rstudioapi 0.13 2020-11-12 [1] CRAN (R 4.1.0) #> rvest 1.0.0 2021-03-09 [1] CRAN (R 4.1.0) #> scales 1.1.1 2020-05-11 [1] CRAN (R 4.1.0) #> sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 4.1.0) #> stringi 1.6.2 2021-05-17 [1] CRAN (R 4.1.0) #> stringr * 1.4.0 2019-02-10 [1] CRAN (R 4.1.0) #> styler 1.4.1 2021-03-30 [1] CRAN (R 4.1.0) #> tibble * 3.1.2 2021-05-16 [1] CRAN (R 4.1.0) #> tidyr * 1.1.3 2021-03-03 [1] CRAN (R 4.1.0) #> tidyselect 1.1.1 2021-04-30 [1] CRAN (R 4.1.0) #> tidyverse * 1.3.1 2021-04-15 [1] CRAN (R 4.1.0) #> utf8 1.2.1 2021-03-12 [1] CRAN (R 4.1.0) #> vctrs 0.3.8 2021-04-29 [1] CRAN (R 4.1.0) #> withr 2.4.2 2021-04-18 [1] CRAN (R 4.1.0) #> xfun 0.24 2021-06-15 [1] CRAN (R 4.1.0) #> xml2 1.3.2 2020-04-23 [1] CRAN (R 4.1.0) #> yaml 2.2.1 2020-02-01 [1] CRAN (R 4.1.0) #> #> [1] /Library/Frameworks/R.framework/Versions/4.1/Resources/library ```
anabellxu commented 3 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/182
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /tmp/RtmpoKZLHf/reprex-15e60b6db2945d-surly-egg

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> Error: '/tmp/RtmpoKZLHf/reprex-15e60b6db2945d-surly-egg/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 2021-07-13 by the reprex package (v2.0.0)

Session info ``` r sessioninfo::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 4.0.1 (2020-06-06) #> os Red Hat Enterprise Linux 8.4 (Ootpa) #> system x86_64, linux-gnu #> ui X11 #> language (EN) #> collate en_US.UTF-8 #> ctype en_US.UTF-8 #> tz America/Chicago #> date 2021-07-13 #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date lib source #> assertthat 0.2.1 2019-03-21 [2] CRAN (R 4.0.1) #> backports 1.2.1 2020-12-09 [2] CRAN (R 4.0.1) #> broom 0.7.5 2021-02-19 [2] CRAN (R 4.0.1) #> cellranger 1.1.0 2016-07-27 [2] CRAN (R 4.0.1) #> cli 3.0.0 2021-06-30 [1] CRAN (R 4.0.1) #> colorspace 2.0-0 2020-11-11 [2] CRAN (R 4.0.1) #> crayon 1.4.1 2021-02-08 [2] CRAN (R 4.0.1) #> DBI 1.1.1 2021-01-15 [2] CRAN (R 4.0.1) #> dbplyr 2.1.0 2021-02-03 [2] CRAN (R 4.0.1) #> digest 0.6.27 2020-10-24 [2] CRAN (R 4.0.1) #> dplyr * 1.0.7 2021-06-18 [1] 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.2 2021-01-15 [2] CRAN (R 4.0.1) #> forcats * 0.5.1 2021-01-27 [2] CRAN (R 4.0.1) #> fs 1.5.0 2020-07-31 [2] CRAN (R 4.0.1) #> generics 0.1.0 2020-10-31 [2] CRAN (R 4.0.1) #> ggplot2 * 3.3.3 2020-12-30 [2] CRAN (R 4.0.1) #> glue 1.4.2 2020-08-27 [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 * 1.0.1 2020-12-13 [2] CRAN (R 4.0.1) #> highr 0.9 2021-04-16 [1] CRAN (R 4.0.1) #> hms 1.0.0 2021-01-13 [2] CRAN (R 4.0.1) #> htmltools 0.5.1.1 2021-01-22 [2] CRAN (R 4.0.1) #> httr 1.4.2 2020-07-20 [2] CRAN (R 4.0.1) #> jsonlite 1.7.2 2020-12-09 [2] CRAN (R 4.0.1) #> knitr 1.33 2021-04-24 [1] CRAN (R 4.0.1) #> lifecycle 1.0.0 2021-02-15 [2] CRAN (R 4.0.1) #> lubridate 1.7.10 2021-02-26 [2] CRAN (R 4.0.1) #> magrittr 2.0.1 2020-11-17 [1] 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) #> pillar 1.5.1 2021-03-05 [2] CRAN (R 4.0.1) #> pkgconfig 2.0.3 2019-09-22 [2] CRAN (R 4.0.1) #> purrr * 0.3.4 2020-04-17 [2] CRAN (R 4.0.1) #> R6 2.5.0 2020-10-28 [2] CRAN (R 4.0.1) #> Rcpp 1.0.6 2021-01-15 [2] CRAN (R 4.0.1) #> readr * 1.4.0 2020-10-05 [2] CRAN (R 4.0.1) #> readxl 1.3.1 2019-03-13 [2] CRAN (R 4.0.1) #> reprex 2.0.0 2021-04-02 [1] CRAN (R 4.0.1) #> rlang 0.4.11 2021-04-30 [1] CRAN (R 4.0.1) #> rmarkdown 2.9 2021-06-15 [1] CRAN (R 4.0.1) #> rprojroot 2.0.2 2020-11-15 [2] CRAN (R 4.0.1) #> rstudioapi 0.13 2020-11-12 [2] CRAN (R 4.0.1) #> rvest 1.0.0 2021-03-09 [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.6.2 2021-05-17 [1] CRAN (R 4.0.1) #> stringr * 1.4.0 2019-02-10 [2] CRAN (R 4.0.1) #> styler 1.4.1 2021-03-30 [2] CRAN (R 4.0.1) #> tibble * 3.1.0 2021-02-25 [2] CRAN (R 4.0.1) #> tidyr * 1.1.3 2021-03-03 [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 [2] CRAN (R 4.0.1) #> utf8 1.2.1 2021-03-12 [2] CRAN (R 4.0.1) #> vctrs 0.3.7 2021-03-29 [2] CRAN (R 4.0.1) #> withr 2.4.2 2021-04-18 [1] CRAN (R 4.0.1) #> xfun 0.24 2021-06-15 [1] 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/anabellxu/R/x86_64-pc-linux-gnu-library/4.0 #> [2] /opt/R/4.0.1/lib/R/library ```
dipro-ray commented 3 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/182
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /home/raydipro/uc-cfss-reproducible-examples-and-git-4cced8f

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> 
#> ── 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 2021-07-13 by the reprex package (v2.0.0)

Session info ``` r sessioninfo::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 4.0.1 (2020-06-06) #> os Red Hat Enterprise Linux 8.4 (Ootpa) #> system x86_64, linux-gnu #> ui X11 #> language (EN) #> collate en_US.UTF-8 #> ctype en_US.UTF-8 #> tz America/Chicago #> date 2021-07-13 #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date lib source #> assertthat 0.2.1 2019-03-21 [2] CRAN (R 4.0.1) #> backports 1.2.1 2020-12-09 [2] CRAN (R 4.0.1) #> broom 0.7.5 2021-02-19 [2] CRAN (R 4.0.1) #> cellranger 1.1.0 2016-07-27 [2] CRAN (R 4.0.1) #> cli 2.3.1 2021-02-23 [2] CRAN (R 4.0.1) #> colorspace 2.0-0 2020-11-11 [2] CRAN (R 4.0.1) #> crayon 1.4.1 2021-02-08 [2] CRAN (R 4.0.1) #> curl 4.3 2019-12-02 [2] CRAN (R 4.0.1) #> DBI 1.1.1 2021-01-15 [2] CRAN (R 4.0.1) #> dbplyr 2.1.0 2021-02-03 [2] CRAN (R 4.0.1) #> digest 0.6.27 2020-10-24 [2] CRAN (R 4.0.1) #> dplyr * 1.0.5 2021-03-05 [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.2 2021-01-15 [2] CRAN (R 4.0.1) #> farver 2.1.0 2021-02-28 [2] CRAN (R 4.0.1) #> forcats * 0.5.1 2021-01-27 [2] CRAN (R 4.0.1) #> fs 1.5.0 2020-07-31 [2] CRAN (R 4.0.1) #> generics 0.1.0 2020-10-31 [2] CRAN (R 4.0.1) #> ggplot2 * 3.3.3 2020-12-30 [2] CRAN (R 4.0.1) #> glue 1.4.2 2020-08-27 [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 * 1.0.1 2020-12-13 [1] CRAN (R 4.0.1) #> highr 0.8 2019-03-20 [2] CRAN (R 4.0.1) #> hms 1.0.0 2021-01-13 [2] CRAN (R 4.0.1) #> htmltools 0.5.1.1 2021-01-22 [2] CRAN (R 4.0.1) #> httr 1.4.2 2020-07-20 [2] CRAN (R 4.0.1) #> jsonlite 1.7.2 2020-12-09 [2] CRAN (R 4.0.1) #> knitr 1.31 2021-01-27 [2] CRAN (R 4.0.1) #> labeling 0.4.2 2020-10-20 [2] CRAN (R 4.0.1) #> lifecycle 1.0.0 2021-02-15 [2] CRAN (R 4.0.1) #> lubridate 1.7.10 2021-02-26 [2] CRAN (R 4.0.1) #> magrittr 2.0.1 2020-11-17 [2] CRAN (R 4.0.1) #> mime 0.10 2021-02-13 [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) #> pillar 1.5.1 2021-03-05 [2] CRAN (R 4.0.1) #> pkgconfig 2.0.3 2019-09-22 [2] CRAN (R 4.0.1) #> purrr * 0.3.4 2020-04-17 [2] CRAN (R 4.0.1) #> R6 2.5.0 2020-10-28 [2] CRAN (R 4.0.1) #> Rcpp 1.0.6 2021-01-15 [2] CRAN (R 4.0.1) #> readr * 1.4.0 2020-10-05 [2] CRAN (R 4.0.1) #> readxl 1.3.1 2019-03-13 [2] CRAN (R 4.0.1) #> reprex 2.0.0 2021-04-02 [2] CRAN (R 4.0.1) #> rlang 0.4.10 2020-12-30 [2] CRAN (R 4.0.1) #> rmarkdown 2.7 2021-02-19 [2] CRAN (R 4.0.1) #> rprojroot 2.0.2 2020-11-15 [2] CRAN (R 4.0.1) #> rstudioapi 0.13 2020-11-12 [2] CRAN (R 4.0.1) #> rvest 1.0.0 2021-03-09 [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.5.3 2020-09-09 [2] CRAN (R 4.0.1) #> stringr * 1.4.0 2019-02-10 [2] CRAN (R 4.0.1) #> styler 1.4.1 2021-03-30 [2] CRAN (R 4.0.1) #> tibble * 3.1.0 2021-02-25 [2] CRAN (R 4.0.1) #> tidyr * 1.1.3 2021-03-03 [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 [2] CRAN (R 4.0.1) #> utf8 1.2.1 2021-03-12 [2] CRAN (R 4.0.1) #> vctrs 0.3.7 2021-03-29 [2] CRAN (R 4.0.1) #> withr 2.4.1 2021-01-26 [2] CRAN (R 4.0.1) #> xfun 0.22 2021-03-11 [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/raydipro/R/x86_64-pc-linux-gnu-library/4.0 #> [2] /opt/R/4.0.1/lib/R/library ```
bensoltoff commented 3 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/182
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /home/soltoffbc/uc-cfss-reproducible-examples-and-git-4cced8f

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> 
#> ── 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 2021-07-13 by the reprex package (v2.0.0)

Session info ``` r sessioninfo::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 4.0.1 (2020-06-06) #> os Red Hat Enterprise Linux 8.4 (Ootpa) #> system x86_64, linux-gnu #> ui X11 #> language (EN) #> collate en_US.UTF-8 #> ctype en_US.UTF-8 #> tz America/Chicago #> date 2021-07-13 #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date lib source #> assertthat 0.2.1 2019-03-21 [2] CRAN (R 4.0.1) #> backports 1.2.1 2020-12-09 [2] CRAN (R 4.0.1) #> broom 0.7.5 2021-02-19 [2] CRAN (R 4.0.1) #> cellranger 1.1.0 2016-07-27 [2] CRAN (R 4.0.1) #> cli 2.5.0 2021-04-26 [1] CRAN (R 4.0.1) #> colorspace 2.0-0 2020-11-11 [2] CRAN (R 4.0.1) #> crayon 1.4.1 2021-02-08 [2] CRAN (R 4.0.1) #> curl 4.3.1 2021-04-30 [1] CRAN (R 4.0.1) #> DBI 1.1.1 2021-01-15 [2] CRAN (R 4.0.1) #> dbplyr 2.1.0 2021-02-03 [2] CRAN (R 4.0.1) #> digest 0.6.27 2020-10-24 [2] CRAN (R 4.0.1) #> dplyr * 1.0.7 2021-06-18 [1] CRAN (R 4.0.1) #> ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.0.1) #> evaluate 0.14 2019-05-28 [2] CRAN (R 4.0.1) #> fansi 0.5.0 2021-05-25 [1] CRAN (R 4.0.1) #> farver 2.1.0 2021-02-28 [2] CRAN (R 4.0.1) #> forcats * 0.5.1 2021-01-27 [2] CRAN (R 4.0.1) #> fs 1.5.0 2020-07-31 [2] CRAN (R 4.0.1) #> generics 0.1.0 2020-10-31 [2] CRAN (R 4.0.1) #> ggplot2 * 3.3.3 2020-12-30 [2] CRAN (R 4.0.1) #> glue 1.4.2 2020-08-27 [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 * 1.0.1 2020-12-13 [2] CRAN (R 4.0.1) #> highr 0.8 2019-03-20 [2] CRAN (R 4.0.1) #> hms 1.0.0 2021-01-13 [2] CRAN (R 4.0.1) #> htmltools 0.5.1.1 2021-01-22 [2] CRAN (R 4.0.1) #> httr 1.4.2 2020-07-20 [2] CRAN (R 4.0.1) #> jsonlite 1.7.2 2020-12-09 [2] CRAN (R 4.0.1) #> knitr 1.31 2021-01-27 [2] CRAN (R 4.0.1) #> labeling 0.4.2 2020-10-20 [2] CRAN (R 4.0.1) #> lifecycle 1.0.0 2021-02-15 [2] CRAN (R 4.0.1) #> lubridate 1.7.10 2021-02-26 [2] CRAN (R 4.0.1) #> magrittr 2.0.1 2020-11-17 [2] CRAN (R 4.0.1) #> mime 0.10 2021-02-13 [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) #> pillar 1.6.1 2021-05-16 [1] CRAN (R 4.0.1) #> pkgconfig 2.0.3 2019-09-22 [2] CRAN (R 4.0.1) #> purrr * 0.3.4 2020-04-17 [2] CRAN (R 4.0.1) #> R6 2.5.0 2020-10-28 [2] CRAN (R 4.0.1) #> Rcpp 1.0.6 2021-01-15 [2] CRAN (R 4.0.1) #> readr * 1.4.0 2020-10-05 [2] CRAN (R 4.0.1) #> readxl 1.3.1 2019-03-13 [2] CRAN (R 4.0.1) #> reprex 2.0.0 2021-04-02 [2] CRAN (R 4.0.1) #> rlang 0.4.11 2021-04-30 [1] CRAN (R 4.0.1) #> rmarkdown 2.9 2021-06-15 [1] CRAN (R 4.0.1) #> rprojroot 2.0.2 2020-11-15 [2] CRAN (R 4.0.1) #> rstudioapi 0.13 2020-11-12 [2] CRAN (R 4.0.1) #> rvest 1.0.0 2021-03-09 [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.5.3 2020-09-09 [2] CRAN (R 4.0.1) #> stringr * 1.4.0 2019-02-10 [2] CRAN (R 4.0.1) #> styler 1.4.1 2021-03-30 [2] CRAN (R 4.0.1) #> tibble * 3.1.2 2021-05-16 [1] CRAN (R 4.0.1) #> tidyr * 1.1.3 2021-03-03 [2] CRAN (R 4.0.1) #> tidyselect 1.1.1 2021-04-30 [1] CRAN (R 4.0.1) #> tidyverse * 1.3.0 2019-11-21 [2] CRAN (R 4.0.1) #> utf8 1.2.1 2021-03-12 [2] CRAN (R 4.0.1) #> vctrs 0.3.8 2021-04-29 [1] CRAN (R 4.0.1) #> withr 2.4.2 2021-04-18 [1] CRAN (R 4.0.1) #> xfun 0.22 2021-03-11 [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/soltoffbc/R/x86_64-pc-linux-gnu-library/4.0 #> [2] /opt/R/4.0.1/lib/R/library ```
cslewis12 commented 3 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/182
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /home/cslewis/uc-cfss-reproducible-examples-and-git-4cced8f

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> 
#> ── 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 2021-07-13 by the reprex package (v2.0.0)

Session info ``` r sessioninfo::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 4.0.1 (2020-06-06) #> os Red Hat Enterprise Linux 8.4 (Ootpa) #> system x86_64, linux-gnu #> ui X11 #> language (EN) #> collate en_US.UTF-8 #> ctype en_US.UTF-8 #> tz America/Chicago #> date 2021-07-13 #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date lib source #> assertthat 0.2.1 2019-03-21 [2] CRAN (R 4.0.1) #> backports 1.2.1 2020-12-09 [2] CRAN (R 4.0.1) #> broom 0.7.5 2021-02-19 [2] CRAN (R 4.0.1) #> cellranger 1.1.0 2016-07-27 [2] CRAN (R 4.0.1) #> cli 2.3.1 2021-02-23 [2] CRAN (R 4.0.1) #> colorspace 2.0-0 2020-11-11 [2] CRAN (R 4.0.1) #> crayon 1.4.1 2021-02-08 [2] CRAN (R 4.0.1) #> curl 4.3 2019-12-02 [2] CRAN (R 4.0.1) #> DBI 1.1.1 2021-01-15 [2] CRAN (R 4.0.1) #> dbplyr 2.1.0 2021-02-03 [2] CRAN (R 4.0.1) #> digest 0.6.27 2020-10-24 [2] CRAN (R 4.0.1) #> dplyr * 1.0.5 2021-03-05 [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.2 2021-01-15 [2] CRAN (R 4.0.1) #> farver 2.1.0 2021-02-28 [2] CRAN (R 4.0.1) #> forcats * 0.5.1 2021-01-27 [2] CRAN (R 4.0.1) #> fs 1.5.0 2020-07-31 [2] CRAN (R 4.0.1) #> generics 0.1.0 2020-10-31 [2] CRAN (R 4.0.1) #> ggplot2 * 3.3.3 2020-12-30 [2] CRAN (R 4.0.1) #> glue 1.4.2 2020-08-27 [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 * 1.0.1 2020-12-13 [2] CRAN (R 4.0.1) #> highr 0.8 2019-03-20 [2] CRAN (R 4.0.1) #> hms 1.0.0 2021-01-13 [2] CRAN (R 4.0.1) #> htmltools 0.5.1.1 2021-01-22 [2] CRAN (R 4.0.1) #> httr 1.4.2 2020-07-20 [2] CRAN (R 4.0.1) #> jsonlite 1.7.2 2020-12-09 [2] CRAN (R 4.0.1) #> knitr 1.31 2021-01-27 [2] CRAN (R 4.0.1) #> labeling 0.4.2 2020-10-20 [2] CRAN (R 4.0.1) #> lifecycle 1.0.0 2021-02-15 [2] CRAN (R 4.0.1) #> lubridate 1.7.10 2021-02-26 [2] CRAN (R 4.0.1) #> magrittr 2.0.1 2020-11-17 [2] CRAN (R 4.0.1) #> mime 0.10 2021-02-13 [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) #> pillar 1.5.1 2021-03-05 [2] CRAN (R 4.0.1) #> pkgconfig 2.0.3 2019-09-22 [2] CRAN (R 4.0.1) #> purrr * 0.3.4 2020-04-17 [2] CRAN (R 4.0.1) #> R6 2.5.0 2020-10-28 [2] CRAN (R 4.0.1) #> Rcpp 1.0.6 2021-01-15 [2] CRAN (R 4.0.1) #> readr * 1.4.0 2020-10-05 [2] CRAN (R 4.0.1) #> readxl 1.3.1 2019-03-13 [2] CRAN (R 4.0.1) #> reprex 2.0.0 2021-04-02 [2] CRAN (R 4.0.1) #> rlang 0.4.10 2020-12-30 [2] CRAN (R 4.0.1) #> rmarkdown 2.7 2021-02-19 [2] CRAN (R 4.0.1) #> rprojroot 2.0.2 2020-11-15 [2] CRAN (R 4.0.1) #> rstudioapi 0.13 2020-11-12 [2] CRAN (R 4.0.1) #> rvest 1.0.0 2021-03-09 [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.5.3 2020-09-09 [2] CRAN (R 4.0.1) #> stringr * 1.4.0 2019-02-10 [2] CRAN (R 4.0.1) #> styler 1.4.1 2021-03-30 [2] CRAN (R 4.0.1) #> tibble * 3.1.0 2021-02-25 [2] CRAN (R 4.0.1) #> tidyr * 1.1.3 2021-03-03 [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 [2] CRAN (R 4.0.1) #> utf8 1.2.1 2021-03-12 [2] CRAN (R 4.0.1) #> vctrs 0.3.7 2021-03-29 [2] CRAN (R 4.0.1) #> withr 2.4.1 2021-01-26 [2] CRAN (R 4.0.1) #> xfun 0.22 2021-03-11 [2] CRAN (R 4.0.1) #> xml2 1.3.2 2020-04-23 [2] CRAN (R 4.0.1) #> yaml 2.2.1.99 2021-07-06 [1] Github (viking/r-yaml@4788abe) #> #> [1] /home/cslewis/R/x86_64-pc-linux-gnu-library/4.0 #> [2] /opt/R/4.0.1/lib/R/library ```
ktakaira commented 3 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/182
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /home/ktakaira/uc-cfss-reproducible-examples-and-git-4cced8f

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> 
#> ── 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 2021-07-13 by the reprex package (v2.0.0)

agodinez711 commented 3 years ago
mean(rnorm(100))
#> [1] -0.1231467

Created on 2021-07-13 by the reprex package (v2.0.0)

Session info ``` r sessioninfo::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 4.0.1 (2020-06-06) #> os Red Hat Enterprise Linux 8.4 (Ootpa) #> system x86_64, linux-gnu #> ui X11 #> language (EN) #> collate en_US.UTF-8 #> ctype en_US.UTF-8 #> tz America/Chicago #> date 2021-07-13 #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date lib source #> backports 1.2.1 2020-12-09 [2] CRAN (R 4.0.1) #> cli 2.5.0 2021-04-26 [1] CRAN (R 4.0.1) #> crayon 1.4.1 2021-02-08 [2] CRAN (R 4.0.1) #> digest 0.6.27 2020-10-24 [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.2 2021-01-15 [2] CRAN (R 4.0.1) #> fs 1.5.0 2020-07-31 [2] CRAN (R 4.0.1) #> glue 1.4.2 2020-08-27 [2] CRAN (R 4.0.1) #> highr 0.8 2019-03-20 [2] CRAN (R 4.0.1) #> htmltools 0.5.1.1 2021-01-22 [2] CRAN (R 4.0.1) #> knitr 1.31 2021-01-27 [2] CRAN (R 4.0.1) #> lifecycle 1.0.0 2021-02-15 [2] CRAN (R 4.0.1) #> magrittr 2.0.1 2020-11-17 [2] CRAN (R 4.0.1) #> pillar 1.5.1 2021-03-05 [2] CRAN (R 4.0.1) #> pkgconfig 2.0.3 2019-09-22 [2] CRAN (R 4.0.1) #> purrr 0.3.4 2020-04-17 [2] CRAN (R 4.0.1) #> reprex 2.0.0 2021-04-02 [1] CRAN (R 4.0.1) #> rlang 0.4.10 2020-12-30 [2] CRAN (R 4.0.1) #> rmarkdown 2.7 2021-02-19 [2] CRAN (R 4.0.1) #> sessioninfo 1.1.1 2018-11-05 [2] CRAN (R 4.0.1) #> stringi 1.5.3 2020-09-09 [2] CRAN (R 4.0.1) #> stringr 1.4.0 2019-02-10 [2] CRAN (R 4.0.1) #> styler 1.4.1 2021-03-30 [2] CRAN (R 4.0.1) #> tibble 3.1.0 2021-02-25 [2] CRAN (R 4.0.1) #> utf8 1.2.1 2021-03-12 [2] CRAN (R 4.0.1) #> vctrs 0.3.7 2021-03-29 [2] CRAN (R 4.0.1) #> withr 2.4.1 2021-01-26 [2] CRAN (R 4.0.1) #> xfun 0.22 2021-03-11 [2] CRAN (R 4.0.1) #> yaml 2.2.1 2020-02-01 [2] CRAN (R 4.0.1) #> #> [1] /home/agodinez7/R/x86_64-pc-linux-gnu-library/4.0 #> [2] /opt/R/4.0.1/lib/R/library ```
Maggie-Rivera commented 3 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/182
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /home/mmrivera/uc-cfss-reproducible-examples-and-git-4cced8f

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> 
#> ── 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 2021-07-13 by the reprex package (v2.0.0)

Session info ``` r sessioninfo::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 4.0.1 (2020-06-06) #> os Red Hat Enterprise Linux 8.4 (Ootpa) #> system x86_64, linux-gnu #> ui X11 #> language (EN) #> collate en_US.UTF-8 #> ctype en_US.UTF-8 #> tz America/Chicago #> date 2021-07-13 #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date lib source #> assertthat 0.2.1 2019-03-21 [2] CRAN (R 4.0.1) #> backports 1.2.1 2020-12-09 [2] CRAN (R 4.0.1) #> broom 0.7.5 2021-02-19 [2] CRAN (R 4.0.1) #> cellranger 1.1.0 2016-07-27 [2] CRAN (R 4.0.1) #> cli 2.5.0 2021-04-26 [1] CRAN (R 4.0.1) #> colorspace 2.0-0 2020-11-11 [2] CRAN (R 4.0.1) #> crayon 1.4.1 2021-02-08 [2] CRAN (R 4.0.1) #> curl 4.3 2019-12-02 [2] CRAN (R 4.0.1) #> DBI 1.1.1 2021-01-15 [2] CRAN (R 4.0.1) #> dbplyr 2.1.0 2021-02-03 [2] CRAN (R 4.0.1) #> digest 0.6.27 2020-10-24 [2] CRAN (R 4.0.1) #> dplyr * 1.0.5 2021-03-05 [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.2 2021-01-15 [2] CRAN (R 4.0.1) #> farver 2.1.0 2021-02-28 [2] CRAN (R 4.0.1) #> forcats * 0.5.1 2021-01-27 [2] CRAN (R 4.0.1) #> fs 1.5.0 2020-07-31 [2] CRAN (R 4.0.1) #> generics 0.1.0 2020-10-31 [2] CRAN (R 4.0.1) #> ggplot2 * 3.3.3 2020-12-30 [2] CRAN (R 4.0.1) #> glue 1.4.2 2020-08-27 [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 * 1.0.1 2020-12-13 [2] CRAN (R 4.0.1) #> highr 0.8 2019-03-20 [2] CRAN (R 4.0.1) #> hms 1.0.0 2021-01-13 [2] CRAN (R 4.0.1) #> htmltools 0.5.1.1 2021-01-22 [2] CRAN (R 4.0.1) #> httr 1.4.2 2020-07-20 [2] CRAN (R 4.0.1) #> jsonlite 1.7.2 2020-12-09 [2] CRAN (R 4.0.1) #> knitr 1.31 2021-01-27 [2] CRAN (R 4.0.1) #> labeling 0.4.2 2020-10-20 [2] CRAN (R 4.0.1) #> lifecycle 1.0.0 2021-02-15 [2] CRAN (R 4.0.1) #> lubridate 1.7.10 2021-02-26 [2] CRAN (R 4.0.1) #> magrittr 2.0.1 2020-11-17 [2] CRAN (R 4.0.1) #> mime 0.10 2021-02-13 [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) #> pillar 1.5.1 2021-03-05 [2] CRAN (R 4.0.1) #> pkgconfig 2.0.3 2019-09-22 [2] CRAN (R 4.0.1) #> purrr * 0.3.4 2020-04-17 [2] CRAN (R 4.0.1) #> R6 2.5.0 2020-10-28 [2] CRAN (R 4.0.1) #> Rcpp 1.0.6 2021-01-15 [2] CRAN (R 4.0.1) #> readr * 1.4.0 2020-10-05 [2] CRAN (R 4.0.1) #> readxl 1.3.1 2019-03-13 [2] CRAN (R 4.0.1) #> reprex 2.0.0 2021-04-02 [2] CRAN (R 4.0.1) #> rlang 0.4.11 2021-04-30 [1] CRAN (R 4.0.1) #> rmarkdown 2.7 2021-02-19 [2] CRAN (R 4.0.1) #> rprojroot 2.0.2 2020-11-15 [2] CRAN (R 4.0.1) #> rstudioapi 0.13 2020-11-12 [2] CRAN (R 4.0.1) #> rvest 1.0.0 2021-03-09 [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.5.3 2020-09-09 [2] CRAN (R 4.0.1) #> stringr * 1.4.0 2019-02-10 [2] CRAN (R 4.0.1) #> styler 1.4.1 2021-03-30 [2] CRAN (R 4.0.1) #> tibble * 3.1.0 2021-02-25 [2] CRAN (R 4.0.1) #> tidyr * 1.1.3 2021-03-03 [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 [2] CRAN (R 4.0.1) #> utf8 1.2.1 2021-03-12 [2] CRAN (R 4.0.1) #> vctrs 0.3.7 2021-03-29 [2] CRAN (R 4.0.1) #> withr 2.4.1 2021-01-26 [2] CRAN (R 4.0.1) #> xfun 0.22 2021-03-11 [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/mmrivera/R/x86_64-pc-linux-gnu-library/4.0 #> [2] /opt/R/4.0.1/lib/R/library ```
agodinez711 commented 3 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/182
## 
## Hint: look at the input and outfile arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /home/agodinez7/uc-cfss-reproducible-examples-and-git-4cced8f

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> 
#> ── 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 2021-07-13 by the reprex package (v2.0.0)

TingxiLiu commented 2 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/reproducible-examples-and-git/issues/3
## 
## Hint: look at the input and wd arguments to reprex()

library(tidyverse)
library(here)
#> here() starts at /Users/liutingxi/Desktop/uc-cfss-reproducible-examples-and-git-d2c4ec3

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> Rows: 56 Columns: 2
#> ─ Column specification ────────────────────────────
#> Delimiter: ","
#> chr (1): state
#> dbl (1): urbanindex
#> 
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

# 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 2021-11-04 by the reprex package (v2.0.1)