We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello
Any ideas why i might be getting this error:
Error in -value : invalid argument to unary operator
When running
install.packages("tidyverse") install.packages("janitor") install.packages("gganimate")
library(tidyverse) library(janitor)
material <- read_csv("tidymat2.csv")
library(tidyverse) library(gganimate)
##This bit is for filtering to the top 10
mat_formatted <- material %>% group_by(year) %>%
mutate(rank = rank(-value), Value_rel = value/value[rank==1], Value_lbl = paste0(" ",round(value/1e9))) %>% group_by(material_type) %>% filter(rank <=10) %>% ungroup()
mat_formatted looks like:
material_type value year 1 AC 11.40% 1900 2 CI 3.20% 1900 3 CICL 2.30% 1900 4 CONC 0.00% 1900 5 COPPER 0.70% 1900 6 DI 0.00% 1900 7 DICL 0.90% 1900 8 DIEL 0.00% 1900 9 GI 4.60% 1900 10 GICL 0.00% 1900
Etc
Thanks
The text was updated successfully, but these errors were encountered:
In you column value: i think you mixted the characters with numeric values. it shoud be two seperate columns.
Sorry, something went wrong.
No branches or pull requests
Hello
Any ideas why i might be getting this error:
Error in -value : invalid argument to unary operator
When running
install.packages("tidyverse")
install.packages("janitor")
install.packages("gganimate")
library(tidyverse)
library(janitor)
material <- read_csv("tidymat2.csv")
library(tidyverse)
library(gganimate)
##This bit is for filtering to the top 10
mat_formatted <- material %>%
group_by(year) %>%
The * 1 makes it possible to have non-integer ranks while sliding
mutate(rank = rank(-value),
Value_rel = value/value[rank==1],
Value_lbl = paste0(" ",round(value/1e9))) %>%
group_by(material_type) %>%
filter(rank <=10) %>%
ungroup()
mat_formatted looks like:
material_type value year
1 AC 11.40% 1900
2 CI 3.20% 1900
3 CICL 2.30% 1900
4 CONC 0.00% 1900
5 COPPER 0.70% 1900
6 DI 0.00% 1900
7 DICL 0.90% 1900
8 DIEL 0.00% 1900
9 GI 4.60% 1900
10 GICL 0.00% 1900
Etc
Thanks
The text was updated successfully, but these errors were encountered: