raster

Linear regression on raster images - lm complains about NAs

喜你入骨 提交于 2021-02-18 19:13:46
问题 I'm sure this can be fixed with few bytes, but I've spent hours on this simple thing and can't get out of it. I don't use R often. I have 5 asciigrid files that represent 5 raster images. Some pixels do have values, other do have NAs. For example, the first image might be something like: NA NA NA NA NA NA NA 2 3 NA NA 0.2 0.3 1 NA NA NA 4 NA NA and the second might be: NA NA NA NA NA NA NA 5 1 NA NA 0.1 12 12 NA NA NA 6 NA NA As you can see, NA position is always the same and I'm 100% sure

Linear regression on raster images - lm complains about NAs

喜欢而已 提交于 2021-02-18 19:10:28
问题 I'm sure this can be fixed with few bytes, but I've spent hours on this simple thing and can't get out of it. I don't use R often. I have 5 asciigrid files that represent 5 raster images. Some pixels do have values, other do have NAs. For example, the first image might be something like: NA NA NA NA NA NA NA 2 3 NA NA 0.2 0.3 1 NA NA NA 4 NA NA and the second might be: NA NA NA NA NA NA NA 5 1 NA NA 0.1 12 12 NA NA NA 6 NA NA As you can see, NA position is always the same and I'm 100% sure

Iterating over a function to combine many raster stacks into one

僤鯓⒐⒋嵵緔 提交于 2021-02-17 04:42:42
问题 Been stuck on this for a while now. Looked everywhere for an answer, but I can't seem to find anything on Stack. Any help you all can give that would be very appreciated. My main issue is that I need to import many, many netcdf4 files, create raster bricks of each, then combine many bricks to make a "master brick" per variable. To give you a clearer example, I have 40 years (netcdf = 40) of many climate variables (n = 15) that are at a daily resolution. The goal is to aggregate to monthly,

How to Convert CSV to Raster in R?

杀马特。学长 韩版系。学妹 提交于 2021-02-11 13:09:05
问题 I have a CSV (value, carbon, latitude, longitude) that I am trying to create a raster from. CSV file sample: Carbon Latitude Longitude coords.x1 coords.x2 1 385 36 74 36 74 2 463 36 74 36 74 3 35 36 74 36 74 4 38 36 74 36 74 5 34 36 74 36 74 6 11 36 74 36 74 7 46 36 74 36 74 8 18 36 74 36 74 9 213 36 74 36 74 10 619 36 74 36 74 11 140 36 74 36 74 12 40 36 74 36 74 13 42 36 74 36 74 14 18 36 74 36 74 15 277 36 74 36 74 16 641 36 74 36 74 17 416 36 74 36 74 18 459 36 74 36 74 19 1073 36 74 36

Test intersection of two MULTIPOLYGONS based on year cycles in R

筅森魡賤 提交于 2021-02-10 17:36:23
问题 I have two multipolygons and I want to test intersections between their geometries based on groups of years. Basically I have a flood multipolygon that contains flood events and their geometry and an election dataset which has each election as ward*year units, containing the geometry of that ward. I want to see if there are any intersections in the electoral ward each cycle prior to each election. So if the election was in 2009 and the cycle was 2007-2009 I want to see if its ward was flooded

Can't Calculate pixel-wise regression in R on raster stack with fun

三世轮回 提交于 2021-02-10 11:51:00
问题 I am working with rasters and I've a RasterStack with 7n layers. I would like to calculate pixel-wise regression, using formula beneath. I was trying to do it with raster::calc , but my function failed with message : 'Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : 0 (non-NA) cases.' But all rasters are OK, and contain numbers (not only NAs), I can plot it, and I can calculate general linear regression with formula cr.sig=lm (raster::as.array(MK_trend.EVI.sig_Only) ~

Can't Calculate pixel-wise regression in R on raster stack with fun

天大地大妈咪最大 提交于 2021-02-10 11:48:12
问题 I am working with rasters and I've a RasterStack with 7n layers. I would like to calculate pixel-wise regression, using formula beneath. I was trying to do it with raster::calc , but my function failed with message : 'Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : 0 (non-NA) cases.' But all rasters are OK, and contain numbers (not only NAs), I can plot it, and I can calculate general linear regression with formula cr.sig=lm (raster::as.array(MK_trend.EVI.sig_Only) ~

Create hexagonal grid over city and associate with lon / lat points (in R)

╄→гoц情女王★ 提交于 2021-02-09 08:35:18
问题 I've been researching this for a while now but haven't come across any solution that fit my needs or that I can transform sufficiently to work in my case: I have a large car sharing data set for multiple cities in which I have the charging demand per location (e.g. row = carID, 55.63405, 12.58818, charging demand). I now would like to split the area over the city (example above is Copenhagen) up into a hexagonal grid and tag every parking location with an ID (e.g. row = carID, 55.63405, 12

Create hexagonal grid over city and associate with lon / lat points (in R)

允我心安 提交于 2021-02-09 08:34:19
问题 I've been researching this for a while now but haven't come across any solution that fit my needs or that I can transform sufficiently to work in my case: I have a large car sharing data set for multiple cities in which I have the charging demand per location (e.g. row = carID, 55.63405, 12.58818, charging demand). I now would like to split the area over the city (example above is Copenhagen) up into a hexagonal grid and tag every parking location with an ID (e.g. row = carID, 55.63405, 12

Create hexagonal grid over city and associate with lon / lat points (in R)

懵懂的女人 提交于 2021-02-09 08:33:32
问题 I've been researching this for a while now but haven't come across any solution that fit my needs or that I can transform sufficiently to work in my case: I have a large car sharing data set for multiple cities in which I have the charging demand per location (e.g. row = carID, 55.63405, 12.58818, charging demand). I now would like to split the area over the city (example above is Copenhagen) up into a hexagonal grid and tag every parking location with an ID (e.g. row = carID, 55.63405, 12