Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor changes to wording in the vignette. #17

Merged
merged 1 commit into from
Nov 14, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions vignettes/Intro_to_DataSpaceR.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@ This package provides a thin wrapper around [Rlabkey](https://cran.r-project.org

First, go to [DataSpace](https://dataspace.cavd.org) now and set yourself up with an account.

In order to connect to the CAVD DataSpace via `DataSpaceR`, you will need a `netrc` file in your home directory that will contain a `machine` name (hostname of DataSpace), and `login` and `password`. There are two ways to creat a netrc file.
In order to connect to the CAVD DataSpace via `DataSpaceR`, you will need a `netrc` file in your home directory that will contain a `machine` name (hostname of DataSpace), and `login` and `password`. There are two ways to create a `netrc` file.

### Creating a netrc file with `writeNetrc`

On your R console, create a netrc file using a function from `DataSpaceR`:
On your R console, create a `netrc` file using a function from `DataSpaceR`:

```{r, eval=FALSE}
DataSpaceR::writeNetrc("[email protected]", "yourSecretPassword")
```

This will create a netrc file in your home directory. Make sure you have a valid login and password.
This will create a `netrc` file in your home directory. Make sure you have a valid login and password.

### Manually creating a netrc file

***Alternatively***, you can manually create a netrc file in the computer running R.
***Alternatively***, you can manually create a netrc file.

* On Windows, this file sould be named `_netrc`
* On UNIX, it should be named `.netrc`
* On UNIX/Mac, it should be named `.netrc`
* The file should be located in the user's home directory, and the permissions on the file should be unreadable for everybody except the owner
* To determine home directory, run `Sys.getenv("HOME")` in R
* To determine your home directory, run `Sys.getenv("HOME")` in R

The following three lines must be included in the `.netrc` or `_netrc` file either separated by white space (spaces, tabs, or newlines) or commas. Multiple such blocks can exist in one file.

Expand All @@ -50,7 +50,7 @@ See [here](https://www.labkey.org/wiki/home/Documentation/page.view?name=netrc)

## Initiate a connection

We'll be looking at study `cvd256`. If you want to use a different study, change that string. The connections have state, so you can instantiate multiple connections to different studies simultaneously.
We'll be looking at study `cvd256`. If you want to use a different study, change that string. You can instantiate multiple connections to different studies simultaneously.

```{r connectDS}
library(DataSpaceR)
Expand All @@ -65,14 +65,14 @@ cvd256 <- con$getStudy("cvd256")
cvd256
```

`con$getStudy` creates a connection to the study `cvd256`. Printing the object shows where it's connected, to what study, and the available datasets.
`con$getStudy` creates a connection to the study `cvd256`. Printing the object shows where it's connected, to what study, and the available datasets.

```{r other-fields}
knitr::kable(cvd256$availableDatasets)
knitr::kable(cvd256$treatmentArm)
```

Available datasets and treatment arm information for the connection can be access by `availableDatasets` and `treatmentArm`.
Available datasets and treatment arm information for the connection can be accessed by `availableDatasets` and `treatmentArm`.


## Fetching datasets
Expand Down Expand Up @@ -107,22 +107,22 @@ See `?makeFilter` for more information on the syntax.

## Cross-study connection

To fetch data from multiple studies, simply create a connection at the project level.
To fetch data from multiple studies, create a connection at the project level.

```{r cross-connection}
cavd <- con$getStudy("")
```

This will instantiate a connection at the `CAVD` level. Most functions work cross study connections just like they do on single studies.

You can get a list of datasets available accross all studies.
You can get a list of datasets available across all studies.

```{r cross-connection-print}
cavd
knitr::kable(cavd$availableDatasets)
```

In cross-study connections, `getDataset` will combine the requested datasets. Note that in most cases the datasets will have too many subjects, making the filtering of the data a necessity. The `colFilter` argument can be used here, as described in the `getDataset` section.
In cross-study connections, `getDataset` will combine the requested datasets. Note that in most cases the datasets will have too many subjects for quick data transfer, making filtering of the data a necessity. The `colFilter` argument can be used here, as described in the `getDataset` section.

```{r cross-connection-dem}
conFilter <- makeFilter(c("species", "EQUAL", "Human"))
Expand All @@ -140,7 +140,7 @@ We can browse available saved groups via `availableGroups`.
knitr::kable(con$availableGroups)
```

To fetch data from a saved group, create a connection at the project level with a group ID. For example, we can connect to `mice` group which has group ID 208 by `getGroup`.
To fetch data from a saved group, create a connection at the project level with a group ID. For example, we can connect to `mice` group which has group ID 216 by `getGroup`.

```{r group-connection}
mice <- con$getGroup(216)
Expand Down