|
How to prepare
The following are some things to prepare for the workshop.
In any case, I hope you are able to do the first two
(know about inheritance and know how to install an R package from source).
- If you do not know about inheritance in C++, then please study this
(it does not take much time).
There is a lot of material about this on the web, e.g.:
It will be assumed you know about inheritance and the use of virtual functions.
- Please prepare how to build an R package from source on your own computer.
Of course, the R package will be RSiena.
Steps:
- In R, make sure that you have installed the packages that are "dependencies" in RSiena:
Matrix, lattice, parallel, MASS, methods, xtable, network, codetools.
- If you are using a Windows computer, install RTools from
https://cran.r-project.org/bin/windows/Rtools/.
- Make a new directory for the workshop.
- Download the source code of RSiena from
https://github.com/stocnet/rsiena/releases.
Here you will find five "assets"; download one of those indicated as "source code".
Unpack the file; this will give a directory which has a name
such as rsiena-1.4.19, where the version number might be changed;
put this as a subdirectory in the directory for the workshop you just created.
- If you are a Windows user, like me:
I find it most convenient to work with three batch files.
My R program is installed in directory "C:\ProgramFiles\R\R-4.4.1\bin\R.exe".
You will have it in some other directory, and you will have to make
the corresponding changes in the following batch files. My batch files are
Download these three batch files, modify them (in a raw text editor)
so that they mention the new version of RSiena and point to your own R installation;
then first run buildsiena.bat
and then installsiena.bat. Just for your interest, you also could run checksiena.bat.
- If you are a Mac or Linux/Unix user, please find your way in the "further background" below.
- To get a sense of some straightforward C++ classes that are used for creating effects,
look at the following examples of C++ classes in RSiena.
You can find them in
https://github.com/stocnet/rsiena/tree/main/src/model/effects:
- AverageReciprocatedAlterEffect, which is used for the behavior effect avXAlt;
- IndegreePopularityEffect, which is used for the network effects inPop,
inPopSqrt, and inPop.c.
Also look at their definitions in the manual; calculating the effect statistics
in these classes is done by the use of, respectively, egoStatistic and tieStatistic
- For further background about constructing R packages, there is a lot of material on the web.
If you are on a Mac or on Linux/Unix, and you are unsure how to proceed to install a package from source,
you will find help in some of the material. Examples are:
|