Posts

Showing posts with the label VAILLICROSA:

Introduction to R, Part III Linear and Mixed Models in R

[SQUEAKING] [RUSTLING] [CLICKING] HELENA VAILLICROSA: OK. So now, we're just going to jump directly into how to use R for statistics. I'm going to make a very quick tutorial about how to apply linear models into the data, also general linear models and mixed models. I'm not going to cover the mathematical principles of that. I'm just going to show you how to apply those models with code. So first of all, I'm just going to start over with all the objects here, just cleaning a little bit, so it's not distracting us. It's just going to charge again the database we've been working with based on nitrogen, and phosphorus, and potassium fertilization in yields. Oops, sorry. OK. So this is how the structure of a linear model should look like. First of all, we create the name of the model, model number 1. We assign all of these into model number 1-- LM, which is linear model. And here, we're going to have our dependent variable, the y, which is ...

Introduction to R, Part I Interface and Data Structures

[SQUEAKING] [RUSTLING] [CLICKING] HELENA VAILLICROSA: In this video, I'm going to go directly to R. So what is R? And what are the advantages of using R? R is a coding language that's broadly used in some scientific areas-- for example, ecology or climate sciences. And why is that? Well, first of all, R is free of charge, meaning that everybody can use it. And as long as they have connection to the internet, they can download it. And there's no subscription at all. Second of all is that it's collaborative, meaning that everybody can share their code through the R platform itself or also by alternative sources. So this code can be shared. And there's no need to start from scratch. And third of all is that it can be repeated or shared. So as I said, you can get your script and share it to somebody else. You can publish it along with your research. Fourth of all is that you can go from the head to tail to the process of the research. So that involves the ...

Introduction to GIS, Part VI Plotting Maps with ggplot2

[SQUEAKING] [RUSTLING] [CLICKING] HELENA VAILLICROSA: During this course, when we've had the need to plot a map, we use the code that is provided by default by R. But there are other ways to plot maps and make them easy to be tuned according on our taste. So now, I'm going to show you how to display nice maps that are easy to tune using ggplot. And to do that, I'm going to charge the map that we've been using, our friend, this temperature map. Also, to make the process easier, faster for R, I'm going to aggregate this map, so make it coarser. In this case, I'm going to use a factor of 5. So it means that from each five pixels I'm just creating one. It's going to affect the result. In this case, it's going to make the image to be less defined. But this is just because we aggregated the data. And we also need to transform this map into a data frame. This is a requirement to be able to plot it with ggplot. So that's what I'm doing ...

Introduction to GIS, Part V Extract Information from Maps using Spatial Data Points

[SQUEAKING] [RUSTLING] [CLICKING] HELENA VAILLICROSA: In this part of the code, I'm going to guide you through the gap-filling process based on maps. So this is a process that I use quite a lot in my research, which is when I'm facing a new database sometimes comes with some empty slots, some N/As in the data. And I want to fill them based on field data. Obviously, data coming from maps is not as accurate as data coming from field experiments. But this is a good proxy we have to maximize the data we have and use them all in our models. So what I'm going to be doing here is to use the latitude and longitude of the coordinates that comes into the databases, transform them into spatial-explicit data points, and use these data points to extract the data coming from a map. So let's just go ahead. I'm going to download real data that I created that is in my GitHub account. You can download it freely here. It's a database that calculates nitrogen uptake g...

Introduction to GIS, Part IV Stack, Brick, Crop, and Mask

[SQUEAKING] [RUSTLING] [CLICKING] HELENA VAILLICROSA: In this section, I'm going to dive into stack and bricks, which are, I would say, books of maps. So just for you to have a good understanding of how stack and bricks work, it's like if you would have each of them map being a piece of paper and you would like to put them together in a book form, then you would use stack and brick. And how is this helpful? This is helpful because these standardized processes that we want to proceed on the maps. So let's say we want to chop them in the same shape, or we want to transform them in the same resolution, or we want to calculate some results of these maps. We can do it using stack and bricks. And we can also store stack and bricks in stack and brick form in our computer. So first of all, when we want to create stacks and bricks, there's a very handy way to charge these files all at once, so we don't have to type the route every time. In this case, I'm go...