Commit 651e8a12 authored by Helmer Belbo's avatar Helmer Belbo
Browse files

Lot of imrovements

parent 14df06e8
# Generated by roxygen2: do not edit by hand
export(fylkesvis_mnd)
export(kommunevis)
export(ld.fylke.mnd)
export(ld.kommune)
export(ssb_skog_omsetning)
export(t03895)
export(t06216)
......
#' Fylkesvis pr mnd
#' @description a simple function to gather fylkesvise logging data from excel files
#' LD: Fylkesvis pr mnd
#' @description fylkesvise hogstdata fra landbruksdirektoratets excel-filer
#'
#' Filene ligger i mappen ./inst/ekstdata og behøver derfor ikke hentes.
#'
#' @return a tibble with logging statistics
#' @param Behøver ingen parametere. Datafilene ligger i egen folder.
#' @export
#'
#' @examples devtools::install_github("hbelbo/vsop")
#' fylkesvis_mnd()
fylkesvis_mnd = function(){
#' ld.fylke.mnd()
ld.fylke.mnd = function(){
files <- list.files(path = (system.file("extdata", package = "vsop")) ,
pattern = ".xlsx", full.names = T) %>%
.[which(!stringr::str_detect(., "~"))] %>%
......@@ -21,15 +24,15 @@ fylkesvis_mnd = function(){
}
#' Kommunevis vsop
#' LD: Kommunevis
#'
#' @return a tibble with logging statistics
#' @param Behøver ingen parametere. Datafilene ligger i egen folder.
#' @export
#'
#' @examples devtools::install_github("hbelbo/vsop")
#' kommunevis()
kommunevis = function(){
#' ld.kommune()
ld.kommune = function(){
files <- list.files(path = (system.file("extdata", package = "vsop")) ,
pattern = ".xlsx", full.names = T) %>%
.[which(!stringr::str_detect(., "~"))] %>%
......
# vsop - R-package for organizing harvest data from vsop
Landbruksdirektoratet is providing statistics for annual cut in excel sheets,
one for each year. This package organize these data.
Landbruksdirektoratet is providing statistics for annual cut at municipality level
in excel sheets, one excel document for each year.
https://www.landbruksdirektoratet.no/no/statistikk/skogbruk/tommeravvirkning
SSB provide similar statistics, but at county level, annual resolution and
a bit more lagged publication.
https://www.ssb.no/statbank/list/skogav
This package should ease the collection of these data into R.
This should install it to R:
`devtools::install_git('https://gitlab.nibio.no/hbel/vsop.git')`
Load dependent packages:
`invisible(lapply(c("magrittr","stringr","dplyr","tibble","lubridate","readxl","PxWebApiData"),library,character.only =T))`
Demo:
`vsop::ssb_skog_omsetning()`
`vsop::t03895()`
`vsop::t06216()`
`vsop::t12750()`
{"dataset":{"status":{"15":"..","82":"..","85":"..","88":"..","89":"..","90":"..","105":"..","106":"..","110":"..","111":"..","128":"..","129":"..","130":"..","131":"..","132":"..","133":"..","134":"..","135":"..","136":"..","137":"..","151":"..","152":"..","153":"..","154":"..","155":"..","156":"..","157":"..","158":"..","159":"..","160":"..","174":"..","175":"..","176":"..","177":"..","178":"..","179":"..","180":"..","181":"..","182":"..","183":"..","197":"..","198":"..","199":"..","200":"..","201":"..","202":"..","203":"..","204":"..","205":"..","206":"..","220":"..","221":"..","222":"..","223":"..","224":"..","225":"..","226":"..","227":"..","228":"..","229":"..","243":"..","244":"..","245":"..","246":"..","247":"..","248":"..","249":"..","250":"..","251":"..","252":".."},"dimension":{"Region":{"label":"region","category":{"index":{"F-30":0,"F-03":1,"F-34":2,"F-38":3,"F-42":4,"F-11":5,"F-46":6,"F-15":7,"F-50":8,"F-18":9,"F-54":10},"label":{"F-30":"Viken","F-03":"Oslo","F-34":"Innlandet","F-38":"Vestfold og Telemark","F-42":"Agder","F-11":"Rogaland","F-46":"Vestland","F-15":"Møre og Romsdal","F-50":"Trøndelag","F-18":"Nordland","F-54":"Troms og Finnmark"}},"link":{"describedby":[{"extension":{"Region":"urn:ssb:classification:klass:104 urn:ssb:classification:klass:131"}}]}},"ContentsCode":{"label":"statistikkvariabel","category":{"index":{"Bruttoverdi":0},"label":{"Bruttoverdi":"Bruttoverdi"},"unit":{"Bruttoverdi":{"base":"1000 kr","decimals":0}}},"link":{"describedby":[{"extension":{"Bruttoverdi":"urn:ssb:conceptvariable:vardok:1327"}}]}},"Tid":{"label":"år","category":{"index":{"1996":0,"1997":1,"1998":2,"1999":3,"2000":4,"2001":5,"2002":6,"2003":7,"2004":8,"2005":9,"2006":10,"2007":11,"2008":12,"2009":13,"2010":14,"2011":15,"2012":16,"2013":17,"2014":18,"2015":19,"2016":20,"2017":21,"2018":22},"label":{"1996":"1996","1997":"1997","1998":"1998","1999":"1999","2000":"2000","2001":"2001","2002":"2002","2003":"2003","2004":"2004","2005":"2005","2006":"2006","2007":"2007","2008":"2008","2009":"2009","2010":"2010","2011":"2011","2012":"2012","2013":"2013","2014":"2014","2015":"2015","2016":"2016","2017":"2017","2018":"2018"}}},"id":["Region","ContentsCode","Tid"],"size":[11,1,23],"role":{"geo":["Region"],"metric":["ContentsCode"],"time":["Tid"]}},"label":"03794: Bruttoverdi. Avvirkning for salg (1 000 kr), etter region, statistikkvariabel og år","source":"Statistisk sentralbyrå","updated":"2019-08-30T06:00:00Z","value":[688437,731740,651045,677894,603625,659631,624128,595754,663740,749339,636062,808231,761229,529227,833704,null,703196,639206,892052,916385,884125,978716,1202281,18031,16181,11634,14363,10599,10581,13318,9827,10998,9328,6592,9388,9082,12543,9742,10362,11987,11924,15697,12375,14240,6480,22796,1031702,1164366,1074636,1110909,1042701,1093846,971295,910009,1019639,1243145,954002,1353628,1214096,883165,1241378,1333493,1328547,1260879,1464108,1406322,1386140,1530368,1822837,303489,336942,328252,325428,320377,304536,252384,217575,244935,273207,256305,353113,343620,null,317882,317311,null,209153,290411,null,null,null,408620,187554,198136,172644,178957,173353,171428,140135,145697,146225,165228,124163,146415,170487,null,null,192443,170267,161628,null,null,215139,244881,300708,17987,16136,7989,14116,14826,15284,13526,17786,19170,17988,15843,16887,30349,null,null,null,null,null,null,null,null,null,null,58038,41017,30167,41887,38627,41920,38134,39159,46038,42276,26546,37388,44297,null,null,null,null,null,null,null,null,null,null,29994,25276,18971,22320,24511,25556,22524,23599,21794,22965,16862,24157,28387,null,null,null,null,null,null,null,null,null,null,308876,288172,271344,280521,273755,273763,229748,208754,209499,243733,243605,283693,286044,null,null,null,null,null,null,null,null,null,null,36398,41653,33596,51142,50733,65955,50463,46671,51233,45638,37045,44800,46249,null,null,null,null,null,null,null,null,null,null,28722,18157,8145,22520,14694,13082,15178,15651,15537,16066,1379,845,344,null,null,null,null,null,null,null,null,null,null]}}
\ No newline at end of file
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/vsop_fylke_mnd.R
\name{fylkesvis_mnd}
\alias{fylkesvis_mnd}
\title{Fylkesvis pr mnd}
% Please edit documentation in R/lmd_avvirkning.R
\name{ld.fylke.mnd}
\alias{ld.fylke.mnd}
\title{LD: Fylkesvis pr mnd}
\usage{
fylkesvis_mnd()
ld.fylke.mnd()
}
\arguments{
\item{Behøver}{ingen parametere. Datafilene ligger i egen folder.}
......@@ -13,9 +13,11 @@ fylkesvis_mnd()
a tibble with logging statistics
}
\description{
a simple function to gather fylkesvise logging data from excel files
fylkesvise hogstdata fra landbruksdirektoratets excel-filer
Filene ligger i mappen ./inst/ekstdata og behøver derfor ikke hentes.
}
\examples{
devtools::install_github("hbelbo/vsop")
fylkesvis_mnd()
ld.fylke.mnd()
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/vsop_fylke_mnd.R
\name{kommunevis}
\alias{kommunevis}
\title{Kommunevis vsop}
% Please edit documentation in R/lmd_avvirkning.R
\name{ld.kommune}
\alias{ld.kommune}
\title{LD: Kommunevis}
\usage{
kommunevis()
ld.kommune()
}
\arguments{
\item{Behøver}{ingen parametere. Datafilene ligger i egen folder.}
......@@ -13,9 +13,9 @@ kommunevis()
a tibble with logging statistics
}
\description{
Kommunevis vsop
LD: Kommunevis
}
\examples{
devtools::install_github("hbelbo/vsop")
kommunevis()
ld.kommune()
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment