Here you will find daily news and tutorials about R, contributed by over 750 bloggers.
There are many ways to follow us - By e-mail:On Facebook: If you are an R blogger yourself you are invited to add your own R content feed to this site (Non-English R bloggers should add themselves- here)

In many cases werequire some data with certain characteristics to develop a model, perform research, to test an algorithm or simply to practice. Here I show an example of how to generate some synthetic data that can help you to generate your own.

We will need the ggplot2 library to display our data:

library(ggplot2) Now we define the dimensions of the arrangement we need:

lrows <- 3035 lcols <- 11

in this case 3035 rows and 11 columns.

Now we define the array first containing zeros on all entries:

syn_data <- array(data = 0, dim = c(lrows, lcols))

Our data look like this:

Now let’s name each field (column):

colnames(syn_data) <- c(“ONE”,”NUMBER”,”R1″,”R2″,”R3″, “R4”, “R5”, “R6″,”NINE”,”TEN”, “ELEVEN”) Now let’s assign values to some columns.