Posts tagged programming
-
Some git links
༄> Some links on git: -
Rust-eze
༄> Interesting post on Using Rust for Scientific Numerical applications: Learning from Past Experiences. -
R / Rmarkdown / Quarto collaborative guide
༄> Good list for collaboration. -
Type safety in R
༄> Introduction to r-lib type safety checks. -
R and Visual Studio Code
༄> Setup blog post by Aaron Schiff. -
DevOps for data science
༄> It looks like a handy book: DevOps for data science -
Start with the programming language and statistical approach used by your community
I have been very busy with the start of the semester, teaching regression modelling. The craziest thing was that the… -
Superindex and subindex in ggpairs axes labels
༄> I was having problems on the syntax to get the axis labels with subindices and superindices, as it didn’t work… -
duckplyr: dplyr + DuckDB
༄> DuckDB released a new R package – duckplyr, which enables running dplyr functions using the DuckDB engine on the backend… -
SQL: I always need a refresh
༄> The Querynomicon by “Mad Arab” Abdul Alhazred or Greg Wilson. Your pick. -
I haven’t done an animation in R in ages
༄> So I needed to remember how to do it. Thie post “Building an animation step-by-step with gganimate” is pretty helpful:… -
Getting rid of bars and outliers in boxplots
༄> Sometimes I am testing graphs and I want to get rid of the lines (coef = 0) and outliers (outlier.shape… -
A good entry point to Julia
༄> Danielle Navarro wrote a three-post series introducing Julia almost from scratch. Fantastic work. Bookmarking. -
Oh my git!
༄> An open source game about learning Git! Just another way in which I won’t learn git 🙁 Only my efforts… -
Old dog, etc
Yesterday I attended an introduction to “Artificial Intelligence in Forestry”* workshop at the School of Forestry, University of Canterbury. There… -
Python not suitable platform for reproducible research
While [Active Papers] has achieved its mission of demonstrating that unifying computational reproducibility and provenance tracking is doable and useful,… -
How old is your favourite language?
We often forget for how long we’ve been writing code in specific languages. For example, I started using SAS in… -
Some love for Base R. Part 4
Following on parts 1, 2 & 3—yes, a series—we arrive to part 4 revisiting Base R. See part 1 for… -
Anyone using other than RStudio?
I asked both in Mastodon and Twitter “Anyone using other than #RStudio as their main #rstats IDE?” and—knowing that some… -
Some love for Base R. Part 3
It seems a few people have found useful the reminders of base-R functionality covered in “Some love for Base R”… -
Some love for Base R. Part 2
Where were we? Giving some love to base-R and putting together the idea that it is possible to write R… -
Some love for Base R. Part 1
For a long time it has bothered me when people look down at base-R (meaning the set of functions that… -
Flotsam 17: maps
Tiling is one of the big pieces to put together nice, interactive maps. How The Post is replacing Mapbox with… -
Flotsam 16: neovim
༄> Just to remember where things are in my neovim installation in MacOS: -
Creating an n x n autocorrelation matrix
Between covid-19 news and announcements of imminent Russia-Ukraine wars I needed a bit of a distraction. Sooo, here it is… -
The beauty of code vectorisation
I came across this problem in Twitter: -
Recreational programming
I think programming, aka coding, is a fun activity. We are solving a problem subject to a set of constraints… -
Flotsam 14: dev links
༄> Back doing some coding, playing with R packages and collaborating with someone else. This is an unusual situation for me,… -
Fixing Rcpp warning in Mac OS
In Mac OS I was getting an annoying warning when compiling Cpp code via Rcpp in R: -
Implementing a model as an R package
In our research group we often have people creating statistical models that end up in publications but, most of the… -
Reading a folder with many small files
One of the tools we use in our research is NIR (Near-Infrared Spectroscopy), which we apply to thousands of samples… -
From character to numeric pedigrees
In quantitative genetic analyses we often use a pedigree to represent the relatedness between individuals, so this is accounted in… -
Reducing friction in R to avoid Excel
When you have students working in a project there is always an element of quality control. Some times the results… -
Keeping track of research
If you search for data analysis workflows for research there are lots of blog posts on using R + databases… -
Calculating parliament seats allocation and quotients
I was having a conversation about dropping the minimum threshold (currently 5% of the vote) for political parties to get… -
Collecting results of the New Zealand General Elections
I was reading an article about the results of our latest elections where I was having a look at the… -
Where are New Zealand’s bellwether electorates?
I was reading a piece by Graeme Edgeler who, near the end, asked “Where are New Zealand’s bellwether electorates?”. I… -
Functions with multiple results in tidyverse
I have continued playing with the tidyverse for different parts of a couple of projects. -
Turtles all the way down
One of the main uses for R is for exploration and learning. Let’s say that I wanted to learn simple… -
Old dog and the tidyverse
I started using R ages ago and have happily lived in mostly-base-R for data manipulation. Once in a while I… -
Cute Gibbs sampling for rounded observations
I was attending a course of Bayesian Statistics where this problem showed up: -
Mucking around with maps, schools and ethnicity in NZ
I’ve been having a conversation for a while with Harkanwal Singh and Aaron Schiff on maps, schools, census, making NZ… -
Left-to-right
When I write code I’m often amazed by the direction of the statements. I mean, we read and write left-to-right… -
Sometimes I feel (some) need for speed
I’m the first to acknowledge that most of my code could run faster. The truth of the matter is that,… -
Less wordy R
The Swarm Lab presents a nice comparison of R and Python code for a simple (read ‘one could do it… -
R as a second language
Imagine that you are studying English as a second language; you learn the basic rules, some vocabulary and start writing… -
Using Processing and R together (in OS X)
I wanted to develop a small experiment with a front end using the Processing language and the backend calculations in… -
Flotsam 13: early July links
༄> Man flu kept me at home today, so I decided to do something ‘useful’ and go for a linkathon: -
Subsetting data
At School we use R across many courses, because students are supposed to use statistics under a variety of contexts.… -
Learning to code in R
It used to be that the one of the first decisions to make when learning to program was between compiled… -
R for inquisition
A post on high-dimensional arrays by @isomorphisms reminded me of APL and, more generally, of matrix languages, which took me… -
R pitfalls #4: redefining the basics
I try to be economical when writing code; for example, I tend to use single quotes over double quotes for… -
Overlay of design matrices in genetic analysis
I’ve ignored my quantitative geneticist side of things for a while (at least in this blog) so this time I’ll… -
Scraping pages and downloading files using R
I have written a few posts discussing descriptive analyses of evaluation of National Standards for New Zealand primary schools.The data… -
(Unsurprisingly) users default to the defaults
Oddities tend to jump out when one uses software in a daily basis. The situation is even clearer when using… -
m x n matrix with randomly assigned 0/1
Today Scott Chamberlain tweeted asking for a better/faster solution to building an m x n matrix with randomly assigned 0/1.… -
Careless comparison bites back (again)
When running stats labs I like to allocate a slightly different subset of data to each student, which acts as… -
Split-plot 1: How does a linear mixed model look like?
I like statistics and I struggle with statistics. Often times I get frustrated when I don’t understand and I really… -
R’s increasing popularity. Should we care?
Some people will say ‘you have to learn R if you want to get a job doing statistics/data science’. I… -
Teaching code, production code, benchmarks and new languages
I’m a bit obsessive with words. May be I should have used learning in the title, rather than teaching code.… -
Late-April flotsam
༄> It has been month and a half since I compiled a list of statistical/programming internet flotsam and jetsam. -
R, Julia and genome wide selection
— “You are a pussy” emailed my friend. — “Sensu cat?” I replied. — “No. Sensu chicken” blurbed my now ex-friend. -
R, Julia and the shiny new thing
My head exploded a while ago. Perhaps not my head but my brain was all mushy after working every day… -
IPython
I installed the latest version (0.12) of IPython from source in my mac, but forgot that I had a previous… -
R is a language
A commenter on this blog reminded me of one of the frustrating aspects faced by newbies, not only to R… -
R, academia and the democratization of statistics
I am not a statistician but I use statistics, teach statistics and write about applications of statistics in biological problems. -
Lattice when modeling, ggplot when publishing
When working in research projects I tend to fit several, sometimes quite a few, alternative models. This model fitting is… -
Simulating data following a given covariance structure
Every year there is at least a couple of occasions when I have to simulate multivariate data that follow a… -
Setting plots side by side
This is simple example code to display side-by-side lattice plots or ggplot2 plots, using the mtcars dataset that comes with… -
Reading HTML pages in R for text processing
We were talking with one of my colleagues about doing some text analysis—that, by the way, I have never done… -
Operating on datasets inside a function
There are times when we need to write a function that makes changes to a generic data frame that is… -
A brief idea of style
Once one starts writing more R code the need for consistency increases, as it facilitates managing larger projects and their… -
All combinations for levelplot
In a previous post I explained how to create all possible combinations of the levels of two factors using expand.grid().… -
On R versus SAS
A short while ago there was a discussion on linkedin about the use of SAS versus R for the enterprise.… -
R pitfall #1: check data structure
A common problem when running a simple (or not so simple) analysis is forgetting that the levels of a factor… -
All combinations of levels for two factors
There are circumstances when one wants to generate all possible combinations of levels for two factors. For example, factor one… -
“Not in” in R
When processing data it is common to test if an observation belongs to a set. Let’s suppose that we want… -
Python code to simulate the Monty Hall problem
I always struggled to understand the Monty Hall Problem, which popped up again in William Briggs’s site. The program assumes… -
Publon: my simple publication Python script
After using PmWiki (PHP wiki software) for nearly five years to maintain my web site I was a bit tired… -
Dynamic Google maps using Python
I originally wrote this code on 2 February 2009, as a quick hack to publish air pollution in Santiago. The… -
Back to Python
I started using Python way back at the end of 1996 or early 1997. I was working in my PhD,…