View q103_tema3.c
/* Ejemplo =if= */
# include <stdio.h>
int main ()
{
int n;
printf("Escribe un número entero\n");
scanf("%d", &n);
if (n % 2 == 0) // Condición
View q103_tema2.c
/* Hello World! */
#include <stdio.h>
void main()
{
printf("Hello World!\n");
}
/* Hello World! (2) */
View code_without_ggplot2.R
## https://timogrossenbacher.ch/2016/12/beautiful-thematic-maps-with-ggplot2-only/
library(raster)
library(sp)
library(rgdal)
library(viridisLite)
library(rasterVis)
## Read age data
data <- read.csv("input/avg_age_15.csv", stringsAsFactors = F)
## Read shapefile
View inset.R
library(raster)
library(rasterVis)
library(grid)
r <- raster(system.file("external/test.grd", package="raster"))
## Main graphic
p1 <- levelplot(r)
## Inset graphic
p2 <- levelplot(r,
margin = FALSE,
View horizon_4Oscar.R
library(sp)
library(raster)
library(rgdal)
library(maptools)
library(gstat)
library(lattice)
library(latticeExtra)
library(rasterVis)
library(parallel)
library(solaR)
View solarSpatial.R
library(solaR)
library(raster)
## Replace it with your data file(s) with global radiation on the
## horizontal plane
SIS <- brick('/home/datos/CMSAF/CMSAF_2010_2011_SISdm/SISd2010.grd')
## This line is only needed to make this example faster. You don't
## need in your code.
SIStoy <- crop(SIS, extent(-0.2, 0.2, 39.8, 40.2))
names(SIStoy) <- paste0('d', 1:365)
View ayMadrid.org
View mappingFlows.R
### DATA SECTION
library(data.table)
## Read data with 'data.table::fread'
input <- fread("wu03ew_v1.csv", select = 1:3)
setnames(input, 1:3, new = c("origin", "destination","total"))
## Coordinates
centroids <- fread("msoa_popweightedcentroids.csv")
## 'Code' is the key to be used in the joins
View mapsWithR.R
library(sp)
## Grabar tabla excel en formato CSV usando ; como separador
## Leemos saltando dos primeras líneas
pts <- read.csv2('/tmp/listado-longitud-latitud-municipios-espana.csv', skip = 2)
## Transformamos a SPDF usando columnas de longitud-latitud como coordenadas
munPts <- SpatialPointsDataFrame(pts[, c(5, 4)], pts[,-c(4, 5)],
proj4string = CRS('+proj=longlat +datum=WGS84'))
## Pintamos el resultado para comprobar
spplot(munPts["Altitud"])
View SPEI.R
library(raster)
library(rasterVis)
library(zoo)
## Download SPEI file
setwd(tempdir())
download.file('https://digital.csic.es/bitstream/10261/104742/5/SPEI_03.nc', 'SPEI_03.nc', method = 'wget')
## Read it with `raster`
SPEI <- brick('SPEI_03.nc')