Database Reference
In-Depth Information
lm() function are provided on the right. Alternatively, help(lm) could have been
entered at the console prompt.
Figure 3.4 Accessing help in Rstudio
Functions such as edit() and fix() allow the user to update the contents of
an R variable. Alternatively, such changes can be implemented with RStudio by
selecting the appropriate variable from the workspace pane.
R allows one to save the workspace environment, including variables and loaded
libraries, into an .Rdata file using the save.image() function. An existing
.Rdata file can be loaded using the load.image() function. Tools such as
RStudio prompt the user for whether the developer wants to save the workspace
connects prior to exiting the GUI.
The reader is encouraged to install R and a preferred GUI to try out the R examples
provided in the topic and utilize the help functionality to access more details about
the discussed topics.
3.1.2 Data Import and Export
In the annual retail sales example, the dataset was imported into R using the
read.csv() function as in the following code.
sales <- read.csv("c:/data/yearly_sales.csv")
R uses a forward slash (/) as the separator character in the directory and file paths.
This convention makes script files somewhat more portable at the expense of some
initial confusion on the part of Windows users, who may be accustomed to using
Search WWH ::




Custom Search