I'm excited to report that I've acquired yet another skill to add to my resume: Shiny.
If you haven't heard of this R extension, it's basically an amazing package that lets you turn your data into an interactive app. You can host your app as a webpage using RStudio's free server, or you can upload your package to Github, where anyone with Shiny installed in R can access it with a single line of code and an internet connection. Needless to say, I'm mega jazzed about the prospect of sharing my work interactively!
I started out with a quick practice run. I created a simple package that allows the user to adjust the mean tidal level of the Nisqually Delta and see how the resultant inundation curve changes accordingly.
If you want to check it out, all you have to do is install the Shiny package in RStudio and enter this line of code:
runGitHub("Dissertation_Chapter1", "davismj87", subdir="/Inundation/Inundation-app")
Unfortunately, I haven't gotten around to getting shinyapps.io to work yet. This is the server that lets you post your app as a webpage rather than having to run it directly out of R. A project for another day!
The tutorials I used are here:
https://shiny.rstudio.com/tutorial/
Thursday, October 5, 2017
Thursday, September 28, 2017
Gittin' after it...
Well, it's time. I've finally resolved to ride the new wave of science communication and up my online presence. I started out by updating my long-overlooked ResearchGate profile, and by learning a new skill:
Github!
For a few days, this mysterious jargon was the bane of my existence, and then finally on Tuesday it all clicked. The ultimate goal is to make publicly available the complete R code for each chapter of my dissertation with an accompanying readme document and Rmarkdown tutorial. If I had all the time and money in the world I would also write an R package for my marsh accretion model, but do I actually have weeks to blast my eyeballs out staring at DIY coding instructions? Only time will tell, folks.
For now, Github will have to do. There is the unfortunate caveat that I'm not allowed to share my raw data (since they belong to the Feds), so I'll have to post a fake dataset for each set of code. In any case, this should satisfy the new call for "data transparency" in the science community, and in many ways it will inspire me to hold myself accountable for the quality of my work. There's no cutting corners if anyone in a dark room can scrutinize your brainchild.
For practice purposes, I started with my Inundation model, which is probably the simplest possible example. Basically, the code takes water level data from a continuous data logger, and then calculates out the range of inundation durations from low tide to high tide. All you need is the raw data, mean tidal level (MTL) of the system, and logger sensor elevation.
The data follow a generalized logistic decay function like this:
Overall, model fit is pretty good, but it always overestimates the lower values.
In any case, I hope at least somebody takes a look. Because what's the point of having a Github if nobody is there to admire your code?
Github!
For a few days, this mysterious jargon was the bane of my existence, and then finally on Tuesday it all clicked. The ultimate goal is to make publicly available the complete R code for each chapter of my dissertation with an accompanying readme document and Rmarkdown tutorial. If I had all the time and money in the world I would also write an R package for my marsh accretion model, but do I actually have weeks to blast my eyeballs out staring at DIY coding instructions? Only time will tell, folks.
For now, Github will have to do. There is the unfortunate caveat that I'm not allowed to share my raw data (since they belong to the Feds), so I'll have to post a fake dataset for each set of code. In any case, this should satisfy the new call for "data transparency" in the science community, and in many ways it will inspire me to hold myself accountable for the quality of my work. There's no cutting corners if anyone in a dark room can scrutinize your brainchild.
For practice purposes, I started with my Inundation model, which is probably the simplest possible example. Basically, the code takes water level data from a continuous data logger, and then calculates out the range of inundation durations from low tide to high tide. All you need is the raw data, mean tidal level (MTL) of the system, and logger sensor elevation.
The data follow a generalized logistic decay function like this:
Overall, model fit is pretty good, but it always overestimates the lower values.
In any case, I hope at least somebody takes a look. Because what's the point of having a Github if nobody is there to admire your code?
Monday, February 6, 2017
DLM under a blanket
It's a snow day on campus, which means a hot cup of coffee at home next to the fire...
Just kidding. I'm here at the office, using the surrounding tranquility as inspiration for a high-productivity work day. I figured this would be a good opportunity to write an initial blog post, especially given that my current analyses are primarily homework-based and sporadic in character. The current assignment is to use a dynamic linear model to analyze salmon stock recruitment data. If you're at all interested in state-space autoregressive modeling (tantalizing), you can find the primer here. If all goes to plan, I'll be posting some blog entries soon about how I'm using ARIMA models to analyze the USFWS mid-winter waterfowl survey data. Until then, I guess you'll have to settle for a brief explanation for why I'm starting a blog in the first place.
Over the past three years I've seen first hand how a breakdown in communication can cause major setbacks to management, project implementation, and policy. As scientists, we're taught to abstain from advocacy, but that doesn't mean we shouldn't engage with our audience. It's easy to share our work with other scientists as peer-reviewed journal articles and conference presentations. Unfortunately, the people who matter when it comes to project implementation - the taxpayers, policymakers, voters, journalists, community leaders - can't log onto Google Scholar and look up the latest issue of Ecological Applications. Even if they could, how might we expect them to interpret our analyses? It takes years of proper scientific training to absorb the life blood of ecology into our veins. Often, as scientists, we are over critical of those who don't understand our work, but only 40% of Americans have finished an associate's degree or above. The truth is, people aren't shying away from science, scientists are just out of touch with the everyday citizen.
I'm using this blog as an opportunity to practice sharing my research with the world in a way that's accessible, without sacrificing the scientific integrity of my dissertation. Most of my work is focused on salt marsh restoration in the Pacific Northwest, a topic that has gained momentum over the last few decades as agencies work to remove dams, dikes, levees, and shoreline armoring to improve the health of coastal habitats. The Nisqually Delta Restoration (shameless cover photo of yours truly) is the largest restoration project in Puget Sound to-date. My dissertation uses seven years of post-restoration datasets at this site, along with monitoring data from several other restored estuaries, to assess how effective coastal restoration is, and whether or not these ecosystems will be able to withstand climate change. I'm hoping to blend my research findings in with general commentary about how new techniques are being integrated into restoration science. Hopefully this keeps things on-topic without getting monotonous.
In any case, it's back to the grind! Here's to a productive and beautiful snow day!
| Another brutal dusting of snow for the 2016-2017 Seattle winter season. |
Just kidding. I'm here at the office, using the surrounding tranquility as inspiration for a high-productivity work day. I figured this would be a good opportunity to write an initial blog post, especially given that my current analyses are primarily homework-based and sporadic in character. The current assignment is to use a dynamic linear model to analyze salmon stock recruitment data. If you're at all interested in state-space autoregressive modeling (tantalizing), you can find the primer here. If all goes to plan, I'll be posting some blog entries soon about how I'm using ARIMA models to analyze the USFWS mid-winter waterfowl survey data. Until then, I guess you'll have to settle for a brief explanation for why I'm starting a blog in the first place.
Over the past three years I've seen first hand how a breakdown in communication can cause major setbacks to management, project implementation, and policy. As scientists, we're taught to abstain from advocacy, but that doesn't mean we shouldn't engage with our audience. It's easy to share our work with other scientists as peer-reviewed journal articles and conference presentations. Unfortunately, the people who matter when it comes to project implementation - the taxpayers, policymakers, voters, journalists, community leaders - can't log onto Google Scholar and look up the latest issue of Ecological Applications. Even if they could, how might we expect them to interpret our analyses? It takes years of proper scientific training to absorb the life blood of ecology into our veins. Often, as scientists, we are over critical of those who don't understand our work, but only 40% of Americans have finished an associate's degree or above. The truth is, people aren't shying away from science, scientists are just out of touch with the everyday citizen.
I'm using this blog as an opportunity to practice sharing my research with the world in a way that's accessible, without sacrificing the scientific integrity of my dissertation. Most of my work is focused on salt marsh restoration in the Pacific Northwest, a topic that has gained momentum over the last few decades as agencies work to remove dams, dikes, levees, and shoreline armoring to improve the health of coastal habitats. The Nisqually Delta Restoration (shameless cover photo of yours truly) is the largest restoration project in Puget Sound to-date. My dissertation uses seven years of post-restoration datasets at this site, along with monitoring data from several other restored estuaries, to assess how effective coastal restoration is, and whether or not these ecosystems will be able to withstand climate change. I'm hoping to blend my research findings in with general commentary about how new techniques are being integrated into restoration science. Hopefully this keeps things on-topic without getting monotonous.
In any case, it's back to the grind! Here's to a productive and beautiful snow day!
Subscribe to:
Posts (Atom)
