R Craft: Read CSV, RDA, and other Supported Data Files with R

You downloaded data files, or maybe you compiled them yourself. How will you get those data into R?

R software logo

R offers built-in functions that let you access either delimited (where a certain character separates values) or fixed-width (where each column uses a certain number of characters) files. Like other popular statistical packages, R even supports its own data file format. Let’s explore some frequently-used functions.

Continue reading

R Craft: Read Excel, Stata, and other Unsupported Data Files with R

You downloaded data files from the US government or some other organization that depends on proprietary spreadsheet software or statistical packages. How will you get those data into R? 

R software logo

Fortunately, other programmers have faced this issue and developed R packages that let you read data saved in various proprietary formats. Let’s explore several popular options. 

Continue reading

Python Pointer: Find Files with os.walk()

Have a mess of files to read into Python? Maybe you downloaded Kaiko trade data, with unpredictable sub-directories and file names, from Penn+Box. Or maybe you’ve dropped TXT, PDF, and PY files into a single working directory that you’d rather not reorganize. A simple script will find the files you need, listing their names and paths for easy processing.

Python logo
Continue reading