Package condusco. November 8, 2017

Similar documents
Package calpassapi. August 25, 2018

Package SEMrushR. November 3, 2018

Package geojsonsf. R topics documented: January 11, Type Package Title GeoJSON to Simple Feature Converter Version 1.3.

Package fastdummies. January 8, 2018

Package postgistools

Package cattonum. R topics documented: May 2, Type Package Version Title Encode Categorical Features

Package rgho. R topics documented: January 18, 2017

Package gtrendsr. October 19, 2017

Package gtrendsr. August 4, 2018

Package ECctmc. May 1, 2018

Package WordR. September 7, 2017

Package githubinstall

Package dkanr. July 12, 2018

Package bigqueryr. October 23, 2017

Package goodpractice

Package statsdk. September 30, 2017

Package validara. October 19, 2017

Package facerec. May 14, 2018

Package SNPediaR. April 9, 2019

Package opencage. January 16, 2018

Package robotstxt. November 12, 2017

Package wikitaxa. December 21, 2017

Package cregulome. September 13, 2018

Package patentsview. July 12, 2017

Package gifti. February 1, 2018

Package virustotal. May 1, 2017

Package barcoder. October 26, 2018

Package available. November 17, 2017

Package canvasxpress

Package rwars. January 14, 2017

Package bisect. April 16, 2018

Package fitbitscraper

Package kdtools. April 26, 2018

Package rprojroot. January 3, Title Finding Files in Project Subdirectories Version 1.3-2

Package messaging. May 27, 2018

Package bigqueryr. June 8, 2018

Package repec. August 31, 2018

Package data.world. April 5, 2018

Package splithalf. March 17, 2018

Package kirby21.base

Package glue. March 12, 2019

Package RPostgres. April 6, 2018

Package datasets.load

Package spark. July 21, 2017

Package internetarchive

Package RPresto. July 13, 2017

Package phrasemachine

Package censusapi. August 19, 2018

Package algorithmia. September 13, 2016

Package rzeit2. January 7, 2019

Package projector. February 27, 2018

Package rgdax. January 7, 2019

Package raker. October 10, 2017

Package dbx. July 5, 2018

Package RPostgres. December 6, 2017

Package semver. January 6, 2017

Package aws.transcribe

Package RODBCext. July 31, 2017

Package RODBCDBI. August 29, 2016

Package humanize. R topics documented: April 4, Version Title Create Values for Human Consumption

Package rsppfp. November 20, 2018

Package nlgeocoder. October 8, 2018

Package crossword.r. January 19, 2018

Package gggenes. R topics documented: November 7, Title Draw Gene Arrow Maps in 'ggplot2' Version 0.3.2

Package ezknitr. September 16, 2016

Package modmarg. R topics documented:

Package fingertipsr. May 25, Type Package Version Title Fingertips Data for Public Health

Package lumberjack. R topics documented: July 20, 2018

Package qualmap. R topics documented: September 12, Type Package

Package jdx. R topics documented: January 9, Type Package Title 'Java' Data Exchange for 'R' and 'rjava'

Package wrswor. R topics documented: February 2, Type Package

Package stapler. November 27, 2017

Package keyholder. May 19, 2018

Package mdftracks. February 6, 2017

Package knitrprogressbar

Package colf. October 9, 2017

Package rcmdcheck. R topics documented: November 10, 2018

Package tidytransit. March 4, 2019

Package ggimage. R topics documented: November 1, Title Use Image in 'ggplot2' Version 0.0.7

Package editdata. October 7, 2017

Package bigreadr. R topics documented: August 13, Version Date Title Read Large Text Files

Package tidyimpute. March 5, 2018

Package MonetDBLite. January 14, 2018

Package clipr. June 23, 2018

Package kerasformula

Package docxtools. July 6, 2018

Package labelvector. July 28, 2018

Package readxl. April 18, 2017

Package genesysr. June 14, 2018

Package crossrun. October 8, 2018

Package pdfsearch. July 10, 2018

Package fastrtext. December 10, 2017

Package sessioninfo. June 21, 2017

Package loggit. April 9, 2018

Package guardianapi. February 3, 2019

Package elasticsearchr

Package eply. April 6, 2018

Package PxWebApiData

Package BiocManager. November 13, 2018

Package vip. June 15, 2018

Transcription:

Type Package Package condusco November 8, 2017 Title Query-Driven Pipeline Execution and Query Templates Version 0.1.0 Author Roland Stevenson Maintainer Roland Stevenson <roland@rmg-services.com> Description Runs a function iteratively over each row of either a dataframe or the results of a query. Use the 'BigQuery' and 'DBI' wrappers to iteratively pass each row of query results to a function. If a field contains a 'JSON' string, it will be converted to an object. This is helpful for queries that return 'JSON' strings that represent objects. These fields can then be treated as objects by the pipeline. License GPL-3 URL https://github.com/ras44/condusco BugReports https://github.com/ras44/condusco/issues Encoding UTF-8 LazyData true Suggests knitr, rmarkdown, whisker, testthat, RSQLite VignetteBuilder knitr Depends R (>= 3.3.2, jsonlite, assertthat, bigrquery, DBI RoxygenNote 6.0.1.9000 NeedsCompilation no Repository CRAN Date/Publication 2017-11-08 19:30:17 UTC R topics documented: run_pipeline......................................... 2 run_pipeline_dbi...................................... 2 run_pipeline_gbq...................................... 4 Index 6 1

2 run_pipeline_dbi run_pipeline Runs user-provided pipeline for each row of arguments in parameters, converting any JSON strings to objects Description Runs user-provided pipeline for each row of arguments in parameters, converting any JSON strings to objects Usage run_pipeline(pipeline, parameters Arguments pipeline parameters User-provided function with one argument, a dataframe An dataframe of fields to convert to json Examples library(whisker run_pipeline( function(params{ query <- "SELECT result FROM {{table_prefix}}_results;" whisker.render(query,params }, data.frame( table_prefix = c('batman', 'robin' run_pipeline_dbi A wrapper for running pipelines with a DBI connection invocation query Description A wrapper for running pipelines with a DBI connection invocation query Usage run_pipeline_dbi(pipeline, query, con,...

run_pipeline_dbi 3 Arguments pipeline User-provided function with one argument, one row of query results query A query to execute via the DBI connection con The DBI connection... Additional arguments passed to dbsendquery( and dbfetch( Examples ## Not run: library(whisker library(rsqlite con <- dbconnect(rsqlite::sqlite(, ":memory:" dbwritetable(con, "mtcars", mtcars #for each cylinder count, count the number of top 5 hps it has pipeline <- function(params{ query <- "SELECT {{#list}} SUM(CASE WHEN hp='{{val}}' THEN 1 ELSE 0 END as n_hp_{{val}}, {{/list}} cyl FROM mtcars GROUP BY cyl ;" dbgetquery( con, whisker.render(query,params } #pass the top 5 most common hps as val params run_pipeline_dbi( pipeline, ' SELECT "[" GROUP_CONCAT("{ ""val"": """ hp FROM ( SELECT CAST(hp as INTEGER as HP, count(hp as cnt FROM mtcars GROUP BY hp ORDER BY cnt DESC LIMIT 5 """ }" "]" AS list

4 run_pipeline_gbq ', con dbdisconnect(con ## End(Not run run_pipeline_gbq A wrapper for running pipelines with a BigQuery invocation query Description A wrapper for running pipelines with a BigQuery invocation query Usage run_pipeline_gbq(pipeline, query, project,... Arguments pipeline User-provided function with one argument, one row of query results query A query to execute in Google BigQuery project The Google BigQuery project to bill... Additional arguments passed to query_exec( Examples ## Not run: library(whisker #Set GBQ project project <- '' #Set the following options for GBQ authentication on a cloud instance options("httr_oauth_cache" = "~/.httr-oauth" options(httr_oob_default=true #Run the below query to authenticate and write credentials to.httr-oauth file query_exec("select 'foo' as bar",project=project; pipeline <- function(params{ query <- " SELECT {{#list}} SUM(CASE WHEN author.name ='{{name}}' THEN 1 ELSE 0 END as n_{{name_clean}},

run_pipeline_gbq 5 {{/list}} repo_name FROM bigquery-public-data.github_repos.sample_commits GROUP BY repo_name ;" res <- query_exec( whisker.render(query,params, project=project, use_legacy_sql = FALSE ; } print(res run_pipeline_gbq(pipeline, " SELECT CONCAT('[', STRING_AGG( CONCAT('{\"name\":\"',name,'\",','\"name_clean\":\"', REGEXP_REPLACE(name, r'[^[:alpha:]]', '','\"}', ']' as list FROM ( SELECT author.name, COUNT(commit n_commits FROM bigquery-public-data.github_repos.sample_commits GROUP BY 1 ORDER BY 2 DESC LIMIT 10 ", project, use_legacy_sql = FALSE ## End(Not run

Index run_pipeline, 2 run_pipeline_dbi, 2 run_pipeline_gbq, 4 6