Appendix A. Python and R Basics

This appendix provides details on the basics of Python and R. For readers unfamiliar with either language, we recommend you spend an hour or two working through basic tutorials such as those listed on the project’s home pages listed in “Local Installation”.

Tip

In both Python and R, you may access built-in help files for a function by typing help("function"). For example, typing help("+") loads a help file for the addition operator. In R, you can often also use the ? shortcut (for example ?"+"), but you need to use quotes for some operators such as + or -.

Obtaining Python and R

Two options exist for running Python or R. You may install the program locally on a computer or may use a cloud-hosted version. From the arrival of the personal computer in the late-1980s up until the 2010s, almost all computing was local. People downloaded and installed software to their local computer unless their employer hosted (and paid for) cloud access or local servers. Most people still use this approach and use local computing rather than the cloud. More recently, consumer-scale cloud tools have become readily available. Trade-offs exist for using both approaches:

  • Benefits of using a personal computer:

    • You have known, up-front, one-time costs for hardware.

    • You control all hardware and software (including storage devices).

    • You can install anything you want.

    • Your program will run without internet connections, such as during internet outages, in remote ...

Get Football Analytics with Python & R now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.