Long Nguyen

148 posts

Long Nguyen banner
Long Nguyen

Long Nguyen

@long39ng

Researcher @deziminstitut. PhD candidate in sociology @unibielefeld. #rstats #rspatial #dataviz

Katılım Eylül 2020
210 Takip Edilen316 Takipçiler
Sabitlenmiş Tweet
Long Nguyen
Long Nguyen@long39ng·
Rewrote the #rstats #shinyapps in #svelte with #typescript. Loads much faster and feels much snappier now 🚀 Also mobile responsive 💫 Served entirely statically via GitHub Pages: 👉 regiohub.github.io/soep-regiohub-…
Long Nguyen tweet mediaLong Nguyen tweet mediaLong Nguyen tweet media
Long Nguyen@long39ng

The #rstats #shinyapp for exploring some German regional data is now available at long39ng.shinyapps.io/soep-regiohub-… ✨ Both content and interface will keep getting updated! (Still only in German, but your browser can translate it into English 😅)

English
4
36
234
29.3K
Long Nguyen
Long Nguyen@long39ng·
@TeslaDuBois I think the easiest way to do this would be to scale the state geometries around the region centroids using affine transformations (#affine-transformations" target="_blank" rel="nofollow noopener">r.geocompx.org/geometry-opera…), which can be done with {sf}. Minimal example:
Long Nguyen tweet mediaLong Nguyen tweet media
English
1
11
50
4K
Long Nguyen
Long Nguyen@long39ng·
Inspecting nested lists in #rstats can be daunting, so I've created a small package {listviewerlite} (inspired by listviewer) that creates a collapsible tree view of R lists using only #html and #css, without the need for #javascript github.com/long39ng/listv… Acknowledgement: 🧵
GIF
English
3
9
77
6.3K
Chris Skopnik
Chris Skopnik@von_skopnik·
@long39ng @TimTeaFan Apart from your content heavy conversation I am asking the important question: What is that sick font for packages and warnings of Long? And is that how you see it in RStudio?
English
1
0
0
24
Tim Tiefenbach
Tim Tiefenbach@TimTeaFan·
Recently I’ve rewritten an old #RStats script in which I recode and rename multiple columns across several datasets based on a data dictionary. I came up with a pretty slick dplyr workflow which I've detailed in my latest blog post (link and sneak peak ⬇️). Any feedback welcome!
Tim Tiefenbach tweet mediaTim Tiefenbach tweet mediaTim Tiefenbach tweet media
English
7
19
120
17.5K
Long Nguyen
Long Nguyen@long39ng·
@TimTeaFan I agree. My replies were more about how much I like the new case_match function 😄
English
0
0
1
23
Tim Tiefenbach
Tim Tiefenbach@TimTeaFan·
@long39ng That’s not a great format from a data perspective, but it is good compromise when working in teams that consist of coding and non-coding people.
English
1
0
1
46
Long Nguyen
Long Nguyen@long39ng·
@TimTeaFan I see your point. Maybe a named list for the dict, where names are data column names and elements are value-label data frames? Then the value columns in the different dict data frames don't have to have the same type
English
2
0
1
50
Long Nguyen
Long Nguyen@long39ng·
@TimTeaFan And fwiw, I think an expr(as_integer_if_possible(label)) can be passed to the RHS when creating the formulas for case_match() to replicate your approach with recode() 🤔
English
1
0
1
43
Long Nguyen
Long Nguyen@long39ng·
@TimTeaFan Not that it matters much here, but plucking from a list should have better performance than filtering a data frame and the list structure would also correspond more to the dict/map data structure in other languages
English
1
0
1
49
Long Nguyen
Long Nguyen@long39ng·
@TimTeaFan Also, I think using case_match() is type-safer because it would only accept values of the same type as the original value column on the LHS of the formulas, whereas names of a vector are always character 🤔
English
1
0
0
73
Long Nguyen
Long Nguyen@long39ng·
@Mihoda The next step would be to write a shiny app on top of this 😄 /s
English
1
0
1
15
Mihoda
Mihoda@Mihoda·
@long39ng I didn't have "Let me open up RStudio" on my list of Reddit alternatives until now. Bravo.
English
1
0
1
33
Long Nguyen
Long Nguyen@long39ng·
@moh_fodil Plot twist: the OP was comparing loops in R to other languages 😆
English
0
0
0
70