Workflow: Basics
Clear Workspace, DON’T EDIT
Always start by clearing the workspace. This ensure objects created in other files are not used used here.
List Used Packages, EDIT
List all the packages that will be used in chunk below.
Load Packages, DON’T EDIT
Install Missing
Any missing package will be installed automatically. This ensure smoother execution when run by others.
Installing Packages on Other People Machine
Be aware the people may not like installing packages into their machine automatically. This might break some of their previous code.
Load
Load all packages
9.1 Introduction
This page covers basic concepts when working with R. I took note for those that were new to me or found useful to remind myself with.
9.3 Nameing Objects Rules
- Allowed characters when naming objects
- letters
- numbers
_
.
- All names must start with a letter
- R is case-sensitive, ie,
var
,Var
, andVAR
are different names
9.2 Comments
Use comments to explain the why of your code, eg, you changed the default value of a parameter of a function from say
.2
to.9
, why?