The “rweibull” Function in R

  • Package: Base R (no specific package required)

  • Purpose: Generates random numbers from a Weibull distribution.

  • General Class: Random Number Generation

  • Required Argument(s):

    • n: The number of random values to generate.

    • shape: The shape parameter of the Weibull distribution.

    • scale: The scale parameter of the Weibull distribution.

  • Notable Optional Arguments:

    • None.

  • Example:

  • # Generate 100 random values from a Weibull distribution
    random_values <- rweibull(n = 100, shape = 2, scale = 1)
    print(random_values)

  • In this example, the rweibull function generates 100 random values from a Weibull distribution with a shape parameter of 2 and a scale parameter of 1. The generated values are then printed to the console.

Previous
Previous

The “t.test” Function in R

Next
Next

The “rnbinom” Function in R