How can I sample from a shifted and scaled Student-t distribution with a specified mean and sd in R? I'm currently building some Bayesian models with the brms package and the default intercept prior is student_t(3, 0, 6.3) and so I'm looking to visualise the prior predictive distribution from this prior. Typically I would just use functions like rnorm or unif depending on the distribution; however, the rt function only takes  n and df arguments and I cannot specify an SD of 6.3.
How can I sample from this distribution?

Do it in multiple steps.

*

*Simulate from the t-distribution with the appropriate degrees of freedom $\nu$, using rt.


*Divide by the population standard deviation, $\sqrt{\frac{
\nu
}{
\nu-2
}}$. Now the population standard deviation is $1$.


*Multiply by your desired standard deviation.


*Add your desired mean, since the population mean is $0$.
You can combine these steps in one function.
rt_modified <- function(N, nu, mu, standard_dev){
    x1 <- rt(N, nu) # 1
    x2 <- x1/sqrt(nu/(nu-2)) # 2
    x3 <- x2 * standard_dev # 3
    x4 <- x3 + mu # 4
    return(x4)
}

