You downloaded data files, or maybe you compiled them yourself. How will you get those data into R?
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.
Have you tried working with what look like text data in R only to get back a number or an error about comparing or replacing elements? If this sounds familiar, you may have been working with factor data. Read on for more about how to create and handle factor data in R.
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.