| | 1 | == Useful commands for using the R API == |
| | 2 | |
| | 3 | === Get a simple overview of all data matrices === |
| | 4 | `find.data()[,c("id","name")]` |
| | 5 | |
| | 6 | === Download a data matrix === |
| | 7 | `dataId <- 0`[[BR]] |
| | 8 | `data <- downloadmatrixascsvCURL(dataId)` |
| | 9 | |
| | 10 | === Upload a completely new data matrix, including annotations === |
| | 11 | `invId <- 0`[[BR]] |
| | 12 | `data <- NULL`[[BR]] |
| | 13 | `data <- rbind(data, c("A", "B"))`[[BR]] |
| | 14 | `data <- rbind(data, c("B", "A"))`[[BR]] |
| | 15 | `marker1 = add.marker(name="myMarker1", cm="10.0", investigation_id=invId)`[[BR]] |
| | 16 | `marker2 = add.marker(name="myMarker2", cm="20.0", investigation_id=invId)`[[BR]] |
| | 17 | `ind1 = add.individual(name="myInd1", investigation_id=invId)`[[BR]] |
| | 18 | `ind2 = add.individual(name="myInd2", investigation_id=invId)`[[BR]] |
| | 19 | `colnames(data) <- c("myInd1", "myInd2")`[[BR]] |
| | 20 | `rownames(data) <- c("myMarker1", "myMarker2")`[[BR]] |
| | 21 | `add.datamatrix(data, name="myResults", investigation_id=invId, rowtype="Marker", coltype="Individual", valuetype="Text")`[[BR]] |