Skip to content

Commit

Permalink
Merge pull request #164 from ldecicco-USGS/master
Browse files Browse the repository at this point in the history
instruction updates
  • Loading branch information
ldecicco-USGS authored Oct 5, 2016
2 parents a8a4acb + 1d6913b commit 7c1b63e
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 4 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: toxEval
Type: Package
Title: ToxCast Evaluations
Version: 0.2.0
Date: 2016-02-10
Version: 0.2.1
Date: 2016-10-05
Authors@R: c( person("Steven", "Corsi", role = c("aut"),
email = "srcorsi@usgs.gov"),
person("Laura", "DeCicco", role = c("aut","cre"),
Expand Down
4 changes: 3 additions & 1 deletion R/chemSumm.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,16 @@ chemSummBasic <- function(wData, pCodeInfoDF,endPoint,
casrn_pCode="casrn",class_pCode="class",code_pCode="parameter_cd",
casrn_ep="casn"){

endPoint <- select(endPoint, -Units, -mlWt, -conversion)

chemicalSummary <- wData %>%
gather_("pCode", "measuredValue", gather_cols=names(wData)[!(names(wData) %in% c(date,station))]) %>%
rename_("date"=date) %>%
filter(!is.na(measuredValue)) %>%
separate(pCode, into=c("colHeader","pCode"), "_") %>% #totally not generalized
left_join(pCodeInfoDF[c(code_pCode,casrn_pCode,class_pCode)], by=c("pCode"=code_pCode)) %>%
select(-colHeader, -pCode) %>%
right_join(endPoint, by=c(casrn=casrn_ep)) %>%
select(-mlWt, -conversion, -Units, -pCode, -colHeader) %>%
gather(endPoint, endPointValue, -class, -site, -measuredValue, -chnm, -date, -casrn) %>%
filter(!is.na(endPointValue)) %>%
mutate(EAR=measuredValue/endPointValue) %>%
Expand Down
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,64 @@

Initial code for studying ToxCast data in relation to measured concentrations.

## Installation of R and RStudio

This section should only need to be done once per computer.

The following link walks you through an installation of R and RStudio:

[Installation Instructions](https://owi.usgs.gov/R/training-curriculum/intro-curriculum/Before/)

If you follow those instructions exactly, you should have the USGS R repository (GRAN) added to your R profile. If that step doesn't ring a bell, paste the following into your R console:

```r
rprofile_path = file.path(Sys.getenv("HOME"), ".Rprofile")
write('\noptions(repos=c(getOption(\'repos\'),
CRAN=\'https://cloud.r-project.org\',
USGS=\'https://owi.usgs.gov/R\'))\n',
rprofile_path,
append = TRUE)

cat('Your Rprofile has been updated to include GRAN.
Please restart R for changes to take effect.')
```

*RESTART RSTUDIO!*

Useful links:

* [Download R Windows](https://cran.r-project.org/bin/windows/base/)
* [Download R Mac](https://cran.r-project.org/bin/macosx/)
* [Download RStudio](https://www.rstudio.com/products/rstudio/download/)


## Installation of toxEval

This section should also only have to be done once. It assumes the USGS R repository (GRAN) was added to your R profile as described above.

```r
install.packages("toxEval")
```

Regularly, it is a good idea to update *ALL* your packages in R. If using RStudio, this is quite easy, there's an Update button in the "Packages" tab. This checks CRAN and GRAN for updates. It is a good idea to click this update regularly.

![update](images/update.png)

## Run toxEval

To run the toxEval app:

1. Open RStudio
2. In the Console (lower-left window of RStudio) paste the following:

```r
library(toxEval)
explore_endpoints()

```

## At-your-own-risk, highly developmental, probably buggy code installation instructions

To pull the upstream changes in from github in RStudio. In the Git tab, choose the More dropdown, and choose Shell. In that window, enter:

```
Expand Down
Binary file added images/update.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion inst/shiny/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ shinyServer(function(input, output,session) {
choices = c("All",duluthSites$shortName)
} else if(input$data == "NPS"){
npsSites <- readRDS(file.path(pathToApp,"npsSite.rds"))
choices = c("All",npsSites$shortName)
choices = c("All",npsSites$shortName)

} else if(input$data == "App State"){
leviSites <- readRDS(file.path(pathToApp,"leviSites.rds"))
choices = c("All",leviSites$shortName)
} else {
choices = c("All","2016 GLRI SP sites",summaryFile$site)
}
Expand Down

0 comments on commit 7c1b63e

Please sign in to comment.