Skip to content

Commit

Permalink
new blog post
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmonteagudo28 committed Jul 12, 2024
1 parent 4b74065 commit 7600586
Show file tree
Hide file tree
Showing 29 changed files with 3,531 additions and 0 deletions.
15 changes: 15 additions & 0 deletions _freeze/blog/2024/07/life tables/index/execute-results/html.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"hash": "47cf275d884bbc1f8a636100b1ea68f3",
"result": {
"engine": "knitr",
"markdown": "---\ntitle: \"charting state demographics\"\ndate: now\ndescription: \"virginia population pyramids\"\nformat:\n html:\n css: styles.css\n code-fold: false\n code-tools: true\n code-overflow: wrap\n code-line-numbers: false\nresources:\n - \"VA_pop_demo_data.txt\"\n#doi: \ncitation: true\ndraft: true\n---\n\n\n\n\n## consider everything that grows\n:::{.callout-note}\nMost of the headings are taken from the verses of Shakespeare's [Sonnet 15](https://www.poetryfoundation.org/poems/45086/sonnet-15-when-i-consider-everything-that-grows)\n:::\n\nPopulation pyramids give us a clear picture of the growth and “health” of a country, its states down to its counties. I came across the pyramids in one of my geography classes while living in Cuba. I thought they were pretty cool because I was obsessed with history^[especially Ancient Egypt, the Bible, and the Roman Empire], thought they were connected to Ancient Egypt, and I could actually see how human movement into and out of existence affected my society and the economy in a very real sense. If the person who sold rice, sugar, flour, meat, or eggs, passed away, well now you have to go without it or find someone else who, taking advantage of the new vacancy, will jack up the prices. My generation saw a considerable decline in the number of children. We just simply didn't have the means to feed and keep multiple kids. Senior citizens, likewise, weren't many because we lacked the resources to effectively deal with naturally-occurring diseases and ailments in the elderly population. Most of my grandparents lived to be 90+, but they were the exception. I could clearly see all of this in the population pyramid of my generation.\n\n\n::: {.cell layout-align=\"center\"}\n\n:::\n\n::: {.cell layout-align=\"center\"}\n\n```{.r .cell-code}\npath <- here::here(\"blog\",\"2024\",\"07\",\"life tables\",\n \"un_cuba.txt\")\ncuba_df <- read.delim(path, sep = \"\") |>\n rename(values = Value) |>\n mutate(values = as.double(format(values, scientific = FALSE)),\n Indicator = as.factor(IndicatorName), .before = Location) |>\n select(-IndicatorId,-IndicatorShortName,\n -IndicatorName,\n -Source,-SourceYear,\n -Author,-LocationId,\n -Iso2,Iso3,\n -TimeId,-VariantId,\n -Variant,-SexId,\n -AgeId,-AgeStart,\n -AgeEnd,-CategoryId,\n -Category,-EstimateTypeId,\n -EstimateType,-EstimateMethodId,\n -EstimateMethod)\n```\n:::\n\n::: {.cell layout-align=\"center\"}\n\n```{.r .cell-code}\nbase_path <- here::here(\"blog\",\"2024\",\"07\",\"life tables\",\"Va_pop_demo_data.txt\")\nva_demo_dat <- read.delim(base_path, sep = \"\\t\")\nva_demo_dat <- va_demo_dat |> \n mutate(age_range = paste(Starting.Age, Ending.Age, \n sep = \"-\")) |>\n mutate(gender = as.factor(Gender))|>\n group_by(Year,gender) |>\n mutate(percent = Total_Population / sum(Total_Population) * 100) |>\n select(-Starting.Age, -Ending.Age, -ID_Gender,\n -ID_Geography,-Slug_Geography, -Gender)\n\nglimpse(va_demo_dat)\n```\n:::\n\n::: {.cell layout-align=\"center\"}\n\n```{.r .cell-code}\nva_dat_2022 <- va_demo_dat |> filter(Year == 2022) |>\n ggplot(aes(percent,age_range, fill = gender)) +\n geom_col() +\n scale_fill_manual(values = va_clrs[c(3,5)])\n```\n:::",
"supporting": [],
"filters": [
"rmarkdown/pagebreak.lua"
],
"includes": {},
"engineDependencies": {},
"preserve": {},
"postProcess": true
}
}
15 changes: 15 additions & 0 deletions _freeze/blog/2024/07/pyramids/index/execute-results/html.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"hash": "2712a389fb7433f8ed07f7d3a45360cf",
"result": {
"engine": "knitr",
"markdown": "---\ntitle: \"charting state demographics\"\ndate: now\ndescription: \"virginia population pyramids\"\nformat:\n html:\n css: styles.css\n code-fold: false\n code-tools: true\n code-overflow: wrap\n code-line-numbers: false\nresources:\n - \"VA_pop_demo_data.txt\"\n#doi: \ncitation: true\ndraft: true\n---\n\n\n\n\n## consider everything that grows\n:::{.callout-note}\nMost of the headings are taken from the verses of Shakespeare's [Sonnet 15](https://www.poetryfoundation.org/poems/45086/sonnet-15-when-i-consider-everything-that-grows)\n:::\n\nPopulation pyramids give us a clear picture of the growth and “health” of a country, its states down to its counties. I came across the pyramids in one of my geography classes while living in Cuba. I thought they were pretty cool because I was obsessed with history^[especially Ancient Egypt, the Bible, and the Roman Empire.], thought they were connected to Ancient Egypt, and I could actually see how human movement into and out of existence affected my society and the economy in a very real sense. If the person who sold rice, sugar, flour, meat, or eggs, passed away, well now you have to go without it or find someone else who, taking advantage of the new vacancy, will jack up the prices. My generation saw a considerable decline in the number of children. We just simply didn't have the means to feed and keep multiple kids. Senior citizens, likewise, weren't many because we lacked the resources to effectively deal with naturally-occurring diseases and ailments in the elderly population. Most of my grandparents lived to be 90+, but they were the exception. I could clearly see all of this in the population pyramid of my generation.\n\n\n::: {.cell layout-align=\"center\"}\n\n:::\n\n::: {.cell layout-align=\"center\"}\n\n```{.r .cell-code}\npath <- here::here(\"blog\",\"2024\",\"07\",\"pyramids\",\"data\",\n \"un_cuba.txt\")\ncuba_df <- read.delim(path, sep = \"\") |>\n rename(values = Value) |>\n mutate(values = as.double(format(values, scientific = FALSE)),\n Indicator = as.factor(IndicatorName), .before = Location) |>\n select(-IndicatorId,-IndicatorShortName,\n -IndicatorName,\n -Source,-SourceYear,\n -Author,-LocationId,\n -Iso2,-Iso3,\n -TimeId,-VariantId,\n -Variant,-SexId,\n -AgeId,-AgeStart,\n -AgeEnd,-CategoryId,\n -Category,-EstimateTypeId,\n -EstimateType,-EstimateMethodId,\n -EstimateMethod)\n```\n:::\n\n::: {.cell layout-align=\"center\"}\n\n```{.r .cell-code}\nbase_path <- here::here(\"blog\",\"2024\",\"07\",\"pyramids\",\"data\",\"Va_pop_demo_data.txt\")\nva_demo_dat <- read.delim(base_path, sep = \"\\t\")\nva_demo_dat <- va_demo_dat |> \n mutate(age_range = paste(Starting.Age, Ending.Age, \n sep = \"-\")) |>\n mutate(gender = as.factor(Gender))|>\n group_by(Year,gender) |>\n mutate(percent = Total_Population / sum(Total_Population) * 100) |>\n select(-Starting.Age, -Ending.Age, -ID_Gender,\n -ID_Geography,-Slug_Geography, -Gender)\n\nglimpse(va_demo_dat)\n```\n:::\n\n::: {.cell layout-align=\"center\"}\n\n```{.r .cell-code}\nva_dat_2022 <- va_demo_dat |> filter(Year == 2022) |>\n ggplot(aes(percent,age_range, fill = gender)) +\n geom_col() +\n scale_fill_manual(values = va_clrs[c(3,5)])\n```\n:::",
"supporting": [],
"filters": [
"rmarkdown/pagebreak.lua"
],
"includes": {},
"engineDependencies": {},
"preserve": {},
"postProcess": true
}
}
168 changes: 168 additions & 0 deletions blog/2024/06/mlunar/solar_coord.R
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,173 @@ nutation.long <- function(time){
return(deg_delta)
}

eliptic.long <- function(time){

l_0 <- (
175347046*cos(0) +
3341656*cos(4.6692568 + 6283.075850*time) +
34894*cos(4.62610 + 12566.1517*time) +
3497*cos(2.7441 + 5753.3849*time) +
3418*cos(2.8289 + 3.5231*time) +
3136*cos(3.6277 + 77713.7715*time) +
2676*cos(4.4181 + 7860.4194*time) +
2343*cos(6.1352 + 3930.2097*time) +
1324*cos(0.7425 + 11506.7698*time) +
1273*cos(2.0371 + 529.691*time) +
1199*cos(1.1096 + 1577.3435*time) +
990*cos(5.233 + 5884.927*time) +
902*cos(2.045 + 26.298*time) +
857*cos(3.508 + 398.149*time) +
780*cos(1.179 + 5223.694*time) +
753*cos(2.533 + 5507.553*time) +
505*cos(4.583 + 18849.228*time) +
492*cos(4.205 + 775.523*time) +
357*cos(2.920 + 0.067*time) +
317*cos(5.849 + 11790.629*time) +
284*cos(1.899 + 796.298*time) +
271*cos(0.315*10977.079*time) +
243*cos(0.345 + 5486.778*time) +
206*cos(4.806 + 2544.314*time) +
205*cos(1.869 + 5573.143*time) +
202*cos(2.458 + 6069.777*time) +
156*cos(0.833 + 213.299*time) +
132*cos(3.411 + 2942.463*time) +
126*cos(1.083 + 20.775*time) +
115*cos(0.645 + 0.980*time) +
103*cos(0.636 + 4694.003*time) +
102*cos(0.976 + 15720.839*time) +
102*cos(4.267 + 7.114*time) +
99*cos(6.21 + 2146.17*time) +
98*cos(0.68 + 155.42*time) +
86*cos(5.98 + 161000.69*time) +
85*cos(1.30 + 6275.96*time) +
85*cos(3.67 + 71430.70*time) +
80*cos(1.81 + 17260.15*time) +
79*cos(3.04 + 12036.46*time) +
75*cos(1.76 + 5088.63*time) +
74*cos(3.50 + 3154.69*time) +
74*cos(4.68 + 801.82*time) +
70*cos(0.83 + 9437.76*time) +
62*cos(3.98 + 8827.39*time) +
61*cos(1.82 + 7084.90*time) +
57*cos(2.78 + 6286.60*time) +
56*cos(4.39 + 14143.50*time) +
56*cos(3.47 + 6279.55*time) +
52*cos(0.19 + 12139.55*time) +
52*cos(1.33 + 1748.02*time) +
51*cos(0.28 + 5856.48*time) +
49*cos(0.49 + 1194.45*time) +
41*cos(5.37 + 8429.24*time) +
41*cos(2.40 + 19651.05*time) +
39*cos(6.17 + 10447.39*time) +
37*cos(6.04 + 10213.29*time) +
37*cos(2.57 + 1059.38**time) +
36*cos(1.71 + 2352.87*time) +
36*cos(1.78 + 6812.77*time) +
33*cos(0.59 + 17789.85*time) +
30*cos(0.44 + 83996.85*time) +
30*cos(2.74 + 1349.87*time) +
25*cos(3.16 + 4690.48*time)
)
l_1 <- (
628331966747*cos(0) +
206059*cos(2.678235 + 6283.075850*time) +
4303*cos(2.6351 + 12566.1517*time) +
425*cos(1.590 + 3.523*time) +
119*cos(5.796 + 26.298*tme) +
109*cos(2.966 + 1577.344*time) +
93*cos(2.59 + 18849.23*time) +
72*cos(1.14 + 529.69*time) +
68.0 * cos(1.87 + 398.15*time) +
67.0 * cos(4.41 + 5507.55*time) +
59.0 * cos(2.89 + 5223.69*time) +
56.0 * cos(2.17 + 155.42*time) +
45.0 * cos(0.4 + 796.3*time) +
36.0 * cos(0.47 + 775.52*time) +
29.0 * cos(2.65 + 7.11*time) +
21.0 * cos(5.34 + 0.98*time) +
19.0 * cos(1.85 + 5486.78*time) +
19.0 * cos(4.97 + 213.3*time) +
17.0 * cos(2.99 + 6275.96*time) +
16.0 * cos(0.03 + 2544.31*time) +
16.0 * cos(1.43 + 2146.17*time) +
15.0 * cos(1.21 + 10977.08*time) +
12.0 * cos(2.83 + 1748.02*time) +
12.0 * cos(3.26 + 5088.63*time) +
12.0 * cos(5.27 + 1194.45*time) +
12.0 * cos(2.08 + 4694*time) +
11.0 * cos(0.77 + 553.57*time) +
10.0 * cos(1.3 + 6286.6*time) +
10.0 * cos(4.24 + 1349.87*time) +
9.0 * cos(2.7 + 242.73*time) +
9.0 * cos(5.64 + 951.72*time) +
8.0 * cos(5.3 + 2352.87*time) +
6.0 * cos(2.65 + 9437.76*time) +
6.0 * cos(4.67 + 4690.48*time)
)
l_2 <- (
52919.0 * cos(0) +
8720.0 * cos(1.0721 + 6283.0758*time) +
309.0 * cos(0.867 + 12566.152*time) +
27.0 * cos(0.05 + 3.52*time) +
16.0 * cos(5.19 + 26.3*time) +
16.0 * cos(3.68 + 155.42*time) +
10.0 * cos(0.76 + 18849.23*time) +
9.0 * cos(2.06 + 77713.77*time) +
7.0 * cos(0.83 + 775.52*time) +
5.0 * cos(4.66 + 1577.34*time) +
4.0 * cos(1.03 + 7.11*time) +
4.0 * cos(3.44 + 5573.14*time) +
3.0 * cos(5.14 + 796.3*time) +
3.0 * cos(6.05 + 5507.55*time) +
3.0 * cos(1.19 + 242.73*time) +
3.0 * cos(6.12 + 529.69*time) +
3.0 * cos(0.31 + 398.15*time) +
3.0 * cos(2.28 + 553.57*time) +
2.0 * cos(4.38 + 5223.69*time) +
2.0 * cos(3.75 + 0.98*time)
)
l_3 <- (
289.0 * cos(5.844 + 6283.076*time) +
35.0 * cos(0) +
17.0 * cos(5.49 + 12566.15*time) +
3.0 * cos(5.2 + 155.42*time) +
1.0 * cos(4.72 + 3.52*time) +
1.0 * cos(5.3 + 18849.23*time) +
1.0 * cos(5.97 + 242.73*time)
)
l_4 <- (
114.0 * cos(3.142) +
8.0 * cos(4.13 + 6283.08*time) +
1.0 * cos(3.84 + 12566.15*time)
)
l_5 <- 1*cos(3.14)

helio_long <- l_0 + l_1 + l_2 + l_3 + l_4 + l_5
return(helio_long)
}

eliptic.lat <- function(time){

b_0 <- (
280*cos(3.199 + 84334.662*time) +
102*cos(5.422 + 5507.553*time) +
80*cos(3.88 + 5223.69*time) +
44*cos(3.70 + 2352.87*time) +
32*cos(4.00 + 1577.34*time)
)
b_1 <- (
9*cos(3.90 + 5507.55*time) +
6*cos(1.73 + 5223.69*time)
)

helio_lat <- b_0 + b_1
return(helio_lat)
}

eliptic.radius <- function(time){

r_0 <- (

)
}
Loading

0 comments on commit 7600586

Please sign in to comment.