Description Usage Arguments Details Value Author(s) Examples
This function allows the user to create dyadic data sets which can be directed or undirected.
1 | makeDyadic(x, directed = FALSE, show.progress = 5)
|
x |
The data matrix whereas the first variable is the country code and the second column has to be the time variable. |
directed |
Logical. If |
show.progress |
Logical. The process may take some time depending on the size of the supplied data matrix. This option allows users to receive feedback of how far along the process is at periodical steps. Default is set to 5. |
This function was first written for Simon Collrad-Wexler and then later amended for Fabio Wasserfallen.
Returns a data frame with the dyadic data set.
Lucas Leemann lleemann@gmail.com
1 2 3 4 5 | dataOrig <- matrix(c( rep(c(1:4),3), rep(1,4), rep(2,4), rep(3,4),
rnorm(4,1.5,0.1), rnorm(4,2.5,0.1), rnorm(4,3.5,0.1), rnorm(4,4.5,0.1),
rnorm(4,5.5,0.1), rnorm(4,6.5,0.1)),12,4)
colnames(dataOrig) <- c("countryCODE", "Year", "Variable 1", "Variable 2")
dataNew <- makeDyadic(dataOrig, directed=TRUE)
|
Loading required package: MASS
Loading required package: memisc
Loading required package: lattice
Attaching package: 'memisc'
The following objects are masked from 'package:stats':
contr.sum, contr.treatment, contrasts
The following object is masked from 'package:base':
as.array
Loading required package: Formula
Loading required package: mnormt
Loading required package: pbivnorm
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.