The “rcauchy” Function in R

  • Package: Base R (stats package)

  • Purpose: To generate random samples from a Cauchy distribution.

  • General Class: Probability Distribution

  • Required Argument(s):

    • n: The number of random samples to generate.

  • Notable Optional Arguments:

    • location: The location parameter (default is 0).

    • scale: The scale parameter (default is 1).

  • Example:

  • # Example usage
    # Generate 100 random samples from a Cauchy distribution
    cauchy_samples <- rcauchy(100)

    # Print the generated samples
    print(cauchy_samples)

  • In this example, the rcauchy function is used to generate 100 random samples from a Cauchy distribution. The resulting samples are stored in the cauchy_samples variable and printed to the console.

Previous
Previous

The “read.csv” Function in R

Next
Next

The “qqline” Function in R