Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

readme lift

	geändert:   README.md
  • Loading branch information...
commit 72610b078701a4a92a317d356cd32ea398f376a2 1 parent 72e486a
wactbprot authored
Showing with 25 additions and 23 deletions.
  1. +25 −23 README.md
48 README.md
View
@@ -10,44 +10,44 @@
The R4CouchDB package provides a collection of functions for
basic database and document management operations such as add and
-delete.
+delete.
Every cdbFunction() gets and emits a list containing the
connection set up.
With the cdbIni() function the cdb$serverName is set to
-"localhost" as a default.
+"localhost" as a default.
There are some examples below the demo folder.
**Note:** Check out [*sofa*](https://github.com/SChamberlain/sofa), from
-@recology_ another R package to interact with CouchDB.
+@recology_ another R package to interact with CouchDB.
## Getting started
* download latest version or clone repository
* open a shell and install the package with:
-
+
R CMD INSTALL R4CouchDB
-
- dependencies (bitopts, RCurl, RJSONIO) can be
- installed in the same way
-* an easier way for those who have _devtools_ installed is
-
+dependencies (bitopts, RCurl, RJSONIO) can be
+installed in the same way
+
+* an easier way for those who have _devtools_ installed is
+
library(devtools)
install_github('R4CouchDB', 'wactbprot', subdir = 'R4CouchDB')
-
+
(see e.g. http://www.inside-r.org/packages/cran/devtools/docs/install_github)
* open R shell and load library with:
library(R4CouchDB)
-* generate a connection object (list) with:
+* generate a connection object (a simple ```list()```) with:
foo <- cdbIni()
-* play around with _foo_
+* play around with ```foo```
foo$queryParam <- "count=10"
cdbGetUuidS(foo)$res
@@ -74,24 +74,24 @@ and than
### \r
-In cdbIni I added with 0.1.2 the lines:
+In the function ```cdbIni()``` I added with 0.1.2 the lines:
cdb$toJSON <- function(lst){
- jsn <- toJSON(lst,
+ jsn <- toJSON(lst,
collapse = "",
digits = digits)
jsn <- gsub("\\r","\\\\r",jsn)
return(jsn)
}
- The point is: one can have a
+ The point is: one can have a
- {"a":"\r"}
+ {"a":"\r"}
in the database but one can not send it back
-this way. A \r is here replaced by \\r
-resulting in \r in the database.
-The gsub statement behaves like this:
+this way. A ```\r``` is here replaced by ```\\r```
+resulting in ```\r``` in the database.
+The ```gsub()``` function behaves like this:
> gsub("\\r","\\\\r","\r")
[1] "\\r"
@@ -102,15 +102,17 @@ The gsub statement behaves like this:
> gsub("\\r","\\\\r","\\\\r")
[1] "\\\\r"
-I'm not happy
-with this but have no better solution for the moment.
+I'm not happy with this but have no better solution for the moment.
### digits
-Numbers are converted to JSON with 7 digits by default. Adjust this to your
-needs by
+Numbers are converted to JSON with 7 digits by default.
+
+ > cdbIni()$digits
+ [1] 7
+Adjust this to your needs by:
cdb <- cdbIni()
cdb$digits <- 13
Please sign in to comment.
Something went wrong with that request. Please try again.