How to construct high-dimensional variable in R?
For example; Consider the situation where we may want to explain each response variable $Y \in \mathbb{R}$ by a $p$-dimensional variable $X \sim \text{Unif}([0,1]^p)$. What is the R code of constructing $X$?
All you need to notice is that $X \sim Unif([0,1]^p)$ if $X_i \sim Unif([0,1])$ where $X_i$ is the $i$-th coordinate of $X$ and those $X_i$ are i.i.d. Then you can generate $X$ by typing $\texttt{runif(p)}$ (see the reference).