start_annotator | R Documentation |
Starts a server and directs to the CSS annotator webclient. You can either run the job in the current R session, or run it in another session. If you run it in the current session (default), you can retrieve the annotations when you close (stop) the server. If you run it in a different session, you can also retrieve the annotations while the server is still running.
start_annotator(job_db, background = TRUE, browse = TRUE, port = 8000)
job_db |
A codingjob database file, created with
|
background |
If TRUE, start the server as a background process. This way you can keep working in the current session |
browse |
If TRUE (default), automatically opens
|
port |
The port number to run the annotator on. |
There are two ways to run in a different session. One is to simply open
another R session, and run the server there. The annotations are stored in a
SQLite database, and can be retrieved from any R session with the
gimme_annotations(db_file) command that is printed when running this
function. The other way is to use a rscript_process
background process, which runs the server in the background of the current
session until the current session is closed. To use this, set background =
TRUE (the default).
The job_db (for piping convenience)
sentiment <- annotation_variable("sentiment", "assign sentiment to words",
codes = c(red = "Negative", grey = "Neutral", green = "Positive")
)
codingjob <- create_job(
"Sotu sentiment",
create_units(mini_sotu, id = "id", set_text("text", text), meta = c("name", "year")),
create_codebook(sentiment)
)
## Not run:
job_db <- create_job_db(codingjob)
start_annotator(job_db)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.