Skip to content

Commit

Permalink
Add index entries, playgrounds and cross-references to the recently a…
Browse files Browse the repository at this point in the history
…dded sections.
  • Loading branch information
aphalo committed Jun 13, 2017
1 parent 947d1e7 commit fdbd75f
Show file tree
Hide file tree
Showing 28 changed files with 250,944 additions and 279,690 deletions.
41 changes: 29 additions & 12 deletions R.friends.Rnw

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions R.intro.Rnw
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ Integrated Development Environments (IDEs) were initially created for computer p
\caption[Script in Rstudio]{The RStudio interface just after running the same script. Here we used the ``Source'' button to run the script. In this case R prints the results to the R console in the lower left pane.}\label{fig:intro:rstudio}
\end{figure}

When a script is run, if an error is triggered, it automatically finds the location of the error. \pgrmname{RStudio} also supports the concept of projects allowing saving of settings separately. Some features are beyond what you need for everyday data analysis and aimed at package development, such as integration of debugging, traceback on errors, profiling and bench marking of code so as to analyse and improve performance. It also integrates support for file version control, which is not only useful for package development, but also for keeping track of the progress or collaboration in the analysis of data.
When a script is run, if an error is triggered, it automatically finds the location of the error. \RStudio also supports the concept of projects allowing saving of settings separately. Some features are beyond what you need for everyday data analysis and aimed at package development, such as integration of debugging, traceback on errors, profiling and bench marking of code so as to analyse and improve performance. It also integrates support for file version control, which is not only useful for package development, but also for keeping track of the progress or collaboration in the analysis of data.

The version of RStudio that one uses locally, i.e.\ installed in your own computer, runs with almost identical user interface on most modern operating systems, such as Linux, Unix, OS X, and MS-Windows. There is also a server version that runs on Linux, and that can be used remotely through any web browser. The user interface is still the same.

\pgrmname{RStudio} is under active development, and constantly improved. Visit \url{http://www.rstudio.org/} for an up-to-date description and download and installation instructions. Two books \autocite{vanderLoo2012,Hillebrand2015} describe and teach how to use \pgrmname{RStudio} without going in depth into data analysis or statistics, however, as \pgrmname{RStudio} is under very active development several recently added important features are not described in these books. You will find tutorials and up-to-date cheat sheets at \url{http://www.rstudio.org/}.
\RStudio is under active development, and constantly improved. Visit \url{http://www.rstudio.org/} for an up-to-date description and download and installation instructions. Two books \autocite{vanderLoo2012,Hillebrand2015} describe and teach how to use \RStudio without going in depth into data analysis or statistics, however, as \RStudio is under very active development several recently added important features are not described in these books. You will find tutorials and up-to-date cheat sheets at \url{http://www.rstudio.org/}.

\subsection{R as a language}

Expand Down Expand Up @@ -125,9 +125,9 @@ help(help)
@
\end{playground}

When using \pgrmname{RStudio} there are several easier ways of navigating to a help page, for example with the cursor on the name of a function in the editor or console, pressing the F1 key, opens the corresponding help page in the help pane. Letting the cursor stay for a few seconds on the name of a function at the R console will open ``bubble help'' for it. If the function is defined in a script or another file open in the editor pane one can directly navigate from the line where the function is called to where it is defined. In RStudio one can also search for help through the graphical interface.
When using \RStudio there are several easier ways of navigating to a help page, for example with the cursor on the name of a function in the editor or console, pressing the F1 key, opens the corresponding help page in the help pane. Letting the cursor stay for a few seconds on the name of a function at the R console will open ``bubble help'' for it. If the function is defined in a script or another file open in the editor pane one can directly navigate from the line where the function is called to where it is defined. In RStudio one can also search for help through the graphical interface.

In addition to help pages, the \pgrmname{R}'s distribution includes useful manuals as PDF or HTML files. This can be accessed most easily through the Help menu in \pgrmname{RStudio} or \pgrmname{RGUI}. Extension packages, provide help pages for the functions and data they export. When a package is loaded into an \pgrmname{R} session, its help pages are added to the native help of \pgrmname{R}. In addition to these individual help pages, each package, provides an index of its corresponding help pages, for users to browse. Many packages, also provide \emph{vignettes} such as User Guides or articles describing the algorithms used.
In addition to help pages, the \pgrmname{R}'s distribution includes useful manuals as PDF or HTML files. This can be accessed most easily through the Help menu in \RStudio or \pgrmname{RGUI}. Extension packages, provide help pages for the functions and data they export. When a package is loaded into an \pgrmname{R} session, its help pages are added to the native help of \pgrmname{R}. In addition to these individual help pages, each package, provides an index of its corresponding help pages, for users to browse. Many packages, also provide \emph{vignettes} such as User Guides or articles describing the algorithms used.

\subsection{Obtaining help from on-line forums}

Expand Down Expand Up @@ -174,16 +174,16 @@ As mentioned above, although\index{c@\textsf{C++}}\index{c!compiler} R is an int

\subsection{Markdown}

\langname{Markdown} (see \url{https://daringfireball.net/projects/markdown/} is a simple markup language, which although offering somehow less flexibility than \hologo{LaTeX}, it is much easier to learn and text files using this markup language, can be easily converted to various output formats such as HTML and XTML in addition to PDF. \pgrmname{RStudio} supports editing markdown and the variants \langname{R Markdown} and \langname{Bookdown}. Documentation on \langname{Rmarkdown} is available on-line at \url{http://rmarkdown.rstudio.com/} and on \langname{Bookdown} at \url{https://bookdown.org/}.
\langname{Markdown} (see \url{https://daringfireball.net/projects/markdown/} is a simple markup language, which although offering somehow less flexibility than \hologo{LaTeX}, it is much easier to learn and text files using this markup language, can be easily converted to various output formats such as HTML and XTML in addition to PDF. \RStudio supports editing markdown and the variants \langname{R Markdown} and \langname{Bookdown}. Documentation on \langname{Rmarkdown} is available on-line at \url{http://rmarkdown.rstudio.com/} and on \langname{Bookdown} at \url{https://bookdown.org/}.

\section{What is needed to run the examples on this book?}

I recommend you to use as an editor or IDE (integrated development environment) \RStudio. \RStudio is user friendly, actively maintained, free, open-source and available both in desktop and server versions. The desktop version runs on Windows, Linux, and OS X and other Unixes. For\index{IDE for R}\index{editor for R scripts} running the examples in the handbook, you would need only to have \pgrmname{R} installed. That would be enough as long as you also have a text editor available. This is possible, but does not give a very smooth work flow for data analyses that are beyond the very simple. The next stage is to use a text editor which integrates to some extent with R, but still this is not ideal, specially for writing packages or long scripts for data analysis. Currently, by far the best option is to use \pgrmname{RStudio}.
I recommend you to use as an editor or IDE (integrated development environment) \RStudio. \RStudio is user friendly, actively maintained, free, open-source and available both in desktop and server versions. The desktop version runs on Windows, Linux, and OS X and other Unixes. For\index{IDE for R}\index{editor for R scripts} running the examples in the handbook, you would need only to have \pgrmname{R} installed. That would be enough as long as you also have a text editor available. This is possible, but does not give a very smooth work flow for data analyses that are beyond the very simple. The next stage is to use a text editor which integrates to some extent with R, but still this is not ideal, specially for writing packages or long scripts for data analysis. Currently, by far the best option is to use \RStudio.

Of course when choosing which editor to use, personal preferences and previous familiarity play an important.
Currently, for the development of packages, I use \pgrmname{RStudio} exclusively. For writing this book I have used both RStudio and the text editor WinEdt which also has some support for R together with excellent support for \LaTeX. When working on a large project or collaborating with other data analysts or researchers, one big advantage of a system based on plain text files, is that the same files can be edited with different programs as needed or wished by the different persons involved in a project.
Currently, for the development of packages, I use \RStudio exclusively. For writing this book I have used both RStudio and the text editor WinEdt which also has some support for R together with excellent support for \LaTeX. When working on a large project or collaborating with other data analysts or researchers, one big advantage of a system based on plain text files, is that the same files can be edited with different programs as needed or wished by the different persons involved in a project.

When I started using R, nearly two decades ago, I was using other editors, using the operating system shell a lot more, and struggling with debugging as no IDE was available. The only reasonably good integration with an editor was for Emacs, which was widely available only under Unix-like systems. Given this past experience, I encourage you to use an IDE for R. \pgrmname{RStudio} is nowadays very popular, but if you do not like it, need a different set of features, such as integration with \pgrmname{ImageJ}, or are already familiar with the \pgrmname{Eclipse} IDE, you may like try the \pgrmname{Bio7} IDE, available from \url{http://bio7.org}.
When I started using R, nearly two decades ago, I was using other editors, using the operating system shell a lot more, and struggling with debugging as no IDE was available. The only reasonably good integration with an editor was for Emacs, which was widely available only under Unix-like systems. Given this past experience, I encourage you to use an IDE for R. \RStudio is nowadays very popular, but if you do not like it, need a different set of features, such as integration with \pgrmname{ImageJ}, or are already familiar with the \pgrmname{Eclipse} IDE, you may like try the \pgrmname{Bio7} IDE, available from \url{http://bio7.org}.

All data sets and files needed to run the examples in the book can be obtained by installing different R packages. One of them \pkgname{learnrbook} available through CRAN, contains datasets and files not earlier available in R packages. The \pkgname{learnrbook} package also contains installation instructions and saved names of all other packages used in the book. Instructions on installing R, git, RStudio, and, also compilers and other tools in those cases they are needed, are available on-line. In many cases the IT staff at your employer or school will know how to still them, or they may be even included in the default setup. In addition we give step by step instructions in the on-line Appendix (currently missing).

Expand Down
4 changes: 2 additions & 2 deletions R.plotting.Rnw
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,7 @@ ggplot(Puromycin, aes(conc, rate, colour = state)) +
geom_point() +
geom_smooth(method = "nls",
method.args = list(formula = y ~ (Vmax * x) / (k + x),
start = list(Vmax = 200, k = 0.05)),
start = list(Vmax = 200, k = 0.05)),
se = FALSE)
@

Expand Down Expand Up @@ -2621,7 +2621,7 @@ deparse_test(a)
\section{Generating output files}
\index{devices!output|see{graphic output devices}}
\index{graphic output devices|(}
It is possible, when using \pgrmname{RStudio}, to directly export the displayed plot to a file. However, if the file will have to be generated again at a later time, or a series of plots need to be produced with consistent format, it is best to include the commands to export the plot in the script.
It is possible, when using \RStudio, to directly export the displayed plot to a file. However, if the file will have to be generated again at a later time, or a series of plots need to be produced with consistent format, it is best to include the commands to export the plot in the script.

In R,\index{plots!printing}\index{plots!saving}\index{plots!output to files} files are created by printing to different devices. Printing is directed to a currently open device. Some devices produce screen output, others files. Devices depend on drivers. There are both devices that or part of R, and devices that can be added through packages.

Expand Down
Loading

0 comments on commit fdbd75f

Please sign in to comment.