Page 197 - Data Science class 11
P. 197

5.  The directory path can be ______________________ .
                  a.  relative path                                  b.  absolute path

                  c.  Either a or b                                  d.  None of these

            B.  Fill in the blanks.

               1.  You can change the default working directory by clicking on the ______________________ menu.
               2.  The path of the directory that you want to set as working directory is passed as a ______________________ parameter in the
                  setwd() function.

               3.  The function getwd() stands for ______________________ .
               4.  After typing the command, when you press the ______________________ key, you will get the output of the typed command
                  instantly.

               5.  To work in RStudio, you need to first create ______________________ file.


                 Standard Questions (Section B)


            A.  Short answer type questions:
               1.  Write a short note on setwd() function.
              Ans.  It is possible to use the R language function setwd(), which stands for set working directory, to set the working directory.
                  The path of the directory that you want to set as working directory is passed as a string parameter in the setwd()
                  function. The directory path can either be a relative path or an absolute path. For Windows, the command might look
                  like:
                  setwd(“c:/Documents/my/working/directory”)

               2.  Differentiate between RStudio Desktop and RStudio Server.
              Ans.  The RStudio is available in two formats, that are, RStudio Desktop and RStudio Server. RStudio Desktop is a standalone
                  software application that you need to download and install on your computer. On the other hand, RStudio Server runs
                  on remote server, which you can access using your web browser.
               3.  What is the main drawback of typing commands in Console window?
              Ans.  The main drawback of typing commands in Console window is that the typed commands will be forgotten when we
                  close the close the RStudio. There is no option to save them.

            B.  Long answer type questions:
               1.  Define the following components of the RStudio application window:
                  i.  Code Editor

                  ii.  Console
              Ans.  i.   Code  Editor: It is the top-left portion of the RStudio application  window that  allows you to write R language
                    programs. It is a syntax-highlighting editor that supports direct code execution. It allows you to create and open a
                    file containing R script.
                  ii.  Console: It is the bottom-left portion of the RStudio application window, where you can give commands of R
                    language. It is the place where we can tell it what to do and it will show the results of a command.
               2.  What do you mean by current working directory? Name the function which is used to find the current working directory.
              Ans.  Working directory is a folder from where RStudio reads and where it saves files. We can find the current working
                  directory of RStudio by using the getwd() function, which stands for get working directory


                                                                                      Introduction to RStudio  195
   192   193   194   195   196   197   198   199   200   201   202