options("width"=110) tmp <- packageDescription( basename(getwd()) )
cat("#", tmp$Title)
Status
filelist.R <- list.files("R", recursive = TRUE, pattern="\\.R$", ignore.case = TRUE, full.names = TRUE) filelist.tests <- list.files("tests", recursive = TRUE, pattern="\\.R$", ignore.case = TRUE, full.names = TRUE) filelist.cpp <- list.files("src", recursive = TRUE, pattern="\\.cpp$", ignore.case = TRUE, full.names = TRUE) lines.R <- unlist(lapply(filelist.R, readLines)) lines.tests <- unlist(lapply(filelist.tests, readLines)) lines.cpp <- unlist(lapply(filelist.cpp, readLines)) length.R <- length(grep("(^\\s*$)|(^\\s*#)|(^\\s*//)", lines.R, value = TRUE, invert = TRUE)) length.tests <- length(grep("(^\\s*$)|(^\\s*#)|(^\\s*//)", lines.tests, value = TRUE, invert = TRUE)) length.cpp <- length(grep("(^\\s*$)|(^\\s*#)|(^\\s*//)", lines.cpp, value = TRUE, invert = TRUE))
Zeilen R code: r length.R
, Zeilen Test code: r length.tests
Version
source_files <- grep( "/R/|/src/|/tests/", list.files(recursive = TRUE, full.names = TRUE), value = TRUE ) last_change <- as.character( format(max(file.info(source_files)$mtime), tz="UTC") )
cat(tmp$Version, "(",last_change,")")
Beschreibung
cat(tmp$Description)
Lizenz
cat(tmp$License, "<br>") cat(tmp$Author)
Installation
Aktuelle Entwicklerversion auf Github:
devtools::install_github("chrisnice89/rdao")
Für weiterführende Informationen und konkrete Anwendungen: Framework
SqlConnection : Steuert Verbindung und ist Basis des SqlCommands
SqlCommand : Interface für CRUD Operationen
SqlResult : Ergebnis einer Abfrage
IDiamonds : Interface zur Geschäftslogik (exemplarisch)
Diamond : Business entity (exemplarisch)
Laden benötigter Pakete
# packages library(RSQLite) library(R6) library(rdao)
# erstellen einer factory f<-connectionFactory() # Auswahl der Datenquelle und erforderliche Arguemnte übergeben b<-f$dbFile("/Users/cnitz/Dev/R/rdao/db files external/Diamonds.db") # Optionale Verbindungsparameter einstellen b$addCredentials(username = "Admin",password = "SesameOpen") # Verbindung erstellen cnn<-b$build()
# Abfrage erstellen library(rdao) f<-connectionFactory() b<-f$dbFile("/Users/cnitz/Dev/R/rdao/db files external/Diamonds.db") cnn<-b$build() result<-cnn$createQuery(sql = "Select carat,color FROM diamonds LIMIT 10")$fetch() result$countRows() m<-result$toMatrix() m(i = 1,j=1) m(2) m(1,1:2) result$setCarat(0.66) result$row(1)$setCarat(0.99) m(,1:2) print(result) result2<-cnn$createQuery(sql = "Select cut, price, depth FROM diamonds LIMIT 10")$fetch() # Generic print(result) print(result2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.