Peter Mortensen
• 29.8k
• 21
• 98
• 124

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.

#If you cannot share your original data, you can str it and give an idea about the structure of your data
``````
Prags
• 2.4k
• 2
• 19
• 36

Apart of all above answers which I found very interesting, it could sometimes be very easy as it is discussed here
:- http://www.dummies.com/how-to/content/how-to-make-a-minimal-reproducible-example-to-get-.htmlHOW 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 or 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 above answers are great and very important to think 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 http://adv-r.had.co.nz/Data-structures.html structures

``````#found based on the following
typeof(mydf1), what it is.
length(mydf1), how many elements it contains.

#If you cannot share your original data, you can str it and give an idea about the structure of your data
``````
replaced http://stackoverflow.com/ with https://stackoverflow.com/
URL Rewriter Bot

Apart of all above answers which I found very interesting, it could sometimes be very easy as it is discussed here
http://www.dummies.com/how-to/content/how-to-make-a-minimal-reproducible-example-to-get-.html

There are many ways to make a random vector Create a 100 number vector with random values in R rounded to 2 decimalsCreate a 100 number vector with random values in R rounded to 2 decimals or 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 above answers are great and very important to think 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 http://adv-r.had.co.nz/Data-structures.html

``````#found based on the following
typeof(mydf1), what it is.
length(mydf1), how many elements it contains.