59 |
60 | #### Peer code review
61 |
62 | All project will be reviewed by two student peer reviewers using the following
63 | [template](./code_review).
64 |
65 | ### Oral Presentation
66 |
67 | #### Project Pitch (early in the semester)
68 |
69 | A short presentation that may be accompanied by slides that covers your:
70 | * question
71 | * methods / data
72 | * proposed or preliminary results
73 | * interpretation
74 |
75 | #### Final Presenation (late in the semester)
76 |
77 | A 10 minute presentation accompanied by slides on your:
78 |
79 | * question
80 | * methods
81 | * results
82 | * interpretation
83 |
84 | The oral presentation should summarize the broader context within which your
85 | work falls by citing the peer-reviewed literature.
86 | It should be clear what your over-arching question is and what specific questions
87 | you have attempted to address
88 | Your data and statistical methods need to be adequately described.
89 | We do not need to know which R packages or what R code you used but we do need to
90 | know the names of the methods you used and how you examined your hypotheses.
91 | Some projects will not use data and thus that portion can be skipped in those
92 | contexts.
93 |
94 | ### Written Description
95 | At a minimum this should include:
96 |
97 | * Thesis statement (i.e., your question and predictions)
98 | * Methods
99 | * Results
100 | * Interpretation
101 |
102 | However those that wish to tackle an entire scientific paper are encouraged to
103 | do so and your instructor will give you comments on your entire document.
104 | The sections of the written description should be formatted and prepared in the
105 | style of a relevant scientific peer-reviewed journal in your field that you
106 | would like to submit the finished product to.
107 | Scientific literature should be cited in the methods and interpretation sections
108 | of the document.
109 |
110 | ### Links to student projects
111 | * Spring 2022
112 | - Public repos:
113 | - [Emphemeral Wetland Bird Biodiversity](https://github.com/jacksonbarrattheitmann/RclassProject)
114 | - [Microplastic and Algae Distribution in Coastal SC Stormwater Drainage Ponds](https://github.com/a-apint4/MP_Algae_Project)
115 | - [Indian River Lagoon - Community Ecosystem Function Project](https://github.com/Lexie-DelViscio/IRLCommunityEcosystemFunction)
116 | - [Using Hemolymph Chemistry to Predict and Assess Molting in Green Crabs, Carcinus maenas](https://github.com/emilydombrowski/green_crab_phys_2022)
117 | - [The effect of elevated salinity on survival of southern toad embryos](https://github.com/Regan-Honeycutt/Embryo-Survival)
118 | - [The ingestion of microplastics by young-of-the-year sharks in South Carolina estuaries](https://github.com/lattomusme/shark_plastics)
119 | - [Phenotypic and developmental effects of T-DNA inserts within auxin related genes on the development of A. thaliana](https://github.com/sydowpw/APA-Development-Project)
120 | - [The effects of Eastern mud snails on benthic microalgae community structures](https://github.com/Timara-Vereen/RClass-Project)
121 | - [Model abundance of 3 target species of deep-sea corals in the Pinnacles Trend Mesophotic Area](https://github.com/MorganWill13/Pinnacles_Trend)
122 | - [Dolphin Vocalization and Sighting Analyses](https://github.com/ctribss/Projectfiles)
123 | - Private repos:
124 | - [Resource partitioning among Caribbean sponges](https://github.com/huntjones88/summer_2021_pulse-chase_data)
125 |
126 |
127 | * Spring 2020
128 | - Public repos:
129 | - [Chara_Ecosystem_Dynamics](https://github.com/CassandraEvanchuk/Chara_Ecosystem_Dynamics.git)
130 | - [Exposureof Nanobubble Ozonation on Red Drum](https://github.com/radchenkoa5/Exposure-of-Nanobubble-Ozonation-on-Red-Drum)
131 | - [Sciaenops ocellatus feeding trial metabolomics](https://github.com/daveklett/David-Klett-Sciaenops-Ocellatus-Feeding-Trial-Metabolomics)
132 | - [Wood tracking Method](https://github.com/millertp1/Wood_Tracking_Method.git)
133 | - [Fertilization results of pairwise crosses of Staghorn coral](https://github.com/eeparsons42/cervicornis_analysis)
134 | - [The effect of headstarting on bite force in the diamondback terrapin](https://github.com/reisenfeldk/Thesis)
135 | - [Sea trout physiological relationship between myxospore density in the muscle tissue and swimming performance](https://github.com/dalyjm/SST-project/)
136 | - [Life history parameters and the interacting abiotic variables of the brief squid, Lolliguncula brevis](https://github.com/jtgood/Lbrevis.git)
137 | - [Herptafauna response to prescribe fire](https://github.com/mcglinnlab/fire_herps)
138 | - [Global shark and ray beta diversity](https://github.com/mosscr/Shark-Ray-Beta-Diversity)
139 | - [Analysis of Enterococcus in Charleston waterways](https://github.com/Vwilcox98/R-Project---CWK)
140 |
141 | * Spring 2019 (incomplete list)
142 | - Public repos:
143 | - [Food consumption patterns in the Philippines](https://github.com/jbalipal/PhFoodExpenditures)
144 | - Private repos:
145 | - [Analysis of Shark Distribution in Bulls Bay, South Carolina](https://github.com/strangebb/shark-dist-bullsbay)
146 |
147 |
148 | * Spring 2018
149 | - Public repos:
150 | - [Mapping relgion affiation](https://github.com/katiebalcewicz/quant-methods/tree/master/Project)
151 | - [NFL statistics](https://github.com/g-rock/nfl.git)
152 | - [Rshiny app for the measurement of biodiversity](https://github.com/caroliver/mobr.git)
153 | - [Black Coral habitat suitability model](https://github.com/prouxzs/BlackCoralMesoscaleHabitatSuitabilityModel.git)
154 | - [Fitting thermal performance curves](https://github.com/Wellingem/Metabolic_thermal_performance_curves.git)
155 | - [Analysis of Avian Conservation Center bird strikes](https://github.com/conradcd/ACC_Bird_Strikes)
156 | - [Multiple Paternity Analysis Program](https://github.com/sporrema/Multiple-Paternity-Analysis-Program)
157 | - [How much will people pay for eco-friendly flowers](https://github.com/rachelwiser/WiserThesisRCode)
158 | * Spring 2016
159 | - Public repos:
160 | - [Modeling disease outbreaks](https://github.com/TomNash/vaccine-project)
161 | - [Crab incubation](https://github.com/mackk1/Project)
162 | - [Congitive skill as a predictor of infarct volume](https://github.com/andersenme/infarct_volume_analysis)
163 | - [Spatial analysis of shots from NBA players](https://github.com/oshimamh/nbaProj)
164 | - [Salt intrusion in freshwater aquifiers](https://github.com/mikala-randich/fwsw_proj)
165 | - [Horse-shoe crab bleeding induced mortality](https://github.com/kristinlinesch/HSC_bleed)
166 | - [Shark morphometrics](https://github.com/Jordylacrosse/Shark-Morphometrics)
167 | - [Post-hurricane Hugo recovery of the Santee long-term fire experiment](https://github.com/smccau/santee_fire)
168 | - [Spatial and temporal trends in south Atlantic reef fish](https://github.com/walkermf/Reef_fish-)
169 | - [Contemporary patterns of refugee migration](https://github.com/sarahwie/refugee_migration_trends)
170 | - [Modeling DMSP across depths along a longitudinal transect](https://github.com/shoresk/Savannah-June-2015-DMSP-Predictors)
171 | * Spring 2015
172 | - Public repos:
173 | - [Spatial decomposition of community variance in forests](https://github.com/claydustin/tree_vario)
174 | - [Spatial cross validation methods](https://github.com/lesliedb/spatial_cv)
175 | - [Modeling influenza across the US](https://github.com/tswilkin/Influenza-Quant-Project)
176 | - Private repos:
177 | - [Response of roots to CO2 enrichment](https://github.com/Kvcross/Duke_FACE_Belowground)
178 | - [Response of rhizomorphs to CO2 and N2 enrichment](https://github.com/davidmhood/Rhizomorph_FACE)
179 | - [Coral community composition in response to substrate](https://github.com/MRittinghouse/ThesisProject)
180 | - [Modeling fish abundance and size](https://github.com/friedrichknuth/project)
181 |
182 |
183 |
--------------------------------------------------------------------------------
/projects/code_review.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: Code Review
4 | ---
5 |
6 | ## General Review Checklist
7 |
8 | ### Purpose
9 | * Is the purpose of the project is clear?
10 |
11 | * Is it clear what each file in the project is intended for?
12 |
13 | * It is clear how the various files interact?
14 |
15 | * Is it clear what the purpose if of specific sections of code?
16 |
17 | * How well commented is the code on a scale of 1(no comments) to 10(very well commented).
18 |
19 | * How can the purposes of the project and files be improved?
20 |
21 | ### Organization
22 |
23 | * Is the project organized such that you can intuit where the data,
24 | scripts, and output files are stored?
25 |
26 | * Approximately how much time did it take you to understand the work flow
27 | in the project?
28 |
29 | * How well defined are code chunks in the project?
30 |
31 | * How can organization be improved?
32 |
33 | ### Functionality
34 |
35 | * Does the code appear to advance the purpose of the project?
36 |
37 | * Do the existing components of the project appear to function?
38 |
39 | * How can the author improve functionality of code?
40 |
41 |
42 | ## Specific File Comments
43 | * README.md
44 | - (for example) Easy to understand, but consider adding a code licence...
45 |
46 |
--------------------------------------------------------------------------------
/projects/naming-slides.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmcglinn/quant_methods/747c05f4c60c0f441496293adacbfc3984af2b11/projects/naming-slides.pdf
--------------------------------------------------------------------------------
/public/R-Prog-Lang-Logo-sm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmcglinn/quant_methods/747c05f4c60c0f441496293adacbfc3984af2b11/public/R-Prog-Lang-Logo-sm.png
--------------------------------------------------------------------------------
/public/apple-touch-icon-144-precomposed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmcglinn/quant_methods/747c05f4c60c0f441496293adacbfc3984af2b11/public/apple-touch-icon-144-precomposed.png
--------------------------------------------------------------------------------
/public/cc-by-80x15.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmcglinn/quant_methods/747c05f4c60c0f441496293adacbfc3984af2b11/public/cc-by-80x15.png
--------------------------------------------------------------------------------
/public/css/hyde.css:
--------------------------------------------------------------------------------
1 | /*
2 | * __ __
3 | * /\ \ /\ \
4 | * \ \ \___ __ __ \_\ \ __
5 | * \ \ _ `\/\ \/\ \ /'_` \ /'__`\
6 | * \ \ \ \ \ \ \_\ \/\ \_\ \/\ __/
7 | * \ \_\ \_\/`____ \ \___,_\ \____\
8 | * \/_/\/_/`/___/> \/__,_ /\/____/
9 | * /\___/
10 | * \/__/
11 | *
12 | * Designed, built, and released under MIT license by @mdo. Learn more at
13 | * https://github.com/poole/hyde.
14 | */
15 |
16 |
17 | /*
18 | * Contents
19 | *
20 | * Global resets
21 | * Sidebar
22 | * Container
23 | * Reverse layout
24 | * Themes
25 | */
26 |
27 |
28 | /*
29 | * Global resets
30 | *
31 | * Update the foundational and global aspects of the page.
32 | */
33 |
34 | html {
35 | font-family: "PT Sans", Helvetica, Arial, sans-serif;
36 | }
37 | @media (min-width: 48em) {
38 | html {
39 | font-size: 16px;
40 | }
41 | }
42 | @media (min-width: 58em) {
43 | html {
44 | font-size: 20px;
45 | }
46 | }
47 |
48 |
49 | /*
50 | * Sidebar
51 | *
52 | * Flexible banner for housing site name, intro, and "footer" content. Starts
53 | * out above content in mobile and later moves to the side with wider viewports.
54 | */
55 |
56 | .sidebar {
57 | text-align: center;
58 | padding: 2rem 1rem;
59 | color: rgba(255,255,255,.5);
60 | background-color: #202020;
61 | }
62 | @media (min-width: 48em) {
63 | .sidebar {
64 | position: fixed;
65 | top: 0;
66 | left: 0;
67 | bottom: 0;
68 | width: 18rem;
69 | text-align: left;
70 | }
71 | }
72 |
73 | /* Sidebar links */
74 | .sidebar a {
75 | color: #fff;
76 | }
77 |
78 | /* About section */
79 | .sidebar-about h1 {
80 | color: #fff;
81 | margin-top: 0;
82 | font-family: "Abril Fatface", serif;
83 | font-size: 2.25rem;
84 | }
85 |
86 | /* Sidebar nav */
87 | .sidebar-nav {
88 | margin-bottom: 1rem;
89 | }
90 | .sidebar-nav-item {
91 | display: block;
92 | }
93 | a.sidebar-nav-item:hover,
94 | a.sidebar-nav-item:focus {
95 | text-decoration: underline;
96 | }
97 | .sidebar-nav-item.active {
98 | font-weight: bold;
99 | }
100 |
101 | /* Sticky sidebar
102 | *
103 | * Add the `sidebar-sticky` class to the sidebar's container to affix it the
104 | * contents to the bottom of the sidebar in tablets and up.
105 | */
106 |
107 | @media (min-width: 48em) {
108 | .sidebar-sticky {
109 | position: absolute;
110 | right: 1rem;
111 | bottom: 1rem;
112 | left: 1rem;
113 | }
114 | }
115 |
116 |
117 | /* Container
118 | *
119 | * Align the contents of the site above the proper threshold with some margin-fu
120 | * with a 25%-wide `.sidebar`.
121 | */
122 |
123 | .content {
124 | padding-top: 4rem;
125 | padding-bottom: 4rem;
126 | }
127 |
128 | @media (min-width: 48em) {
129 | .content {
130 | max-width: 38rem;
131 | margin-left: 20rem;
132 | margin-right: 2rem;
133 | }
134 | }
135 |
136 | @media (min-width: 64em) {
137 | .content {
138 | margin-left: 22rem;
139 | margin-right: 4rem;
140 | }
141 | }
142 |
143 |
144 | /*
145 | * Reverse layout
146 | *
147 | * Flip the orientation of the page by placing the `.sidebar` on the right.
148 | */
149 |
150 | @media (min-width: 48em) {
151 | .layout-reverse .sidebar {
152 | left: auto;
153 | right: 0;
154 | }
155 | .layout-reverse .content {
156 | margin-left: 2rem;
157 | margin-right: 20rem;
158 | }
159 | }
160 |
161 | @media (min-width: 64em) {
162 | .layout-reverse .content {
163 | margin-left: 4rem;
164 | margin-right: 22rem;
165 | }
166 | }
167 |
168 |
169 |
170 | /*
171 | * Themes
172 | *
173 | * As of v1.1, Hyde includes optional themes to color the sidebar and links
174 | * within blog posts. To use, add the class of your choosing to the `body`.
175 | */
176 |
177 | /* Base16 (http://chriskempson.github.io/base16/#default) */
178 |
179 | /* Red */
180 | .theme-base-08 .sidebar {
181 | background-color: #ac4142;
182 | }
183 | .theme-base-08 .content a,
184 | .theme-base-08 .related-posts li a:hover {
185 | color: #ac4142;
186 | }
187 |
188 | /* Orange */
189 | .theme-base-09 .sidebar {
190 | background-color: #d28445;
191 | }
192 | .theme-base-09 .content a,
193 | .theme-base-09 .related-posts li a:hover {
194 | color: #d28445;
195 | }
196 |
197 | /* Yellow */
198 | .theme-base-0a .sidebar {
199 | background-color: #f4bf75;
200 | }
201 | .theme-base-0a .content a,
202 | .theme-base-0a .related-posts li a:hover {
203 | color: #f4bf75;
204 | }
205 |
206 | /* Green */
207 | .theme-base-0b .sidebar {
208 | background-color: #90a959;
209 | }
210 | .theme-base-0b .content a,
211 | .theme-base-0b .related-posts li a:hover {
212 | color: #90a959;
213 | }
214 |
215 | /* Cyan */
216 | .theme-base-0c .sidebar {
217 | background-color: #75b5aa;
218 | }
219 | .theme-base-0c .content a,
220 | .theme-base-0c .related-posts li a:hover {
221 | color: #75b5aa;
222 | }
223 |
224 | /* Blue */
225 | .theme-base-0d .sidebar {
226 | background-color: #6a9fb5;
227 | }
228 | .theme-base-0d .content a,
229 | .theme-base-0d .related-posts li a:hover {
230 | color: #6a9fb5;
231 | }
232 |
233 | /* Magenta */
234 | .theme-base-0e .sidebar {
235 | background-color: #aa759f;
236 | }
237 | .theme-base-0e .content a,
238 | .theme-base-0e .related-posts li a:hover {
239 | color: #aa759f;
240 | }
241 |
242 | /* Brown */
243 | .theme-base-0f .sidebar {
244 | background-color: #8f5536;
245 | }
246 | .theme-base-0f .content a,
247 | .theme-base-0f .related-posts li a:hover {
248 | color: #8f5536;
249 | }
250 |
--------------------------------------------------------------------------------
/public/css/poole.css:
--------------------------------------------------------------------------------
1 | /*
2 | * ___
3 | * /\_ \
4 | * _____ ___ ___\//\ \ __
5 | * /\ '__`\ / __`\ / __`\\ \ \ /'__`\
6 | * \ \ \_\ \/\ \_\ \/\ \_\ \\_\ \_/\ __/
7 | * \ \ ,__/\ \____/\ \____//\____\ \____\
8 | * \ \ \/ \/___/ \/___/ \/____/\/____/
9 | * \ \_\
10 | * \/_/
11 | *
12 | * Designed, built, and released under MIT license by @mdo. Learn more at
13 | * https://github.com/poole/poole.
14 | */
15 |
16 |
17 | /*
18 | * Contents
19 | *
20 | * Body resets
21 | * Custom type
22 | * Messages
23 | * Container
24 | * Masthead
25 | * Posts and pages
26 | * Pagination
27 | * Reverse layout
28 | * Themes
29 | */
30 |
31 |
32 | /*
33 | * Body resets
34 | *
35 | * Update the foundational and global aspects of the page.
36 | */
37 |
38 | * {
39 | -webkit-box-sizing: border-box;
40 | -moz-box-sizing: border-box;
41 | box-sizing: border-box;
42 | }
43 |
44 | html,
45 | body {
46 | margin: 0;
47 | padding: 0;
48 | }
49 |
50 | html {
51 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
52 | font-size: 16px;
53 | line-height: 1.5;
54 | }
55 | @media (min-width: 38em) {
56 | html {
57 | font-size: 20px;
58 | }
59 | }
60 |
61 | body {
62 | color: #515151;
63 | background-color: #fff;
64 | -webkit-text-size-adjust: 100%;
65 | -ms-text-size-adjust: 100%;
66 | }
67 |
68 | /* No `:visited` state is required by default (browsers will use `a`) */
69 | a {
70 | color: #268bd2;
71 | text-decoration: none;
72 | }
73 | a strong {
74 | color: inherit;
75 | }
76 | /* `:focus` is linked to `:hover` for basic accessibility */
77 | a:hover,
78 | a:focus {
79 | text-decoration: underline;
80 | }
81 |
82 | /* Headings */
83 | h1, h2, h3, h4, h5, h6 {
84 | margin-bottom: .5rem;
85 | font-weight: bold;
86 | line-height: 1.25;
87 | color: #313131;
88 | text-rendering: optimizeLegibility;
89 | }
90 | h1 {
91 | font-size: 2rem;
92 | }
93 | h2 {
94 | margin-top: 1rem;
95 | font-size: 1.5rem;
96 | }
97 | h3 {
98 | margin-top: 1.5rem;
99 | font-size: 1.25rem;
100 | }
101 | h4, h5, h6 {
102 | margin-top: 1rem;
103 | font-size: 1rem;
104 | }
105 |
106 | /* Body text */
107 | p {
108 | margin-top: 0;
109 | margin-bottom: 1rem;
110 | }
111 |
112 | strong {
113 | color: #303030;
114 | }
115 |
116 |
117 | /* Lists */
118 | ul, ol, dl {
119 | margin-top: 0;
120 | margin-bottom: 1rem;
121 | }
122 |
123 | dt {
124 | font-weight: bold;
125 | }
126 | dd {
127 | margin-bottom: .5rem;
128 | }
129 |
130 | /* Misc */
131 | hr {
132 | position: relative;
133 | margin: 1.5rem 0;
134 | border: 0;
135 | border-top: 1px solid #eee;
136 | border-bottom: 1px solid #fff;
137 | }
138 |
139 | abbr {
140 | font-size: 85%;
141 | font-weight: bold;
142 | color: #555;
143 | text-transform: uppercase;
144 | }
145 | abbr[title] {
146 | cursor: help;
147 | border-bottom: 1px dotted #e5e5e5;
148 | }
149 |
150 | /* Code */
151 | code,
152 | pre {
153 | font-family: Menlo, Monaco, "Courier New", monospace;
154 | }
155 | code {
156 | padding: .25em .5em;
157 | font-size: 85%;
158 | color: #bf616a;
159 | background-color: #f9f9f9;
160 | border-radius: 3px;
161 | }
162 | pre {
163 | display: block;
164 | margin-top: 0;
165 | margin-bottom: 1rem;
166 | padding: 1rem;
167 | font-size: .8rem;
168 | line-height: 1.4;
169 | white-space: pre;
170 | white-space: pre-wrap;
171 | word-break: break-all;
172 | word-wrap: break-word;
173 | background-color: #f9f9f9;
174 | }
175 | pre code {
176 | padding: 0;
177 | font-size: 100%;
178 | color: inherit;
179 | background-color: transparent;
180 | }
181 |
182 | /* Pygments via Jekyll */
183 | .highlight {
184 | margin-bottom: 1rem;
185 | border-radius: 4px;
186 | }
187 | .highlight pre {
188 | margin-bottom: 0;
189 | }
190 |
191 | /* Gist via GitHub Pages */
192 | .gist .gist-file {
193 | font-family: Menlo, Monaco, "Courier New", monospace !important;
194 | }
195 | .gist .markdown-body {
196 | padding: 15px;
197 | }
198 | .gist pre {
199 | padding: 0;
200 | background-color: transparent;
201 | }
202 | .gist .gist-file .gist-data {
203 | font-size: .8rem !important;
204 | line-height: 1.4;
205 | }
206 | .gist code {
207 | padding: 0;
208 | color: inherit;
209 | background-color: transparent;
210 | border-radius: 0;
211 | }
212 |
213 | /* Quotes */
214 | blockquote {
215 | padding: .5rem 1rem;
216 | margin: .8rem 0;
217 | color: #7a7a7a;
218 | border-left: .25rem solid #e5e5e5;
219 | }
220 | blockquote p:last-child {
221 | margin-bottom: 0;
222 | }
223 | @media (min-width: 30em) {
224 | blockquote {
225 | padding-right: 5rem;
226 | padding-left: 1.25rem;
227 | }
228 | }
229 |
230 | img {
231 | display: block;
232 | max-width: 100%;
233 | margin: 0 0 1rem;
234 | border-radius: 5px;
235 | }
236 |
237 | /* Tables */
238 | table {
239 | margin-bottom: 1rem;
240 | width: 100%;
241 | border: 1px solid #e5e5e5;
242 | border-collapse: collapse;
243 | }
244 | td,
245 | th {
246 | padding: .25rem .5rem;
247 | border: 1px solid #e5e5e5;
248 | }
249 | tbody tr:nth-child(odd) td,
250 | tbody tr:nth-child(odd) th {
251 | background-color: #f9f9f9;
252 | }
253 |
254 |
255 | /*
256 | * Custom type
257 | *
258 | * Extend paragraphs with `.lead` for larger introductory text.
259 | */
260 |
261 | .lead {
262 | font-size: 1.25rem;
263 | font-weight: 300;
264 | }
265 |
266 |
267 | /*
268 | * Messages
269 | *
270 | * Show alert messages to users. You may add it to single elements like a ``,
271 | * or to a parent if there are multiple elements to show.
272 | */
273 |
274 | .message {
275 | margin-bottom: 1rem;
276 | padding: 1rem;
277 | color: #717171;
278 | background-color: #f9f9f9;
279 | }
280 |
281 |
282 | /*
283 | * Container
284 | *
285 | * Center the page content.
286 | */
287 |
288 | .container {
289 | max-width: 38rem;
290 | padding-left: 1rem;
291 | padding-right: 1rem;
292 | margin-left: auto;
293 | margin-right: auto;
294 | }
295 |
296 |
297 | /*
298 | * Masthead
299 | *
300 | * Super small header above the content for site name and short description.
301 | */
302 |
303 | .masthead {
304 | padding-top: 1rem;
305 | padding-bottom: 1rem;
306 | margin-bottom: 3rem;
307 | }
308 | .masthead-title {
309 | margin-top: 0;
310 | margin-bottom: 0;
311 | color: #505050;
312 | }
313 | .masthead-title a {
314 | color: #505050;
315 | }
316 | .masthead-title small {
317 | font-size: 75%;
318 | font-weight: 400;
319 | color: #c0c0c0;
320 | letter-spacing: 0;
321 | }
322 |
323 |
324 | /*
325 | * Posts and pages
326 | *
327 | * Each post is wrapped in `.post` and is used on default and post layouts. Each
328 | * page is wrapped in `.page` and is only used on the page layout.
329 | */
330 |
331 | .page,
332 | .post {
333 | margin-bottom: 4em;
334 | }
335 |
336 | /* Blog post or page title */
337 | .page-title,
338 | .post-title,
339 | .post-title a {
340 | color: #303030;
341 | }
342 | .page-title,
343 | .post-title {
344 | margin-top: 0;
345 | }
346 |
347 | /* Meta data line below post title */
348 | .post-date {
349 | display: block;
350 | margin-top: -.5rem;
351 | margin-bottom: 1rem;
352 | color: #9a9a9a;
353 | }
354 |
355 | /* Related posts */
356 | .related {
357 | padding-top: 2rem;
358 | padding-bottom: 2rem;
359 | border-top: 1px solid #eee;
360 | }
361 | .related-posts {
362 | padding-left: 0;
363 | list-style: none;
364 | }
365 | .related-posts h3 {
366 | margin-top: 0;
367 | }
368 | .related-posts li small {
369 | font-size: 75%;
370 | color: #999;
371 | }
372 | .related-posts li a:hover {
373 | color: #268bd2;
374 | text-decoration: none;
375 | }
376 | .related-posts li a:hover small {
377 | color: inherit;
378 | }
379 |
380 |
381 | /*
382 | * Pagination
383 | *
384 | * Super lightweight (HTML-wise) blog pagination. `span`s are provide for when
385 | * there are no more previous or next posts to show.
386 | */
387 |
388 | .pagination {
389 | overflow: hidden; /* clearfix */
390 | margin-left: -1rem;
391 | margin-right: -1rem;
392 | font-family: "PT Sans", Helvetica, Arial, sans-serif;
393 | color: #ccc;
394 | text-align: center;
395 | }
396 |
397 | /* Pagination items can be `span`s or `a`s */
398 | .pagination-item {
399 | display: block;
400 | padding: 1rem;
401 | border: 1px solid #eee;
402 | }
403 | .pagination-item:first-child {
404 | margin-bottom: -1px;
405 | }
406 |
407 | /* Only provide a hover state for linked pagination items */
408 | a.pagination-item:hover {
409 | background-color: #f5f5f5;
410 | }
411 |
412 | @media (min-width: 30em) {
413 | .pagination {
414 | margin: 3rem 0;
415 | }
416 | .pagination-item {
417 | float: left;
418 | width: 50%;
419 | }
420 | .pagination-item:first-child {
421 | margin-bottom: 0;
422 | border-top-left-radius: 4px;
423 | border-bottom-left-radius: 4px;
424 | }
425 | .pagination-item:last-child {
426 | margin-left: -1px;
427 | border-top-right-radius: 4px;
428 | border-bottom-right-radius: 4px;
429 | }
430 | }
431 |
--------------------------------------------------------------------------------
/public/css/syntax.css:
--------------------------------------------------------------------------------
1 | .highlight .hll { background-color: #ffc; }
2 | .highlight .c { color: #999; } /* Comment */
3 | .highlight .err { color: #a00; background-color: #faa } /* Error */
4 | .highlight .k { color: #069; } /* Keyword */
5 | .highlight .o { color: #555 } /* Operator */
6 | .highlight .cm { color: #09f; font-style: italic } /* Comment.Multiline */
7 | .highlight .cp { color: #099 } /* Comment.Preproc */
8 | .highlight .c1 { color: #999; } /* Comment.Single */
9 | .highlight .cs { color: #999; } /* Comment.Special */
10 | .highlight .gd { background-color: #fcc; border: 1px solid #c00 } /* Generic.Deleted */
11 | .highlight .ge { font-style: italic } /* Generic.Emph */
12 | .highlight .gr { color: #f00 } /* Generic.Error */
13 | .highlight .gh { color: #030; } /* Generic.Heading */
14 | .highlight .gi { background-color: #cfc; border: 1px solid #0c0 } /* Generic.Inserted */
15 | .highlight .go { color: #aaa } /* Generic.Output */
16 | .highlight .gp { color: #009; } /* Generic.Prompt */
17 | .highlight .gs { } /* Generic.Strong */
18 | .highlight .gu { color: #030; } /* Generic.Subheading */
19 | .highlight .gt { color: #9c6 } /* Generic.Traceback */
20 | .highlight .kc { color: #069; } /* Keyword.Constant */
21 | .highlight .kd { color: #069; } /* Keyword.Declaration */
22 | .highlight .kn { color: #069; } /* Keyword.Namespace */
23 | .highlight .kp { color: #069 } /* Keyword.Pseudo */
24 | .highlight .kr { color: #069; } /* Keyword.Reserved */
25 | .highlight .kt { color: #078; } /* Keyword.Type */
26 | .highlight .m { color: #f60 } /* Literal.Number */
27 | .highlight .s { color: #d44950 } /* Literal.String */
28 | .highlight .na { color: #4f9fcf } /* Name.Attribute */
29 | .highlight .nb { color: #366 } /* Name.Builtin */
30 | .highlight .nc { color: #0a8; } /* Name.Class */
31 | .highlight .no { color: #360 } /* Name.Constant */
32 | .highlight .nd { color: #99f } /* Name.Decorator */
33 | .highlight .ni { color: #999; } /* Name.Entity */
34 | .highlight .ne { color: #c00; } /* Name.Exception */
35 | .highlight .nf { color: #c0f } /* Name.Function */
36 | .highlight .nl { color: #99f } /* Name.Label */
37 | .highlight .nn { color: #0cf; } /* Name.Namespace */
38 | .highlight .nt { color: #2f6f9f; } /* Name.Tag */
39 | .highlight .nv { color: #033 } /* Name.Variable */
40 | .highlight .ow { color: #000; } /* Operator.Word */
41 | .highlight .w { color: #bbb } /* Text.Whitespace */
42 | .highlight .mf { color: #f60 } /* Literal.Number.Float */
43 | .highlight .mh { color: #f60 } /* Literal.Number.Hex */
44 | .highlight .mi { color: #f60 } /* Literal.Number.Integer */
45 | .highlight .mo { color: #f60 } /* Literal.Number.Oct */
46 | .highlight .sb { color: #c30 } /* Literal.String.Backtick */
47 | .highlight .sc { color: #c30 } /* Literal.String.Char */
48 | .highlight .sd { color: #c30; font-style: italic } /* Literal.String.Doc */
49 | .highlight .s2 { color: #c30 } /* Literal.String.Double */
50 | .highlight .se { color: #c30; } /* Literal.String.Escape */
51 | .highlight .sh { color: #c30 } /* Literal.String.Heredoc */
52 | .highlight .si { color: #a00 } /* Literal.String.Interpol */
53 | .highlight .sx { color: #c30 } /* Literal.String.Other */
54 | .highlight .sr { color: #3aa } /* Literal.String.Regex */
55 | .highlight .s1 { color: #c30 } /* Literal.String.Single */
56 | .highlight .ss { color: #fc3 } /* Literal.String.Symbol */
57 | .highlight .bp { color: #366 } /* Name.Builtin.Pseudo */
58 | .highlight .vc { color: #033 } /* Name.Variable.Class */
59 | .highlight .vg { color: #033 } /* Name.Variable.Global */
60 | .highlight .vi { color: #033 } /* Name.Variable.Instance */
61 | .highlight .il { color: #f60 } /* Literal.Number.Integer.Long */
62 |
63 | .css .o,
64 | .css .o + .nt,
65 | .css .nt + .nt { color: #999; }
66 |
--------------------------------------------------------------------------------
/resources.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: Resources
4 | ---
5 |
6 | ## Best Practices
7 | * Software Carpentry.
8 |
9 | * Data Carpentry.
10 |
11 | * Why are your files and directories a mess?
12 |
13 | * How to name files
14 |
15 | * Getting your project files in order, Hao Ye's Notes on Data Organization in
16 | Spreadsheets and R.
17 |
18 | * Naming Things - by Jenny Bryan
19 |
20 | * Wilson, G. et al. 2014. Best Practices for Scientific Computing. PLoS Biol
21 | 12(1): e1001745. doi:10.1371/journal.pbio.1001745. URL:
22 |
23 | * White, E.P. et al. 2013. Nine simple ways to make it easier to (re)use your
24 | data. Ideas in Ecology and Evolution. 6(2): 1-10. URL:
25 |
26 | * Ram, K. 2013. Git can facilitate greater reproducibility and increased
27 | transparency in science. Source Code for Biology and Medicine. 8:7.
28 | doi:10.1186/1751-0473-8-7 URL:
29 |
30 | * A data science blog greared towards beginneers with a mixture of R and python
31 | content
32 |
33 | ## Statistics
34 | * Jack Weiss's courses on statistics for ecologists and environmental scientists
35 | - [Statistical Methods in Ecology](https://sakai.unc.edu/access/content/group/3d1eb92e-7848-4f55-90c3-7c72a54e7e43/public/index.html)
36 | - [Statistics for Environmental Science](https://sakai.unc.edu/access/content/group/2842013b-58f5-4453-aa8d-3e01bacbfc3d/public/Ecol562_Spring2012/index.html)
37 | * Code to accompany *A primer of ecological statistics* (Gotelli and Ellison 2012)
38 | -
39 | * Datasets to accompany *The R book* (Jones et al. 2022)
40 | -
41 | * Introduction to Data Exploration and Analysis with R by Michael Mahoney
42 | - free ebook
43 | - Basic statistics using R
44 | * Topics in R Statistical Language (Penn State Open Edu)
45 | - [Statistics in R - Part 1](https://online.stat.psu.edu/stat484/)
46 | - [Statistics in R - Part 2](https://online.stat.psu.edu/stat485/)
47 | * Jason Fridley's R based plant ecology course
48 | -
49 | * Patrick Breheny courses on statistics for biologists
50 | -
51 | * Linear Models with R (free ebook)
52 | -
53 | * Mixed Effects Models and Extensions in Ecology with R by Zurr et al. (free for cofc students)
54 | -
55 | * Anova
56 | -
57 | - Type I/II/III:
58 | -
59 | - Contrasts:
60 | -
61 | -
62 | * Ordination webpage
63 | - Amazing resource for multivariate approaches for analyzing community
64 | ecology data.
65 | -
66 | * Anscombe's quartet
67 | -
68 | * Dynamic Ecology blog posts by Brian McGill related to statistics and data.
69 | - [Why AIC appeals to ecologists lowests instincts](https://dynamicecology.wordpress.com/2015/05/21/why-aic-appeals-to-ecologists-lowest-instincts/)
70 | - [In praise of exporatory statistics](https://dynamicecology.wordpress.com/2013/10/16/in-praise-of-exploratory-statistics/)
71 | - Ecologists need to do a better job of prediction (4 part series)
72 | - [Part I – the insidious evils of ANOVA](https://dynamicecology.wordpress.com/2012/11/27/ecologists-need-to-do-a-better-job-of-prediction-part-i-the-insidious-evils-of-anova/)
73 | - [Part II - partly cloudy and a 20% chance of extinction (or the 6 P’s of good prediction](https://dynamicecology.wordpress.com/2013/01/09/ecologists-need-to-do-a-better-job-of-prediction-part-ii-mechanism-vs-pattern/)
74 | - [Part III - mechanistic or phenomenological?](https://dynamicecology.wordpress.com/2013/02/21/ecologists-need-to-do-a-better-job-of-prediction-part-iii-the-need-for-data/)
75 | - [Part IV - quantifying prediction quality](https://dynamicecology.wordpress.com/2013/03/19/ecologists-need-to-do-a-better-job-of-prediction-part-iv-quantifying-prediction-quality/)
76 | - [Ten commandments for good data management](https://dynamicecology.wordpress.com/2016/08/22/ten-commandments-for-good-data-management)
77 | - [Why ecology is hard (and fun) – multicausality](https://dynamicecology.wordpress.com/2016/03/02/why-ecology-is-hard-and-fun-multicausality)
78 |
79 | ## R Programming
80 |
81 | * Big Book of R: a collection of bookmarked R lessons and demos
82 | -
83 |
84 | ### Basics
85 | * Free manuals and tutorials provided by R users
86 | -
87 | * R programming style guide
88 | - by Whickham
89 | - [lintr](https://github.com/jimhester/lintr) for cleaning up R code
90 | - [formatR](https://yihui.name/formatr/)
91 | * Tryr by codeschool
92 | - Interactive online lesson for learning R basics
93 | -
94 | * A fairly comprehensive R reference card
95 | -
96 | * Programming with R by Software Carpentry
97 | - The software carpentry team have some of the best lessons for learning
98 | computational tools on the web.
99 | -
100 | * Five useful R functions for manipulating data
101 | -
102 |
103 | ### Advanced
104 | * Advanced R by Hadley Wickham:
105 | - One of the best references for taking your R to the next level
106 | -
107 |
108 | ### Graphics
109 | * Colors
110 | - [Color Palettes](https://www.nceas.ucsb.edu/~frazier/RSpatialGuides/colorPaletteCheatsheet.pdf)
111 |
112 | ## Git
113 | * Git and GitHub by Hadley Wickham
114 | - A very nice overview and step by step instructions for using git and
115 | integrating it with Rstudio.
116 | -
117 | * git - the simple guide
118 | -
119 | * Version Control by Software Carpentry
120 | -
121 | * Git reference card:
122 | -
123 | * Git quick reference for beginners
124 | -
125 | * Git flight rules - for when things go wrong
126 | -
127 |
128 |
--------------------------------------------------------------------------------
/scripts/collect_student_urls.R:
--------------------------------------------------------------------------------
1 | # clone repos from data frame
2 |
3 | stud <- read.csv('./data/Rclass_spring20.csv')
4 | stud$HW.url
5 | # drop last row
6 | stud <- stud[-nrow(stud), ]
7 |
8 | year = 2020
9 | student_path = paste0('./student_', year)
10 |
11 | for (i in seq_along(stud$HW.url)) {
12 | #dir.create(paste0(student_path, '/', stud$Username[i]))
13 | system(paste0('cd ', student_path, '; git clone ',
14 | stud$HW.url[i], ' ', stud$Username[i]),
15 | intern=TRUE)[1]
16 | }
17 |
18 | year = 2020
19 | student_path = paste0('./student_', year)
20 | students = dir(student_path)
21 | git_urls = list()
22 | for(i in seq_along(students)) {
23 | git_urls[i] = system(paste0('cd ', student_path, '/', students[i],
24 | ' ; git remote -v'), intern=TRUE)[1]
25 | }
26 |
27 | ## older code useful if you've already cloned all student repos
28 |
29 | git_urls = unlist(git_urls)
30 | git_urls = sub('origin\t', '', git_urls, fixed=T)
31 | git_urls = sub(' (fetch)', '', git_urls, fixed=T)
32 |
33 | git_handle = sub('https://github.com/','',git_urls)
34 | git_handle = sub('/.+', '', git_handle)
35 |
36 |
37 | write.csv(data.frame(git_urls, git_handle),
38 | file='./student_git_repos.csv', row.names=F)
39 |
--------------------------------------------------------------------------------
/scripts/download_fire_data.R:
--------------------------------------------------------------------------------
1 | # metadata url:
2 | # https://fsapps.nwcg.gov/afm/data/fireptdata/modisfire_2007_conus.htm
3 | # data from MODIS is from 2007 to 2020 but some years are missing(?)
4 |
5 | yrs <- c(2007, 2009, 2010, 2013:2021)
6 |
7 | for (i in seq_along(yrs)) {
8 | url <- paste0('https://fsapps.nwcg.gov/afm/data/fireptdata/modis_fire_', yrs[i],
9 | '_365_conus_shapefile.zip')
10 | folder <- paste0('./data/modis_fire/modis_fire_', yrs[i], '_365_conus')
11 | file <- paste0('modis_fire_', yrs[i], '_365_conus_shapefile.zip')
12 | dir.create(folder)
13 | download.file(url, paste(folder, file, sep ='/'))
14 | unzip(paste(folder, file, sep ='/'), exdir = folder)
15 | }
16 |
--------------------------------------------------------------------------------
/scripts/fibanacci_seq.R:
--------------------------------------------------------------------------------
1 |
2 | sum2c <- function(x) {
3 | return(c(x, x[length(x)] + x[length(x)-1]))
4 | }
5 |
6 | get_fib <- function(x, depth) {
7 | output <- x
8 | for(i in 1:depth)
9 | output <- sum2c(output)
10 | return(output)
11 | }
12 |
13 | get_ratios <- function(x) {
14 | return(x[-1] / x[-length(x)])
15 | }
16 |
17 | plot_fib <- function(x) {
18 | x <- rev(x)
19 | xlims <- c(0, x[1] + x[2])
20 | ylims <- c(0, x[1])
21 | plot(1, 1, type ='n', xlim = xlims, ylim = ylims)
22 | for (i in seq_along(x))
23 | polygon(c(0, x[i], x[i], 0),
24 | c(x[i], x[i], 0, 0), col=i)
25 | }
26 |
27 | plot_fib2 <- function(x) {
28 | x <- rev(x)
29 | xlims <- c(0, x[1] + x[2])
30 | ylims <- c(0, x[1])
31 | plot(1, 1, type ='n', xlim = xlims, ylim = ylims)
32 | for (i in seq_along(x)) {
33 | if (i == 1) {
34 | x_start <- 0 ; y_start <- 0
35 | x_end <- x[i] ; y_end <- x[i]
36 | polygon(c(x_end , x_start, x_start, x_end),
37 | c(y_start, y_start, y_end , y_end),
38 | col=i)
39 | } else {
40 |
41 | if (i %% 2 == 0) { # even
42 | x_start <- x_end ; y_start <- y_end
43 | x_end <- x_start + x[i] ; y_end <- y_start - x[i]
44 | polygon(c(x_start, x_end , x_end, x_start),
45 | c(y_start, y_start, y_end , y_end),
46 | col=i)
47 | } else {
48 | x_start <- x_end ; y_start <- y_end
49 | x_end <- x_end - x[i] ; y_end <- y_start - x[i]
50 | polygon(c(x_start, x_end, x_end, x_start), c(y_end, y_end, y_start, y_start),
51 | col=i)
52 | }
53 | }
54 | }
55 | }
56 |
57 |
58 | sum2c(0:1)
59 | sum2c(3:4)
60 |
61 | sum2c(c(0, 1, 1, 2, 3, 5))
62 |
63 | sum2c(sum2c(sum2c(sum2c(0:1))))
64 |
65 | fs <- get_fib(0:1, 20)
66 |
67 | get_ratios(fs)
68 |
69 | plot(fs, type = 'o', log='y')
70 | plot(get_ratios(fs), type ='o')
71 | abline(h = (1 + sqrt(5)) / 2, lty=2) # golden ratio
72 |
73 |
74 |
--------------------------------------------------------------------------------
/scripts/google_sheets_mang.R:
--------------------------------------------------------------------------------
1 |
2 | library(googledrive)
3 |
4 | # read in class list
5 | rclass <- read_sheet("https://docs.google.com/spreadsheets/d/1cZYMmzFNHoggn8qBTlcq_Q4srirbv9JK5WyDo2sJ950/edit?gid=0#gid=0")
6 | rclass$last
7 |
8 | eval_urls <- NULL
9 | for (i in seq_along(rclass$last)) {
10 | drive_cp(file = "https://docs.google.com/spreadsheets/d/16An8KUIj_wOS-RZUiTCl82O3gPSHFTZrvr7_Y02ciwY")
11 | new_file <- drive_get(path = "student_evals_2025/Copy of student_feedback")
12 | renamed_file <- drive_mv(as_id(new_file), name = paste("student_feedback_", rclass$last[i], sep=''))
13 | renamed_file %>%
14 | drive_share(
15 | role = "writer",
16 | type = "user",
17 | emailAddress = rclass$email[i],
18 | emailMessage = "Here is your R project sheet"
19 | )
20 | eval_urls[i] <- drive_link(renamed_file)
21 | }
22 |
23 | eval_urls
24 |
--------------------------------------------------------------------------------
/scripts/pull_student_repos.R:
--------------------------------------------------------------------------------
1 | year = 2020
2 | student_path = paste0('./student_', year)
3 | students = dir(student_path)
4 | for(i in seq_along(students)) {
5 | system(paste0('cd ', student_path, '/', students[i],
6 | ' ; git pull origin master'))
7 | }
8 |
--------------------------------------------------------------------------------
/scripts/shiny_kmeans.R:
--------------------------------------------------------------------------------
1 | library(shiny)
2 |
3 |
4 | ui = pageWithSidebar(
5 | headerPanel('Iris k-means clustering'),
6 | sidebarPanel(
7 | selectInput('xcol', 'X Variable', names(iris)),
8 | selectInput('ycol', 'Y Variable', names(iris),
9 | selected=names(iris)[[2]])
10 | ),
11 | mainPanel(
12 | verbatimTextOutput('lm_sum')
13 | )
14 | )
15 |
16 |
17 | server = function(input, output, session) {
18 | selectedData <- reactive({
19 | iris[, c(input$xcol, input$ycol)]
20 | })
21 |
22 | output$lm_sum <- renderPrint(
23 | summary(lm(selectedData()))
24 | )
25 |
26 | }
27 |
28 | shinyApp(ui, server)
--------------------------------------------------------------------------------
/scripts/utility_functions.R:
--------------------------------------------------------------------------------
1 | panel.cor <- function(x, y, digits = 2, prefix = "", cex.cor=3, ...)
2 | {
3 | usr <- par("usr"); on.exit(par(usr))
4 | par(usr = c(0, 1, 0, 1))
5 | r <- abs(cor(x, y))
6 | txt <- format(c(r, 0.123456789), digits = digits)[1]
7 | txt <- paste0(prefix, txt)
8 | if(missing(cex.cor))
9 | cex.cor <- 0.8/strwidth(txt)
10 | text(0.5, 0.5, txt, cex = cex.cor)
11 | }
12 |
13 | "cleanplot.pca" <- function(res.pca, ax1=1, ax2=2, point=FALSE,
14 | ahead=0.07, cex=0.7)
15 | {
16 | # A function to draw two biplots (scaling 1 and scaling 2) from an object
17 | # of class "rda" (PCA or RDA result from vegan's rda() function)
18 | #
19 | # License: GPL-2
20 | # Authors: Francois Gillet & Daniel Borcard, 24 August 2012
21 |
22 | require("vegan")
23 |
24 | par(mfrow=c(1,2))
25 | p <- length(res.pca$CA$eig)
26 |
27 | # Scaling 1: "species" scores scaled to relative eigenvalues
28 | sit.sc1 <- scores(res.pca, display="wa", scaling=1, choices=c(1:p))
29 | spe.sc1 <- scores(res.pca, display="sp", scaling=1, choices=c(1:p))
30 | plot(res.pca, choices=c(ax1, ax2), display=c("wa", "sp"), type="n",
31 | main="PCA - scaling 1", scaling=1)
32 | if (point)
33 | {
34 | points(sit.sc1[,ax1], sit.sc1[,ax2], pch=20)
35 | text(res.pca, display="wa", choices=c(ax1, ax2), cex=cex, pos=3, scaling=1)
36 | }
37 | else
38 | {
39 | text(res.pca, display="wa", choices=c(ax1, ax2), cex=cex, scaling=1)
40 | }
41 | text(res.pca, display="sp", choices=c(ax1, ax2), cex=cex, pos=4,
42 | col="red", scaling=1)
43 | arrows(0, 0, spe.sc1[,ax1], spe.sc1[,ax2], length=ahead, angle=20, col="red")
44 | pcacircle(res.pca)
45 |
46 | # Scaling 2: site scores scaled to relative eigenvalues
47 | sit.sc2 <- scores(res.pca, display="wa", choices=c(1:p))
48 | spe.sc2 <- scores(res.pca, display="sp", choices=c(1:p))
49 | plot(res.pca, choices=c(ax1,ax2), display=c("wa","sp"), type="n",
50 | main="PCA - scaling 2")
51 | if (point) {
52 | points(sit.sc2[,ax1], sit.sc2[,ax2], pch=20)
53 | text(res.pca, display="wa", choices=c(ax1 ,ax2), cex=cex, pos=3)
54 | }
55 | else
56 | {
57 | text(res.pca, display="wa", choices=c(ax1, ax2), cex=cex)
58 | }
59 | text(res.pca, display="sp", choices=c(ax1, ax2), cex=cex, pos=4, col="red")
60 | arrows(0, 0, spe.sc2[,ax1], spe.sc2[,ax2], length=ahead, angle=20, col="red")
61 | par(mfrow=c(1,1))
62 | }
63 |
64 |
65 |
66 | "pcacircle" <- function (pca)
67 | {
68 | # Draws a circle of equilibrium contribution on a PCA plot
69 | # generated from a vegan analysis.
70 | # vegan uses special constants for its outputs, hence
71 | # the 'const' value below.
72 |
73 | eigenv <- pca$CA$eig
74 | p <- length(eigenv)
75 | n <- nrow(pca$CA$u)
76 | tot <- sum(eigenv)
77 | const <- ((n - 1) * tot)^0.25
78 | radius <- (2/p)^0.5
79 | radius <- radius * const
80 | symbols(0, 0, circles=radius, inches=FALSE, add=TRUE, fg=2)
81 | }
82 |
83 | pseudo_r2 <- function(mod, null_mod=NULL) {
84 | if (class(mod) == 'glm')
85 | r2 <- 1 - glm_mod$deviance / glm_mod$null.deviance
86 | if (class(mod) == 'gls') {
87 | if (is.null(null_mod))
88 | null_mod <- update(mod, . ~ 1)
89 | r2 <- 1 - (as.numeric(logLik(mod) / logLik(null_mod)))
90 | }
91 | return(r2)
92 | }
93 |
94 | get_spat_mods = function(gls_mod) {
95 | err_mods = c('corExp', 'corGaus', 'corLin', 'corRatio', 'corSpher')
96 | out = vector('list', length(err_mods))
97 | names(out) = sub('cor', '', err_mods)
98 | for(i in seq_along(err_mods)) {
99 | mods = vector('list', 2)
100 | names(mods) = c('nonug', 'nug')
101 | mods[[1]] = try(eval(parse(text=paste('update(gls_mod, corr=',
102 | err_mods[i],
103 | '(form = ~ x + y, nugget=F))', sep=''))))
104 | mods[[2]] = try(eval(parse(text=paste('update(gls_mod, corr=',
105 | err_mods[i],
106 | '(form = ~ x + y, nugget=T))', sep=''))))
107 | out[[i]] = mods
108 | }
109 | out
110 | }
111 |
112 | get_spat_AIC = function(spat_mods) {
113 | out = data.frame(mods = names(spat_mods),
114 | AIC_no_nug = NA, AIC_nug=NA)
115 | for(i in seq_along(spat_mods))
116 | for(j in 1:2)
117 | if(class(spat_mods[[i]][[j]]) == 'gls')
118 | out[i, j + 1] = AIC(spat_mods[[i]][[j]])
119 | out
120 | }
121 |
--------------------------------------------------------------------------------
/software.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Software"
3 | output: html_document
4 | layout: page
5 | ---
6 |
7 | This course is taught using the R statistical programming language.
8 |
9 | **R** is a free, open-source software package that can be downloaded here:
10 |
11 | [https://cran.r-project.org/](https://cran.r-project.org/)
12 |
13 | **Rstudio** is a free GUI that makes it easier to interact with R, it can be
14 | downloaded here:
15 |
16 | [https://www.rstudio.com/products/rstudio/download/#download](https://www.rstudio.com/products/rstudio/download/#download)
17 |
18 | **git** is a version control system for tracking changes in files and collaborating,
19 | it can be downloaded here:
20 |
21 | [https://git-scm.com/downloads](https://git-scm.com/downloads)
22 |
23 | If you have trouble installing these software then send Dan an email or make
24 | an appointment. Alternatively use the [Rstudio server](uniola.biology.cofc.edu:8787)
25 | that is configured for class usage:
26 |
27 |
--------------------------------------------------------------------------------
/syllabus_bio470.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmcglinn/quant_methods/747c05f4c60c0f441496293adacbfc3984af2b11/syllabus_bio470.pdf
--------------------------------------------------------------------------------
/syllabus_bio570.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmcglinn/quant_methods/747c05f4c60c0f441496293adacbfc3984af2b11/syllabus_bio570.pdf
--------------------------------------------------------------------------------