Standard input, output, error flow in the R language

Source: Internet
Author: User

In R, stdin () corresponds to the standard input stream, stdout () corresponds to the standard output stream, and stderr () corresponds to the standard error stream

1) reading data from the standard input stream

In the interactive environment of R,

R>a <- read.table (stdin ())0: a1: b2: C

Press CTRL + D to end the input, but this seems to be useful only in interactive environments, where test runs are unsuccessful in Rscript;

2) Print information to standard output stream

Write ("I am stdout", stdout ())

Useful when you want to print information to standard output

3) Print error message to standard error stream

Write ("I am stderr", stderr ())

This is useful for printing error messages during the run

Standard input, output, error flow in the R language

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.