Code
include("utils.jl")[ Info: loading success
load pacakge
include("utils.jl")[ Info: loading success
df=@pipe CSV.File("./data/employer-new-artificial-intelligence-phds-stacked-area.csv")|>DataFrame|>
rename!(_,"New AI PhD graduates"=>:Phdstudent)| Row | Entity | Code | Year | Phdstudent |
|---|---|---|---|---|
| String15 | Missing | Int64 | Int64 | |
| 1 | Academia | missing | 2010 | 72 |
| 2 | Academia | missing | 2011 | 63 |
| 3 | Academia | missing | 2012 | 47 |
| 4 | Academia | missing | 2013 | 51 |
| 5 | Academia | missing | 2014 | 43 |
| 6 | Academia | missing | 2015 | 42 |
| 7 | Academia | missing | 2016 | 63 |
| 8 | Academia | missing | 2017 | 60 |
| 9 | Academia | missing | 2018 | 73 |
| 10 | Academia | missing | 2019 | 65 |
| 11 | Academia | missing | 2020 | 61 |
| 12 | Academia | missing | 2021 | 84 |
| 13 | Government | missing | 2010 | 6 |
| ⋮ | ⋮ | ⋮ | ⋮ | ⋮ |
| 25 | Industry | missing | 2010 | 76 |
| 26 | Industry | missing | 2011 | 64 |
| 27 | Industry | missing | 2012 | 101 |
| 28 | Industry | missing | 2013 | 74 |
| 29 | Industry | missing | 2014 | 85 |
| 30 | Industry | missing | 2015 | 77 |
| 31 | Industry | missing | 2016 | 134 |
| 32 | Industry | missing | 2017 | 116 |
| 33 | Industry | missing | 2018 | 162 |
| 34 | Industry | missing | 2019 | 180 |
| 35 | Industry | missing | 2020 | 153 |
| 36 | Industry | missing | 2021 | 195 |
@rput df
function plot_arestack_r()
R"""
library(ggplot2)
library(ggthemes)
library(viridis)
ggplot(df, aes(x=Year, y=Phdstudent, fill=Entity)) +
geom_area(alpha=0.6 , size=.5, colour="white")+scale_fill_viridis(discrete = T)+theme_wsj()
"""
end
plot_arestack_r()┌ Warning: RCall.jl: Warning: package ‘ggthemes’ was built under R version 4.2.3
└ @ RCall ~/.julia/packages/RCall/gOwEW/src/io.jl:172
┌ Warning: RCall.jl: Loading required package: viridisLite
└ @ RCall ~/.julia/packages/RCall/gOwEW/src/io.jl:172
┌ Warning: RCall.jl: Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
│ ℹ Please use `linewidth` instead.
└ @ RCall ~/.julia/packages/RCall/gOwEW/src/io.jl:172
RObject{VecSxp}