Skip to content

Instantly share code, notes, and snippets.

View josephlewis's full-sized avatar

josephlewis

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?><?xml-model href="http://www.stoa.org/epidoc/schema/latest/tei-epidoc.rng" schematypens="http://relaxng.org/ns/structure/1.0"?><TEI xmlns="http://www.tei-c.org/ns/1.0" xml:space="preserve" xml:lang="de" xml:base="ex-epidoctemplate.xml">
<teiHeader>
<fileDesc>
<titleStmt>
<title>Grabinschrift auf Stele</title>
</titleStmt>
<publicationStmt>
<authority>Epigraphische Datenbank Heidelberg</authority>
<idno type="URI">http://edh-www.adw.uni-heidelberg.de/edh/inschrift/HD008323</idno>
<idno type="TM">178459</idno><idno type="localID">HD008323</idno>
ggplot(data = dist_travelled[c(TRUE, FALSE),], aes(x = factor(1), y = distance, label = paste0(place, ", ", cumulative, "km"))) +
geom_line(colour = "#C70039", position = "stack", stat = "identity", size = 3) +
geom_point(colour = "#C70039", fill = "#DDDDDD", pch = 21, position = "stack", stat = "identity", size = 6, stroke = 3) +
geom_text_repel(position = position_stack(vjust = .5), colour = "#666666", family="PT Sans", force=1, point.padding=unit(1,'lines')) +
coord_flip()
plaques$sex[grep("man", plaques$subjects, fixed = TRUE)] <- "Man"
plaques$sex[grep("woman", plaques$subjects, fixed = TRUE)] <- "Woman"
> head(xtestbuffer)
battlefield.no distance decade
1200s NA 1000 1200s
1300s 0.20000000 1000 1300s
1400s NA 1000 1400s
1500s NA 1000 1500s
1600s 0.05882353 1000 1600s
1700s 0.20000000 1000 1700s
decbuf <- ggplot(xtestbuffer) +
for (i in levels(scot_battles_centroid_dates$century)) { # the levels are "1200s" to "1900s"
battle_road_dist <- gDistance(scot_battles_centroid_dates[scot_battles_centroid_dates$century == i,], sp, byid = TRUE) # euclidean distance from battle point to road.
battle_road_dist_vect <- data.frame(as.vector(battle_road_dist)) # creates df of the distances
dist_test <- rbind(battle_road_dist_vect) # adds to a df to create one df with all of the distances
}
road_pts <- list()
for (i in unique(wales_roads$Name)) {
known_pts <- gInterpolate(wales_roads[wales_roads$Name == i,], d = seq(0, gLength(wales_roads[wales_roads$Name == i,]), by = gLength(wales_roads[wales_roads$Name == i,])), normalized = FALSE)
known_pts@coords
A <- known_pts@coords[1,]
B <- known_pts@coords[2,]
AtoB <- shortestPath(Conductance, A, B, output="SpatialLines")
plot(AtoB, add = TRUE, col = "red")
LCP_pts <- gInterpolate(AtoB, d = seq(0, gLength(AtoB), by = 250), normalized = FALSE)
for (i in 1:(nrow(road_coords)/2)) {
A <- unlist(road_coords[i,2:3])
B <- unlist(road_coords[i + 1,2:3])
> head(road_coords)
Name coords.x1 coords.x2
1 Margary 62aa 300409.3 229884.3
2 Margary 62aa 303385.8 231078.0
3 Margary 62b 300419.3 229884.6
xx$band[xx$dav_hue_vector >= (0/12) & xx$dav_hue_vector <= (1/12)] <- "Red"
xx$band[xx$dav_hue_vector > (1/12) & xx$dav_hue_vector <= (2/12)] <- "Red-Orange"
xx$band[xx$dav_hue_vector > (2/12) & xx$dav_hue_vector <= (3/12)] <- "Orange"
xx$band[xx$dav_hue_vector > (3/12) & xx$dav_hue_vector <= (4/12)] <- "Yellow-Orange"
xx$band[xx$dav_hue_vector > (4/12) & xx$dav_hue_vector <= (5/12)] <- "Yellow"
xx$band[xx$dav_hue_vector > (5/12) & xx$dav_hue_vector <= (6/12)] <- "Yellow-Green"
xx$band[xx$dav_hue_vector > (6/12) & xx$dav_hue_vector <= (7/12)] <- "Green"
xx$band[xx$dav_hue_vector > (7/12) & xx$dav_hue_vector <= (8/12)] <- "Blue-Green"
xx$band[xx$dav_hue_vector > (8/12) & xx$dav_hue_vector <= (9/12)] <- "Blue"
xx$band[xx$dav_hue_vector > (9/12) & xx$dav_hue_vector <= (10/12)] <- "Blue-Violet"
[1] "month"
[2] "visits"
[3] "tmax"
[4] "tmin"
[5] "rainfall"
[6] "OS.visits.to.UK.Earnings..Â..Millions.NSA"
[7] "OS.visits.to.UK.All.visits.Thousands.NSA"
[8] "season"
ggplot(data = df.m, aes(x = month, group = 1)) +
geom_ribbon(data= subset(df.m, df.m$visits.raw > df.m$visits.mean), aes(ymin = pmin(visits.mean, visits.raw), ymax = pmax(visits.mean, visits.raw)),fill="#008FD5", alpha="0.2") +
geom_line(aes(y = visits.mean), size = 1.5, color = 'grey') +
geom_line(aes(y = visits.raw), size = 1.5, colour = "#008FD5") +
facet_wrap(~year, ncol = 3) +
scale_x_discrete(limits = month.abb) +
scale_y_continuous(labels=comma)