cacommunityburden's People
Forkers
aculich sharygin salbruin08 capeunit mbaath christopherelee benjamin-hicks-cdph-ca-gov jonahgolden nitdip cdphrusers kangjaspreetcacommunityburden's Issues
IHME API and VIZ
just getting started
Clean installPackages file
(NOT) fatal error
I get this message below each time I do a push, BUT the push does work. I googled a bit, and there is so much info on this error message that I could not sort it out. likely eaisiest to look at it when we next meet?
fatal: HttpRequestException encountered.
An error occurred while sending the request.
To https://github.com/mcSamuelDataSci/CACommunityBurden.git
e219689..80060c8 master -> master
Issue for testing
one more test
to test or not to test, that is the question
Life Tables
remove islands from maps
Zev-
I have tried a number of things to remove ALL the islands from the "shape files" I am working with, and nothing has worked, including the ms_filter_islands() function that I thought surely would. In this demo file, I use ms_filter_islands--few changes to San Francisco, no changes to Los Angeles. Please show me what I am doing wrong or provide another solution? Thanks.
Added RStudio Wiki instructions
I just poked around, and made a "wiki" entry to use as instructions for our team to get set up for using git with RStudio. Please review and comment if you have time/interest. Thanks.
map overlays
Explore directly labeling lines with ggrepel
library(ggrepel)
NOT like this, but....:
ggplot(mtcars, aes(wt, mpg, label = rownames(mtcars))) +
geom_text_repel() +
geom_point(color = 'red') +
theme_classic(base_size = 16)
OSHPD
Save User ID and Password
map projection
Version History
Still looking into how to rollback on an individual file but from what I can tell it's not easy to do in GitHub or R alone. It is easy to do on GitHub desktop and some users have made a strong case for using it. I've asked Jason Vargo if he knows more and he said he can help me Wednesday 08/08/18, so I'll add my R testing in a later post.
Tested on GitHub online
- Select the file desired file. Select history. Select the commit you're interested to reverting to.
- Select browse files. From here only 1/3 options I explored worked. Clone or download then manual re-upload over the desired repository is the method which worked. I tried generating a pull request from the historic repository but I received a message saying all changes have already been committed. I also tried editing a file directly then updating but the edit option is disabled for historic repositories.
seeking efficient approach to group_by age adjustment work
Zev (and Nate)-
The first coding approach below works just fine, and the dataframe "countyAA" has exactly what I need. That is: for all county, year, sex, and CAUSE combinations I get the age-adjusted death rate, and associated upper and lower CI, and SE. The only thing I am not grouping by is ageGroup, and this is what drives the whole thing.
BUT, it is clearly inefficient to run the adeadjust.direct function (part of the "epitools" package; modified by me to ageadjust.direct.SAM (to include the SE, and deal with some 0's)) four times. I did this a while ago when I really needed to just get this done, but now am trying to figure out how to do it more efficiently, and have not been successful so far despite a fair bit of effort.
The second approach below partially works, but puts the results in one column in one character string representation of a vector of results--see picture below (the ones with "NAs" are filtered out elsewhere, they have 0 deaths). I could do something to parse out this string, but I bet there is a simpler better way?
Any suggestions would be most appreciated?
countyAA <- ageCounty %>% group_by(county,year,sex,CAUSE) %>%
summarize(
aRate = ageadjust.direct.SAM(count=Ndeaths, pop=pop, rate = NULL, stdpop=US2000POP, conf.level = 0.95)[2]*100000,
aLCI = ageadjust.direct.SAM(count=Ndeaths, pop=pop, rate = NULL, stdpop=US2000POP, conf.level = 0.95)[3]*100000,
aUCI = ageadjust.direct.SAM(count=Ndeaths, pop=pop, rate = NULL, stdpop=US2000POP, conf.level = 0.95)[4]*100000,
aSE = ageadjust.direct.SAM(count=Ndeaths, pop=pop, rate = NULL, stdpop=US2000POP, conf.level = 0.95)[5]*100000
)
countyAAtry2 <- ageCounty %>% group_by(county,year,sex,CAUSE) %>%
summarize(aMulti = list(unique(
round(
ageadjust.direct.SAM(count=Ndeaths, pop=pop, rate = NULL, stdpop=US2000POP, conf.level = 0.95)*100000,2)
)
)
)
Images
test issue
testing with Ben
Add install R, R studio, and packages to wiki
tmap general
Zev-
At your suggestion I have begun migrating the mapping for this project to tmap. In the app, there is currently a "tmap" tab, a "static map" tab, and an "interactive map" tab. Within two weeks I plan to have only the "tmap" tab (and i will be called just "Map" or something), with all of the functionality that is all three tabs currently. At your request, I will start listing issues that are as specific as I can to help with this migration, and for now will be referring to all three of the tabs.
Thanks,
Michael
search files
determine how to search files (including sub-directories) including R files for specific string
using sf in tmap
I have migrated all the mapping in the CCB to tmap, and that’s great. I was planning to migrate the “shape files” to “simple features”, but, as far as I can tell, tmap does not support this, with error message “conversion from feature type sfc_GEOMETRY to sp is not supported”. I have done a bit of experimenting as you can see in lines 58-74 of this file where the shapes are brought into the app. No error generated with tmap when I read in the (simple features shape files) with readOGR, but error with reading the same files in with st_read.
Specific questions:
- Do you think I should use the “shape files” as simple features objects?
- If so, how with tmap?
two conditionalPanel input lists with same inputID
Zev-
How can I do something in the .ui file with conditionalPanel such that the input list varies depending on the condition BUT where the inputID stays the same? For example with issue #32, how could I have "selectInput" "choices" of c("A","B","California","D") for one condition and c("A","B","D") for another condition, BUT where the inputID is myLHJ for both conditions?
try out referencing
how to add stop() function to .ui or other proper location
Zev-
What is the proper way to add, and where should I put, something like this?:
if (input$cZoom & input$myLHJ == "CALIFORNIA STATE" ) stop('Illogical Selection')
I have some similar statements (without the input$) WITHIN some functions, and that works fine, but there are some combinations of input values, like those above, that apply to several function/tabs, so would be more efficient to put in one place, rather than in each function.
Could alternatively be accomplished with next issue?
tmap tm_polygons style error
If on the "Map (tmap)" tab the following are selected:
geographic level: "Census Tract"
Cut-point method: fisher
an error is generated because of missing values, noting that na.rm=TRUE is needed.
Where/how can I set na.rm=TRUE or otherwise systematically address this error? (and not with an is.na(map.1$myMeasure) <- 0 type solution since this creates problems elsewhere).
The key code is at lines 72-75 of the cbd-tmap.R file.
sex by condition plot
Ben-
If you have time to fix this chart that would be great. Call me to discuss if you'd like.
Thanks, Michael
https://github.com/mcSamuelDataSci/CACommunityBurden/blob/master/myCBD/myFunctions/rankCausesSex.R
SDOH select community
branching/forking wiki page
Contributors can't add new wiki pages (only edit current pages), but I think the following wiki page (with your preferred edits) would be helpful regarding branching and forking:
In keeping with standard GITHUB practice, CCB has adopted two procedures to contribute to the projects modular code.
-
For contributors making changes to one file of the CCB, or contributors who plan to have limited edits applied in a limited amount of time, or contributors working in a collaborative sub-team to edit 1-2 files, forking of the CACommunityBurden repository is suggested. This is primarily to capture the final product in version control. To proceed:
a. The contributor will make a github account.
b. From the CCB repository page (https://github.com/mcSamuelDataSci/CACommunityBurden), the contributor will Fork the Repository by selecting the Fork option in the top right corner. After the repository is generated, the contributor will rename the forked repository with their initials (eg. CACommunityBurden-MI) by selecting the Settings tab under the repository names.
c. The contributor can now edit the desired file in their forked copy of the repository. For general steps to set-up the repository in R see here. Contributors will map to the forked repository url instead of the CCB repository (https://github.com/mcSamuelDataSci/CACommunityBurden). When making edits, contributors will stay on the master branch.
d. Pull requests can be made and merged in the master branch of the forked repository as necessary.
e. When all edits are done to the desired 1-2 files, the contributing repository owner will use the "New pull request" button found on the Code tab. The defualt compare changes menu should display the the main repository and the forked repository. Create a pull request to merge repositories on github
f. The main repository owner (Michael Samuel) will review the suggested changes in R by mapping directly to the contributors URL.
g. If the changes are accepted, the repository owner will accept the changes on the Github website and the forked repository will need to be deleted by the contributor. -
For contributors making changes to more than one file of the CCB, or contributors who plan to have on-going edits applied in an extended amount of time, or contributors working in a collaborative sub-team to edit 3+ files, branching of the CACommunity repository is suggested. This is primarily to capture the on-going editing process in version control. To proceed:
a. Request to be added as a collaborator. A branch will be created by the main repository owner (Michael Samuel).
b. The contributor can now edit the desired file in their branched copy of the repository. For general steps to set-up the repository in R see here.
c. When edits are done to the desired file, the branch owner will use the "New pull request" botton found on the Code tab. Alternatively a pull request can be created in R.
d. The main repository owner (Michael Samuel) will review the suggested changes in R by reviewing the contributors branch.
e. If the changes are accepted, the repository owner will accept the changes and assess if the branch needs to be deleted.
If a branch/fork stays open for an extended amount of time, it is up to the contributor to update their branch/fork with the most recent CCB repository files by creating a pull request from the main CCB repository to the branch/fork.
SES processor and plot
-decide on beta SES inputs
-break makeSES into standard structure -- SESprocessor and plot files
Rank Condition Tab Enhancement
add labels to vertical SMR lines
SDOH system update
Repo needs readme
This is for your practice, I'm adding this issue, I'm creating a branch and adding this file, I'm assigning this issue to me here in GitHub and then I will do a pull request.
In my commit message I write "added readme referencing #6" so it shows up below.
indexing to extract names
Zev-
Is there a more "elegant" or transparent (for other users of my code) way to do the code below, in one case using two vectors, in the other using two columns of a dataframe?
nameVector[valueVector == myValue]
dataFrame[dataFrame[,1]== myValue,2]
method to set path
I expect for a lot of users the default path is not the R working directory – i.e. what is getwd() without setwd()?
Currently the user has to set myDrive to the project folder in multiple files. An external local file like .path would be robust to cases where people’s starting directory is a different folder. Another option would be to have an options file like config.txt that would contain all the necessary user-specified options including this path for all scripts.
Add help system to CCB
https://shiny.rstudio.com/reference/shiny/latest/modalDialog.html
https://shiny.rstudio.com/reference/shiny/latest/modalButton.html
https://deanattali.com/blog/shinyalert-package/
https://cran.r-project.org/web/packages/shinyalert/README.html
https://cran.r-project.org/web/packages/shinyalert/shinyalert.pdf
https://stackoverflow.com/questions/36670065/tooltip-in-shiny-ui-for-help-text
test
- hi
- ho
A door installation and run packages too instructions
For starting app without real data change in two places
@nteetor FYI when you try to run the repo the real app is in myCBD and you need to change from "real" to "fake" in two places because there is data he can't share.
https://github.com/mcSamuelDataSci/CACommunityBurden/blob/master/myCBD/Global.R#L16
and if you're doing anything with data:
https://github.com/mcSamuelDataSci/CACommunityBurden/blob/master/myUpstream/makeDatasets.R#L22
determine best format for SDOH indicator table -- what/how if on GitHub; what/how if elsewhere?
Census tract merge issue
Dave-
for consistency:
- the county "column" should be named "county", all lower case
- GEOID should be all upper cases, as you have it
- the "indicator" variable should use the format as I show on line 30 of the R file, or some other consitent form of your choosing
- the other variables/columns don't need to be renamed at all, since they are not used elsewhere in the CCB
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.