cis-ds / reproducible-examples

0 stars 0 forks source link

issue 3 #18

Open mcresa opened 2 years ago

mcresa 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 /tmp/RtmpSket7g/reprex-2a8f344ad3f1e5-extra-bass
setwd(.)

# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> Error: '/tmp/RtmpSket7g/reprex-2a8f344ad3f1e5-extra-bass/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-11-04 by the reprex package (v2.0.1)

mcresa commented 2 years ago
library(tidyverse)
library(here)
#> here() starts at /tmp/RtmpSket7g/reprex-2a8f34bfaa3f-sugar-cob
setwd(".")
# import data file
urban <- read_csv(here("data", "urbanization-state.csv"))
#> Error: '/tmp/RtmpSket7g/reprex-2a8f34bfaa3f-sugar-cob/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-11-04 by the reprex package (v2.0.1)