Description Usage Arguments Details Value Note Author(s) References Examples
Read the essentia commands in the stated file, and save the csv output into R. This command is primarily intended to capture the output of a query to the Essentia database.
1 |
file |
The essentia script to run and any arguments you want to pass into the bash script. |
read.essentia is used to directly query the database using a script with a single csv formatted output. You can call read.essentia multiple times to run statements that produce different outputs and capture their respective output into R.
However, you can also use capture.essentia to read all of the statements in a file instead and capture the output of any or all of the statements. Thus if you plan to run multiple statements that may be somewhat related to each other, you may want to use capture.essentia.
The value returned is the output from querying the database. This can be saved into an R dataframe or directly analyzed in R.
The argument, file, can also include the following flag:
#-notitle
: Tell R not to use the first line of the output
as the header.
Ben Waxer, Data Scientist with Auriq Systems.
See our website at www.auriq.com or our documentation at www.auriq.com/documentation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | ## Not run:
--------------------------------------------------------------------------------------------------
These examples require Essentia to be installed:
queryfile <- file("examplequery.sh","w")
cat("ess exec \"echo -e '11,12,13\n4,5,6\n7,8,9'\" \n", file=queryfile)
simpleecho <- read.essentia("examplequery.sh")
print(simpleecho)
--------------------------------------------------------------------------------------------------
This example requires Essentia to have selected a datastore containing purchase log data:
Store these lines as querypurchase.sh:
ess query "select count(refID) from purchase:2014-09-01:2014-09-15 \
where articleID>=46 group by userID"
-----------------------------------------------
Then run these commands in R:
library(RESS)
print(read.essentia("querypurchase.sh"))
--------------------------------------------------------------------------------------------------
The following example requires Essentia to be installed with apache log data stored in it.
Store the following lines as queryapache.sh:
# Query the Essentia database logsapache1 and save the sorted contents of vector1 in R as command2.
ess exec "aq_udb -exp logsapache1:vector1 -sort pagecount -dec"
-----------------------------------------------
Then run these commands in R:
library(RESS)
mydata <- read.essentia("queryapache.sh")
print(mydata)
The references contain more extensive examples that
fully walkthrough how to load and query the Essentia Database.
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.