home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Educational / R-0.49-MI / R-0.49-I / help / base / system < prev    next >
Encoding:
Text File  |  1997-04-23  |  1.1 KB  |  36 lines

  1.     
  2.     _I_n_v_o_k_e _a _S_y_s_t_e_m _C_o_m_m_a_n_d
  3.     
  4.          system(command, intern=FALSE)
  5.     
  6.     _A_r_g_u_m_e_n_t_s:
  7.     
  8.          command : the system command to be invoked, as a
  9.                    string.
  10.     
  11.           intern : a logical, indicates whether to make the out-
  12.                    put of the command an R object.
  13.     
  14.     _D_e_s_c_r_i_p_t_i_o_n:
  15.     
  16.          system invokes the system command specified by command.
  17.          If intern is TRUE then popen is used to invoke the com-
  18.          mand and the output collected, line by line, into an R
  19.          string vector which is returned as the value of system.
  20.          If intern is FALSE then the C function system is used
  21.          to invoke the command and the value returned by system
  22.          is the exit status of this function.  This function
  23.          provides users with the ability to invoke system com-
  24.          mands on whatever platform they are using.
  25.     
  26.     _E_x_a_m_p_l_e_s:
  27.     
  28.          # list all files in the current directory
  29.          # using the -F flag
  30.          system("ls -F")
  31.     
  32.          # t1 contains a vector of strings, each one
  33.          # representing a separate line of output from who
  34.          t1 <- system("who", TRUE)
  35.     
  36.