Description Usage Arguments Details Value Examples
Generate simulated dataset that can be used for testing and reproducible examples.
1 | create_data(n = 1000)
|
n |
Number of observations to be simulated |
The function create_data
generates a data.frame
with n
rows (defaults to 1,000) and the following 13 columns:
profit
[double
] - simulated as rnorm(n)
cogs
[double
] - simulated as rnorm(n)
fixed_cost
[double
] - simulated as rnorm(n)
rnd
[double
] - simulated as rnorm(n)
assets
[double
] - simulated as rnorm(n)
competition
[double
] - simulated as rnorm(n)
quality
[double
] - simulated as rnorm(n)
board_size
[double
] - simulated as rnorm(n)
ceo_age
[double
] - simulated as rnorm(n)
female_ceo
[logical
] - simulated as as.logical(rbinom(n, 1, 0.5))
industry
[character
] - simulated as sample(c("A", "B", "C", "D"), n, replace = TRUE)
country
[character
] - simulated as sample(c("A", "B", "C", "D"), n, replace = TRUE)
firm_value
[double
] - simulated as the result of the other variables, using random weights (runif()
) and a random error term (rnorm()
)
data.frame
or tibble
(when package tibble
is available) with n
rows and 13 columns.
1 2 | create_data()
create_data(n = 50)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.