Skip to content

Commit

Permalink
Merge pull request #19 from chrbknudsen/main
Browse files Browse the repository at this point in the history
tirsdag fyraften
  • Loading branch information
chrbknudsen authored Sep 17, 2024
2 parents d9b372f + 88c3176 commit 9a3ad26
Show file tree
Hide file tree
Showing 30 changed files with 5,348 additions and 252 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
^docs$
^pkgdown$
^skrammel$
^poster$
^paper$
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Package: KBapi
Title: What the Package Does (One Line, Title Case)
Title: Wrapper for Royal Danish Library API
Version: 0.0.0.9000
Authors@R:
person("Christian", "Knudsen", , "cbk@kb.dk", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-9816-768X"))
Description: What the package does (one paragraph).
Description: Provides wrappers for Royal Danish Library APIs for Aerial photographs, digitized images and litterature.
License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
Expand Down
6 changes: 4 additions & 2 deletions R/get_aerial.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#' @param lat Latitude
#' @param lon Longitude
#' @param format Outputformat. Either kml, rss, atom or mods
#' @return Beskrivelse af returværdien.
#' @return A tibble containing SVARET!
#' @examples
#' # Eksempel på brug af funktionen
#' get_aerial(lat = 1, lon = 2)
Expand All @@ -23,7 +23,9 @@ get_aerial <- function(lat=56.007514636317666, lon=12.228840190005485, format =
if(!(format %in% c("kml", "rss", "atom", "mods"))){
rlang::abort("format must be one of 'kml', 'rss', 'atom' or 'mods'", class = "invalid_input")
}
# warnings når lat/lon er uden for range
# warnings når lat/lon er uden for range deter -90 til 90 for lat og -180 til 180 for long
# Og der er en mere snæver grænse på de luftfotos vi har.
# Det må også være muligt at angive en bounding box på en mere fix måde.
# rlang::warn()
api_url <- "http://www.kb.dk/cop/syndication/images/luftfo/2011/maj/luftfoto/subject203/"
formatted_lat <- sprintf("%.16f", lat)
Expand Down
34 changes: 14 additions & 20 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,42 @@ output: github_document

<!-- README.md is generated from README.Rmd. Please edit that file -->

```{r, include = FALSE}
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
CRAN <- FALSE # Vi er ikke på CRAN endnu.
PUB <- FALSE # Vi har ikke publiceret endnu
```

# KBapi <a href="https://kubdatalab.github.io/KBAPI/"><img src="man/figures/logo.png" align="right" height="139" alt="KBapi website" /></a>

<!-- badges: start -->
[![R-CMD-check](https://github.com/KUBDatalab/KBAPI/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/KUBDatalab/KBAPI/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

`r badger::badge_runiverse("KBapi", "kubdatalab") `
`r if(CRAN) badger::badge_dependencies() `
`r if(CRAN) badger::badge_cran_checks() `
`r if(CRAN) badger::badge_cran_download(type = "grand-total", color = "blue") `
`r if(CRAN) badger::badge_cran_download(type = "last-month", color = "green") `
`r if(CRAN) badger::badge_cran_download(type = "last-week", color = "yellow") `
`r if(PUB) badger::badge_doi("", "yellow") `


<!-- badges: end -->

The goal of KBapi is to ...
The goal of KBapi is to make it easy to extract data from the API of Royal Danish Library.

## Installation

You can install the development version of KBapi like so:

``` r
options(repos = c(
kubdatalab = '',
CRAN = 'httpos://cloud.r-project.org')
kubdatalab = 'https://kubdatalab.r-universe.dev',
CRAN = 'https://cloud.r-project.org')
)

install.packages('KBAPI')
Expand All @@ -51,18 +59,4 @@ library(KBAPI)
## basic example code
```

What is special about using `README.Rmd` instead of just `README.md`? You can include R chunks like so:

```{r cars}
summary(cars)
```

You'll still need to render `README.Rmd` regularly, to keep `README.md` up-to-date. `devtools::build_readme()` is handy for this.

You can also embed plots, for example:

```{r pressure, echo = FALSE}
plot(pressure)
```

In that case, don't forget to commit and push the resulting figure files, so they display on GitHub and CRAN.
34 changes: 7 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,22 @@
<!-- badges: start -->

[![R-CMD-check](https://github.com/KUBDatalab/KBAPI/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/KUBDatalab/KBAPI/actions/workflows/R-CMD-check.yaml)
[![r-universe status
badge](https://kubdatalab.r-universe.dev/badges/KBapi)](https://kubdatalab.r-universe.dev/KBapi)

<!-- badges: end -->

The goal of KBapi is to …
The goal of KBapi is to make it easy to extract data from the API of
Royal Danish Library.

## Installation

You can install the development version of KBapi like so:

``` r
options(repos = c(
kubdatalab = '',
CRAN = 'httpos://cloud.r-project.org')
kubdatalab = 'https://kubdatalab.r-universe.dev',
CRAN = 'https://cloud.r-project.org')
)

install.packages('KBAPI')
Expand All @@ -37,27 +41,3 @@ This is a basic example which shows you how to solve a common problem:
library(KBAPI)
## basic example code
```

What is special about using `README.Rmd` instead of just `README.md`?
You can include R chunks like so:

``` r
summary(cars)
#> speed dist
#> Min. : 4.0 Min. : 2.00
#> 1st Qu.:12.0 1st Qu.: 26.00
#> Median :15.0 Median : 36.00
#> Mean :15.4 Mean : 42.98
#> 3rd Qu.:19.0 3rd Qu.: 56.00
#> Max. :25.0 Max. :120.00
```

You’ll still need to render `README.Rmd` regularly, to keep `README.md`
up-to-date. `devtools::build_readme()` is handy for this.

You can also embed plots, for example:

<img src="man/figures/README-pressure-1.png" width="100%" />

In that case, don’t forget to commit and push the resulting figure
files, so they display on GitHub and CRAN.
4 changes: 2 additions & 2 deletions man/KBapi-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/get_aerial.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions paper/paper.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: "paper"
format: html
---


KBapi: An R package for extracting documents, aerial photographs and images from
the collections of The Danish Royal Library

## Summary

https://github.com/DHNB-EU/dhnbpub-template/tree/main/latex

Men vi starter her.
Binary file added poster/DKB_logo_expanded_black_RGB.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added poster/Datalab_colours_clear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions poster/packages.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
@Manual{R-pagedown,
title = {pagedown: Paginate the HTML Output of R Markdown with CSS for Print},
author = {Yihui Xie and Romain Lesur and Brent Thorne and Xianying Tan},
year = {2022},
note = {R package version 0.20},
url = {https://github.com/rstudio/pagedown},
}

@Manual{R-posterdown,
title = {posterdown: Generate PDF Conference Posters Using R Markdown},
author = {Brent Thorne},
year = {2019},
note = {R package version 1.0},
url = {https://github.com/brentthorne/posterdown},
}

@Manual{R-rmarkdown,
title = {rmarkdown: Dynamic Documents for R},
author = {JJ Allaire and Yihui Xie and Christophe Dervieux and Jonathan McPherson and Javier Luraschi and Kevin Ushey and Aron Atkins and Hadley Wickham and Joe Cheng and Winston Chang and Richard Iannone},
year = {2024},
note = {R package version 2.27},
url = {https://github.com/rstudio/rmarkdown},
}

@Book{rmarkdown2018,
title = {R Markdown: The Definitive Guide},
author = {Yihui Xie and J.J. Allaire and Garrett Grolemund},
publisher = {Chapman and Hall/CRC},
address = {Boca Raton, Florida},
year = {2018},
isbn = {9781138359338},
url = {https://bookdown.org/yihui/rmarkdown},
}

@Book{rmarkdown2020,
title = {R Markdown Cookbook},
author = {Yihui Xie and Christophe Dervieux and Emily Riederer},
publisher = {Chapman and Hall/CRC},
address = {Boca Raton, Florida},
year = {2020},
isbn = {9780367563837},
url = {https://bookdown.org/yihui/rmarkdown-cookbook},
}

Loading

0 comments on commit 9a3ad26

Please sign in to comment.