Apart offrom all the above answers which I found very interesting, it could sometimes be very easy as it is discussed here :- HOW TO MAKE A MINIMAL REPRODUCIBLE EXAMPLE TO GET HELP WITHHow to make a minimal reproducible example to get help with R
There are many ways to make a random vector Create a 100 number vector with random values in R rounded to 2 decimals orCreate a 100 number vector with random values in R rounded to 2 decimals or a random matrix in R:
mydf1<- matrix(rnorm(20),nrow=20,ncol=5)
Note that sometimes it is very difficult to share a given data because of various reasons such as dimension, etc. However, all the above answers are great, and they are very important to think about and use when one wants to make a reproducible data example. But note that in order to make a data as representative as the original (in case the OP cannot share the original data), it is good to add some information with the data example as (if we call the data mydf1)
class(mydf1)
# this shows the type of the data you have
dim(mydf1)
# this shows the dimension of your data
Moreover, one should know the type, length and attributes of a data which can be Data structures
#found based on the following
typeof(mydf1), what it is.
length(mydf1), how many elements it contains.
attributes(mydf1), additional arbitrary metadata.
#If you cannot share your original data, you can str it and give an idea about the structure of your data
head(str(mydf1))