Browse Source

Edit: we did a full explaination in the Twitter secion, so we should also do it here

pull/2/head
janwey 1 year ago
parent
commit
e84f6e6d8a
2 changed files with 30 additions and 1 deletions
  1. 30
    1
      docs/collector.md
  2. BIN
      docs/collector.pdf

+ 30
- 1
docs/collector.md View File

@@ -610,7 +610,36 @@ account information and noting down, which ones are bots and which are not.
If we identify a poster as a bot, we give the variable `mastodon_bot` the value
`TRUE` for this position and `FALSE` if this is not a bot. Just like extracting
information from the lower `list()` items in the `twitteR` package, we first
need to create an empty `vector()` item and fill it with the help of a for-loop:
need to create an empty `vector()` item:
```
mastodon_bot <- c()
```

Next, it will be filled with the help of a for-loop. It has to count up from 1
to as long as the `mastodon_pers` `list()` item is:
```
for(i in 1:length(mastodon_pers)){
...
}
```

Within this for-loop, we need to check whether or not that account is a bot. As
described above, for the sake of simplicity and because the only bot that comes
to mind is the "TrendingBot", we do it with a simple if-statement:
```
if(mastodon_pers[[i]]$username == "TrendingBot"){
...
} else {
...
}
```
*Note: you can use multiple Bot-names by adding "|" (or) followed by another
botname to the statement.*

As mentioned above, if the statement is true, we set the `mastodon_bot` variable
at this position as `TRUE` and as `FALSE` if it is not.

All put together, we have:
```
mastodon_bot <- c()
for(i in 1:length(mastodon_pers)){

BIN
docs/collector.pdf View File


Loading…
Cancel
Save