Fix paths/slashes

This commit is contained in:
hadley 2016-10-04 11:17:58 -05:00
parent 5e015bf977
commit ed42869cb4
1 changed files with 4 additions and 4 deletions

View File

@ -59,7 +59,7 @@ Paths and directories are a little complicated because there are two basic style
1. The most important difference is how you separate the components of the 1. The most important difference is how you separate the components of the
path. Mac and Linux uses slashes (e.g. `plots/diamonds.pdf`) and Windows path. Mac and Linux uses slashes (e.g. `plots/diamonds.pdf`) and Windows
uses backslashes (e.g. `plots\\diamonds.pdf`). R can work with either type uses backslashes (e.g. `plots\diamonds.pdf`). R can work with either type
(no matter what platform you're currently using), but unfortunately, (no matter what platform you're currently using), but unfortunately,
backslashes mean something special to R, and to get a single backslash backslashes mean something special to R, and to get a single backslash
in the path, you need to type two backslashes! That makes life frustrating, in the path, you need to type two backslashes! That makes life frustrating,
@ -67,12 +67,12 @@ Paths and directories are a little complicated because there are two basic style
1. Absolute paths (i.e. paths that point to the same place regardless of 1. Absolute paths (i.e. paths that point to the same place regardless of
your working directory) look different. In Windows they start with a drive your working directory) look different. In Windows they start with a drive
letter (e.g. "C:`) or two backslashes (e.g. `\\\servername`) and in letter (e.g. `C:`) or two backslashes (e.g. `\\servername`) and in
Mac/Linux they start with a slash "/" (e.g. "/users/hadley"). You should Mac/Linux they start with a slash "/" (e.g. `/users/hadley`). You should
__never__ use absolute paths in your scripts, because they hinder sharing: __never__ use absolute paths in your scripts, because they hinder sharing:
noone else will have exactly the same directory configuration as you. noone else will have exactly the same directory configuration as you.
1. The last minor difference is the place that "~" points to. "~" is a 1. The last minor difference is the place that `~` points to. `~` is a
convenient shortcut to your home directory. Windows doesn't really have convenient shortcut to your home directory. Windows doesn't really have
the notion of a home directory, so it instead points to your documents the notion of a home directory, so it instead points to your documents
directory. directory.