R/NB.example.dataset.R

Defines functions NB.example.dataset

Documented in NB.example.dataset

# TO GENERATE AN EXAMPLE DATASET
NB.example.dataset<-function()
{
x<-c(51,43,51,55,
48,48,56,48,
43,48,57,52,
55,36,53,56,
54,45,50,51,
46,60,46,48,
55,53,43,49,
51,51,56,42,
59,52,40,49,
46,47,55,52,
61,45,48,46,
49,48,56,47,
51,55,42,52,
43,51,55,51,
45,52,48,55,
47,56,37,60,
49,53,52,46,
43,46,62,49,
50,52,51,47,
52,61,45,42,
53,54,41,52,
47,52,52,49,
46,49,51,54,
55,55,39,51,
41,61,54,44,
59,43,42,56,
50,48,47,55,
51,45,47,57,
51,53,45,51,
42,55,47,56,
44,46,54,56,
49,41,51,59,
54,51,54,41,
59,39,48,54,
57,51,51,41,
50,44,56,50,
41,57,49,53,
41,57,50,52,
43,44,49,64,
61,49,43,47,
53,48,48,51,
63,44,42,51,
53,48,44,55,
44,57,52,47,
42,44,62,52,
54,57,49,40,
49,55,46,50,
51,49,44,56,
63,44,45,48,
61,50,43,46,
56,51,52,41,
55,35,53,57,
51,54,47,48,
44,50,58,48,
41,46,59,54,
60,36,58,46,
53,48,58,41,
42,54,63,41,
73,33,50,44,
51,39,49,61,
56,58,53,33,
41,53,52,54,
47,52,56,45,
35,56,49,60,
33,54,59,54,
46,59,48,47,
50,40,41,69,
44,50,54,52,
50,46,67,37,
48,53,53,46,
53,50,48,49,
45,54,49,52,
56,42,46,56,
52,48,65,35,
58,39,52,51,
57,66,45,32,
56,59,40,45,
37,53,52,58,
50,41,46,63,
54,50,52,44,
51,59,55,35,
44,58,39,59,
60,42,55,43,
49,57,44,50,
52,40,61,47,
59,37,50,54,
51,60,54,35,
46,43,51,60,
39,44,56,61,
50,43,44,63,
47,46,53,54,
54,58,40,48,
52,35,51,62,
44,62,61,33,
49,72,40,39,
35,54,41,70,
55,33,52,60,
56,47,49,48,
63,39,41,57,
46,64,49,41)
x<-matrix(x, byrow=T, ncol=4)
write.table(x[1:50,], file='sample_data.txt', row.names=FALSE, col.names=FALSE, sep=' ')
write('', file='sample_data.txt', append=TRUE)
write.table(x[51:100,], file='sample_data.txt', row.names=FALSE, col.names=FALSE, sep=' ', append=TRUE)
print('sample_data.txt is generated in your working directory')
}

Try the NB package in your browser

Any scripts or data that you put into this service are public.

NB documentation built on May 2, 2019, 1:29 p.m.