R Tip: Use drop = FALSE with data.frames
Win-Vector Blog 2018-02-27
Summary:
Another R tip. Get in the habit of using drop = FALSE when indexing (using [ , ] on) data.frames. Prince Rupert’s drops (img: Wikimedia Commons) In R, single column data.frames are often converted to vectors when manipulated. For example: d <- data.frame(x = seq_len(3)) print(d) #> x #> 1 1 #> 2 2 #> … Continue reading R Tip: Use
drop = FALSE with data.frames