This so-called R Markdown file accompanies a short Reproducible Open Coding Kit (ROCK) workshop developed by Szilvia Zörgő & Gjalt-Jorn Peters. More details are available below in section Links and resources.
The easiest way to get started is to copy this file to an RStudio Cloud project of your own. To do that, first visit the shared RStudio project at https://rstudio.cloud/project/2109292. Note that to view it, you will need to be logged in with an RStudio Cloud (or shinyapps.io) account, so create that first if you don’t have one yet.
Once it has loaded, click “Save a permanent copy” at the top:
This will store the project in your account’s workspace, so you that your changes are preserved and you can always return to it. If you do not save a permanent copy, you will be ejected from the temporary project after a while and will have to start over.
If you are already familiar with R, RStudio, and Git, you can also download this project and use your local RStudio Desktop installation. For the URL to the Git repository, see the Appendix.
In this exercise you will command the rock
package to read the clean sources and prepend uterrance identifiers (UIDs). The relative path to these clean sources from your project’s directory is data/05--clean-sources
. This means that the sources are in the the 05--clean-sources
directory (or folder) which is itself a subdirectory of the data
directory, which sits in the project directory.
We use the here::here()
function to conveniently locate the project directory; by passing the names of the subdirectories, it will always build a correct path that allows R (and the rock
package) to find the sources on the harddisk.
If you want to have a look at the clean sources beforehand, navigate to the data
directory in the file pane in the bottom-right, then open the 05--clean-sources
directory, and the click the Facebook_data_cleaned.rock
file to open it in RStudio.
After this function, rock::prepend_ids_to_sources()
, has read the sources and prepended the UIDs, it will write the sources to the 10--sources-with-UIDs
directory, which is also a subdirectory of the data
directory. It will add the suffix _with_uids
to each file it processed, which is convenient from a data management perspective.
In this exercise, we set the preventOverwriting
argument to FALSE
so that every time you run this code, new UIDs are designated, allowing you to play around a bit. Normally, you would never do this, because you want utterance identifiers to stay fixed throughout your project once they have been designated (therefore, the default value of the preventOverwriting
argument is TRUE
, so the rock
always protects against overwriting unless your override that manually).
rock::prepend_ids_to_sources(
input = here::here("data", "05--clean-sources"),
output = here::here("data", "10--sources-with-UIDs"),
outputSuffix = "_with_uids",
preventOverwriting = FALSE
);
Open the iROCK interface at https://i.rock.science:
Click the ‘Sources’ button at the top to load a source. It will show you a dialogue similar to that shown in Figure 3. To load the example source, copy-paste the following URL into the field as shown in Figure 3 and press [ENTER].
Note that if you run MacOS instead of Windows, you have to copy-paste the URLs into your browser, and then store the file locally and upload from there.
Then repeat that to load the example Codes and Section Breaks, this time copy-pasting these two URLs:
When you loaded all three the files into the right place, you should see something similar to what is shown in Figure 4: