<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Base on rostrum.blog</title>
    <link>https://www.rostrum.blog/tags/base/</link>
    <description>Recent content in Base on rostrum.blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-gb</language>
    <lastBuildDate>Sun, 23 Apr 2023 00:00:00 +0000</lastBuildDate>
    
	<atom:link href="https://www.rostrum.blog/tags/base/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>Matt Dray Teaches (Data) Typing</title>
      <link>https://www.rostrum.blog/2023/04/23/type-convert/</link>
      <pubDate>Sun, 23 Apr 2023 00:00:00 +0000</pubDate>
      
      <guid>https://www.rostrum.blog/2023/04/23/type-convert/</guid>
      <description>Confirmed: Unown is character type.1  tl;dr I forgot that the base R function type.convert() exists. Handy for ‘simplifying’ all the columns of a dataframe to appropriate data types.
 Suppression depression {a11ytables} is an R package that lets you generate publishable spreadsheets that follow the UK government’s best practice guidance.
One requirement is to replace missing values with placeholder symbols. For example, suppressed data can be replaced with the string &#34;</description>
    </item>
    
    <item>
      <title>Interactive pixel art in R with {pixeltrix}</title>
      <link>https://www.rostrum.blog/2022/09/24/pixeltrix/</link>
      <pubDate>Sat, 24 Sep 2022 00:00:00 +0000</pubDate>
      
      <guid>https://www.rostrum.blog/2022/09/24/pixeltrix/</guid>
      <description>tl;dr I’ve written {pixeltrix}, an R package that lets you select ‘pixels’ interactively from a plot window and returns your final image as a matrix. You could use it to design sprites, for example.
 Pixel perfect I’ve written before about creating very simple pixel art in R. To create a sprite of Link from The Legend of Zelda I had to write out by hand a vector that encoded its pixel values.</description>
    </item>
    
    <item>
      <title>Turn the {tide} on R&#39;s secret spreadsheet editor</title>
      <link>https://www.rostrum.blog/2022/04/27/tide/</link>
      <pubDate>Wed, 27 Apr 2022 00:00:00 +0000</pubDate>
      
      <guid>https://www.rostrum.blog/2022/04/27/tide/</guid>
      <description>tl;dr R has an interactive spreadsheet editor for dataframes that you can access with edit(). I made the function tide::tide() to generate automatically some code that will reproduce the changes you made manually with edit().
 Edit R’s edit() function invokes a text editor so you can amend an R object.1
Something special happens If you edit() a data.frame object: a somewhat-janky interactive spreadsheet-like editor appears in a new window.</description>
    </item>
    
    <item>
      <title>R has obscenely long function names</title>
      <link>https://www.rostrum.blog/2021/11/27/long-fns/</link>
      <pubDate>Sat, 27 Nov 2021 00:00:00 +0000</pubDate>
      
      <guid>https://www.rostrum.blog/2021/11/27/long-fns/</guid>
      <description>tl;dr Use ls() on a package name in the form &#34;package:base&#34; to see all the objects it contains. I’ve done this to find the longest (and shortest) function names in base R and the {tidyverse} suite.
 Naming things I try to keep to a few rules when creating function names, like:
 use a verb to make clear the intended action, like get_badge() from {badgr} start functions with a prefix to make autocomplete easier, like the dh_*() functions from {dehex} try to be descriptive but succinct, like r2cron() from {dialga}  It can be tricky to be succinct.</description>
    </item>
    
    <item>
      <title>#RecreationThursday: a LeWitt Shiny app</title>
      <link>https://www.rostrum.blog/2021/07/05/recreate-lewitt/</link>
      <pubDate>Mon, 05 Jul 2021 00:00:00 +0000</pubDate>
      
      <guid>https://www.rostrum.blog/2021/07/05/recreate-lewitt/</guid>
      <description>LeWitt ReMix The third #RecreationThursday challenge involved Sol LeWitt’s Colour Bands (2000), which you can see on this prints catalogue. In short, each piece is square and contains patterns of colourful concentric lines that are arranged into panels of varying shapes with black borders.
Rather than recreate his artworks exactly, I decided to riff on the approach with a (very basic) Shiny app, which adds different types of lines and some randomisation.</description>
    </item>
    
    <item>
      <title>Very simple pixel art in R</title>
      <link>https://www.rostrum.blog/2021/06/28/pixel-art/</link>
      <pubDate>Mon, 28 Jun 2021 00:00:00 +0000</pubDate>
      
      <guid>https://www.rostrum.blog/2021/06/28/pixel-art/</guid>
      <description>It’s dangerous to code alone…  tl;dr You can use R’s image() function to convert a matrix to a pixelly graphic.
 Pixel fixation My last post was about the {emojiscape} package, which makes a little scene out of sampled emojis.
Following a similar approach, you could write a matrix by hand and plot it via the base function image(). Here’s a very basic example with a ‘glider’ from Conway’s Game of Life.</description>
    </item>
    
    <item>
      <title>#RecreationThursday: Hlito with base R</title>
      <link>https://www.rostrum.blog/2021/06/21/recreate-hlito/</link>
      <pubDate>Mon, 21 Jun 2021 00:00:00 +0000</pubDate>
      
      <guid>https://www.rostrum.blog/2021/06/21/recreate-hlito/</guid>
      <description>Rando-Hlito The first #RecreationThursday challenge involved Alfredo Hlito’s Curves and Straight Series (1948), held by New York’s MoMA.
My recreation uses only base R functions:
 My remix is a 10 by 10 grid where the elemental geometry is randomised:
 I also made a gif remix that’s composed of 10 ‘rando-Hlitos’:
  Approach You can find all the commented code and the outputs in my matt-dray/viz-recreation GitHub repo.</description>
    </item>
    
    <item>
      <title>Recreating Spear&#39;s #CottonViz in base R</title>
      <link>https://www.rostrum.blog/2021/06/08/recreate-spear/</link>
      <pubDate>Tue, 08 Jun 2021 00:00:00 +0000</pubDate>
      
      <guid>https://www.rostrum.blog/2021/06/08/recreate-spear/</guid>
      <description>#CottonViz The Young Statistician’s and History of Stats sections of the Royal Statistical Society (RSS) have challenged people to recreate1 or remix Mary Eleanor Spear’s visualisation of cotton supplies in the United States in the 1940s:2
 I thought it would be interesting to recreate it using only R’s built-in base graphics. This might be a nice demo of zero-dependency plotting for R users who are more familiar with {ggplot2}.</description>
    </item>
    
    <item>
      <title>Handle London travel data with {oystr}</title>
      <link>https://www.rostrum.blog/2019/12/23/oystr/</link>
      <pubDate>Mon, 23 Dec 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.rostrum.blog/2019/12/23/oystr/</guid>
      <description>tl;dr  Problem: I wanted to analyse my Transport for London (TfL) travel data Solution: I came up with the R package name {oystr} and a hex sticker design Practical solution: I actually wrote the package Self-flagellation: it has zero dependencies Further problem: TfL won’t give me information I need to complete it properly Result: blog it and move on Revelation: I’ve spent more than 53 days on TfL trains since Autumn 2014 😱   Clam-ouring for a package Transport for London (TfL) operates the travel system in London.</description>
    </item>
    
  </channel>
</rss>