Skip to content

Commit aa8e98f

Browse files
committedDec 9, 2023
rename to bitfield
1 parent 27c6d08 commit aa8e98f

File tree

4 files changed

+32
-42
lines changed

4 files changed

+32
-42
lines changed
 

‎DESCRIPTION

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Package: queuebee
1+
Package: bitfield
22
Type: Package
33
Title: Handle Bitfields to record Data-Quality
44
Version: 0.1.0
@@ -10,8 +10,8 @@ Authors@R: c(
1010
Description: Provides tools to record formal data quality and meta data to store
1111
that in a bitfield, which can be published alongside all sort of (modelled)
1212
data products that can be handled in tabular form.
13-
URL: https://github.com/luckinet/queuebee
14-
BugReports: https://github.com/luckinet/queuebee/issues
13+
URL: https://github.com/luckinet/bitfield
14+
BugReports: https://github.com/luckinet/bitfield/issues
1515
License: GPL (>= 3)
1616
Encoding: UTF-8
1717
LazyData: true

‎README.Rmd

+6-12
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,22 @@ knitr::opts_chunk$set(
2828
Install the official version from CRAN:
2929

3030
```{r, eval=FALSE}
31-
# install.packages("queuebee")
31+
# install.packages("bitfield")
3232
```
3333

3434
Install the latest development version from github:
3535

3636
```{r, eval=FALSE}
37-
devtools::install_github("EhrmannS/queuebee")
37+
devtools::install_github("luckinet/bitfield")
3838
```
3939

4040

4141
## Examples
4242

4343
```{r example}
44+
library(bitfield)
45+
4446
library(dplyr, warn.conflicts = FALSE)
45-
library(queuebee)
4647
library(CoordinateCleaner)
4748
library(stringr)
4849
```
@@ -146,6 +147,8 @@ This example here shows how to compute quality bits for tabular data, but this t
146147
To keep this package as simple as possible, no specific methods for rasters were developed, rasters instead need to be converted to tabular form and joined to the attributes or meta data that should be added to the QB, for example like this
147148

148149
```{r, eval = FALSE}
150+
library(terra)
151+
149152
raster <- rast(matrix(data = 1:25, nrow = 5, ncol = 5))
150153
151154
input <- values(raster) %>%
@@ -156,7 +159,6 @@ input <- values(raster) %>%
156159
# from here we can continue creating a bitfield and growing bits on it just like shown above...
157160
158161
# ... and then converting it back to a raster
159-
#
160162
QB_rast <- crds(raster) %>%
161163
bind_cols(QB_int) %>%
162164
rast(type="xyz", crs = crs(raster), extent = ext(raster))
@@ -181,11 +183,3 @@ Using the first two of those bits, we can represent 4 different states of an att
181183
By growing a bitfield with this package, you decide which information is stored in which location, to represent not only data quality *per se*, but all sort of information and perhaps even meta data.
182184

183185
When preparing a publication that contains (FAIR) data, it can therefore be a good solution to provide not only the data table/layer, but also a *single* additional column in a table or raster layer that records all of those information, and the bitfield to decode the QB values.
184-
185-
186-
187-
# To Do
188-
189-
- [ ] write bitfield show method
190-
- [ ] write qb_filter
191-
- [ ] other pre-made quality flag functions?!

‎README.md

+23-27
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,21 @@
1313
Install the official version from CRAN:
1414

1515
``` r
16-
# install.packages("queuebee")
16+
# install.packages("bitfield")
1717
```
1818

1919
Install the latest development version from github:
2020

2121
``` r
22-
devtools::install_github("EhrmannS/queuebee")
22+
devtools::install_github("luckinet/bitfield")
2323
```
2424

2525
## Examples
2626

2727
``` r
28+
library(bitfield)
29+
2830
library(dplyr, warn.conflicts = FALSE)
29-
library(queuebee)
3031
library(CoordinateCleaner)
3132
library(stringr)
3233
```
@@ -131,16 +132,16 @@ different length, a join/merge column needs to be provided.
131132
#> # A tibble: 10 × 1
132133
#> QB
133134
#> <int>
134-
#> 1 367
135-
#> 2 463
135+
#> 1 495
136+
#> 2 335
136137
#> 3 415
137-
#> 4 367
138+
#> 4 495
138139
#> 5 429
139-
#> 6 495
140+
#> 6 367
140141
#> 7 495
141-
#> 8 367
142-
#> 9 359
143-
#> 10 483
142+
#> 8 495
143+
#> 9 487
144+
#> 10 355
144145
```
145146

146147
Anybody that wants to either extend the bitfield or analyse the output
@@ -169,16 +170,16 @@ input %>%
169170
#> # A tibble: 10 × 7
170171
#> x y year commodity some_other QB QB_chr
171172
#> <dbl> <dbl> <chr> <chr> <dbl> <int> <chr>
172-
#> 1 24 57.5 2021 soybean 0.284 367 1|1|1|1|0|1|1|01
173-
#> 2 26.4 59.6 <NA> maize -0.524 463 1|1|1|1|0|0|1|11
174-
#> 3 27.5 58.3 2021r <NA> -0.237 415 1|1|1|1|1|0|0|11
175-
#> 4 23.9 58.7 2021 maize 0.412 367 1|1|1|1|0|1|1|01
176-
#> 5 259 58.6 2021 dog -1.42 429 1|0|1|1|0|1|0|11
177-
#> 6 23.8 58.1 2021 maize -0.266 495 1|1|1|1|0|1|1|11
178-
#> 7 24.2 58.9 2021 soybean -0.656 495 1|1|1|1|0|1|1|11
179-
#> 8 27 59.3 2021 maize 1.45 367 1|1|1|1|0|1|1|01
180-
#> 9 0 0 2021 soybean 0.315 359 1|1|1|0|0|1|1|01
181-
#> 10 27.1 NA 2021 maize -0.626 483 1|1|0|0|0|1|1|11
173+
#> 1 24.5 59.6 2021 soybean -0.134 495 1|1|1|1|0|1|1|11
174+
#> 2 24.7 57.6 <NA> maize 1.17 335 1|1|1|1|0|0|1|01
175+
#> 3 27.7 59 2021r <NA> -0.559 415 1|1|1|1|1|0|0|11
176+
#> 4 27.8 59.3 2021 maize -2.39 495 1|1|1|1|0|1|1|11
177+
#> 5 259 57.8 2021 dog -3.93 429 1|0|1|1|0|1|0|11
178+
#> 6 24.2 57.5 2021 maize 0.0905 367 1|1|1|1|0|1|1|01
179+
#> 7 24.9 59.2 2021 soybean -0.0455 495 1|1|1|1|0|1|1|11
180+
#> 8 23.6 58.3 2021 maize -2.68 495 1|1|1|1|0|1|1|11
181+
#> 9 0 0 2021 soybean -0.261 487 1|1|1|0|0|1|1|11
182+
#> 10 23.9 NA 2021 maize 0.201 355 1|1|0|0|0|1|1|01
182183
```
183184

184185
## Bitfields for other data-types
@@ -197,6 +198,8 @@ form and joined to the attributes or meta data that should be added to
197198
the QB, for example like this
198199

199200
``` r
201+
library(terra)
202+
200203
raster <- rast(matrix(data = 1:25, nrow = 5, ncol = 5))
201204

202205
input <- values(raster) %>%
@@ -207,7 +210,6 @@ input <- values(raster) %>%
207210
# from here we can continue creating a bitfield and growing bits on it just like shown above...
208211

209212
# ... and then converting it back to a raster
210-
#
211213
QB_rast <- crds(raster) %>%
212214
bind_cols(QB_int) %>%
213215
rast(type="xyz", crs = crs(raster), extent = ext(raster))
@@ -254,9 +256,3 @@ When preparing a publication that contains (FAIR) data, it can therefore
254256
be a good solution to provide not only the data table/layer, but also a
255257
*single* additional column in a table or raster layer that records all
256258
of those information, and the bitfield to decode the QB values.
257-
258-
# To Do
259-
260-
- [ ] write bitfield show method
261-
- [ ] write qb_filter
262-
- [ ] other pre-made quality flag functions?!

‎queuebee.Rproj ‎bitfield.Rproj

File renamed without changes.

0 commit comments

Comments
 (0)
Please sign in to comment.