Skip to content

Commit

Permalink
Merge pull request #112 from tianshu129/develop
Browse files Browse the repository at this point in the history
v2.0.7.2
  • Loading branch information
tianshu129 authored Apr 6, 2022
2 parents 1b1622b + 7431e0d commit 60226fa
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 18 deletions.
5 changes: 2 additions & 3 deletions R/fm.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@
#'
#' @param p a ggplot-format plot.
#' @param fsz font size in plot.
#' @param ff font family in plot.
#' @param lsz line size of panel border and axis in plot.
#' @param tkl tick length in plot.
#' @return a plot with a new theme.

#' @export
#' @import ggplot2

fm=function(p, fsz=13, ff="TT Arial", lsz=0.5, tkl=0.2){
fm=function(p, fsz=13, lsz=0.5, tkl=0.2){
fm1= theme_bw()
fm2= theme(axis.text = element_text(size=fsz,family=ff), text = element_text(size=fsz,family=ff), legend.text = element_text(size=fsz,family=ff))
fm2= theme(axis.text = element_text(size=fsz), text = element_text(size=fsz), legend.text = element_text(size=fsz))
fm3=theme(panel.border = element_rect(fill=NA,color="black", size=unit(lsz,"cm"), linetype="solid"), axis.line = element_line(colour = "black", size = unit(lsz,"cm")),axis.ticks = element_line(colour = "black", size = unit(lsz,"cm")),
axis.ticks.length=unit(tkl,"cm"),legend.box.margin=margin(-10,-10,-10,-10))
p=p+fm1+fm2+fm3
Expand Down
7 changes: 4 additions & 3 deletions R/geom_psd.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,24 @@
#' @param trans character string, "identity" or "log10". transformation of color bar breaks.
#' @param colsz numeric value, size of columns in plot.
#' @param fsz font size in plot.
#' @param ff font family in plot.
#' @param lsz line size of panel border and axis in plot.
#' @param tkl tick length in plot.
#' @return a plot for the time series of particle size distribution. \cr
#'
#' @export
#' @examples
#' \dontrun{
#' dn_table = read.delim(system.file("extdata", "smps.txt", package = "foqat"),
#' check.names = FALSE)
#' dn1_table=dn_table[,c(1,5:148)]
#' dn1_table[,1]=as.POSIXct(dn1_table[,1], format="%m/%d/%Y %H:%M:%S", tz="GMT")
#' geom_psd(dn1_table,fsz=10)
#' }
#' @import ggplot2
#' @importFrom scales rescale pretty_breaks
#' @importFrom grDevices colorRampPalette

geom_psd=function(df, labxyl=NULL, logy=TRUE, ybk=NULL, nlmt=NULL, csbk=pretty_breaks(4), trans="identity", colsz=1, fsz=13, ff="TT Arial", lsz=0.4, tkl=0.2){
geom_psd=function(df, labxyl=NULL, logy=TRUE, ybk=NULL, nlmt=NULL, csbk=pretty_breaks(4), trans="identity", colsz=1, fsz=13, lsz=0.4, tkl=0.2){
#trans from table to list
df=transp(df)

Expand Down Expand Up @@ -98,7 +99,7 @@ geom_psd=function(df, labxyl=NULL, logy=TRUE, ybk=NULL, nlmt=NULL, csbk=pretty_b
#annotation_logticks
p=p+annotation_logticks(sides = 'lr')

p=fm(p, fsz=fsz, ff=ff, lsz=lsz, tkl=tkl)
p=fm(p, fsz=fsz, lsz=lsz, tkl=tkl)

return(p)
}
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ version](http://www.r-pkg.org/badges/version/foqat)](http://www.r-pkg.org/pkg/fo
state and is being actively
developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Development
version](https://img.shields.io/badge/devel-2.0.6-orange.svg)](https://github.com/tianshu129/foqat)
version](https://img.shields.io/badge/devel-2.0.7-orange.svg)](https://github.com/tianshu129/foqat)
[![](https://cranlogs.r-pkg.org/badges/grand-total/foqat)](https://cran.r-project.org/package=foqat)
[![](http://cranlogs.r-pkg.org/badges/last-month/foqat)](https://cran.r-project.org/package=foqat)
[![](http://cranlogs.r-pkg.org/badges/last-day/foqat)](http://cranlogs.r-pkg.org/downloads/daily/last-month/foqat)
Expand All @@ -24,17 +24,17 @@ downloads](http://cranlogs.r-pkg.org/badges/foqat)](http://www.r-pkg.org/pkg/foq

### Overview

The FOQAT is an R package designed for quick processing and analysis of atmospheric data measured from field observation and air pollution. And the functions for time series analysis could also be applied to the time series of any other fields.
The FOQAT is an R package designed for quick processing and analysis of atmospheric data measured from field observation and air pollution (e.g., air-quality sensor/monitor data). And the functions for time series analysis could also be applied to the time series of any other fields.

The FOQAT stands for "Field observation quick analysis toolkit".

The FOQAT package is developed and maintained by Chen Tianshu from Professor Xue Likun's research group of Environmental Research Institute of Shandong University.

For getting start or detail usage, please visit: [user manual](https://tianshu129.github.io/foqat/articles/) or [说明手册](https://www.yuque.com/foqat/doc) .
For getting start or detail usage, please visit: [Vignette](https://tianshu129.github.io/foqat/articles/) or [说明手册](https://www.yuque.com/foqat/doc) .

If FOQAT is used to support a scientific publication, please cite the following reference:

>_Tianshu Chen. (2021). foqat: Field Observation Quick Analysis Toolkit [Software]. Available from https://doi.org/10.5281/zenodo.4735828_
>Tianshu Chen. (2021). foqat: Field Observation Quick Analysis Toolkit [Software]. Available from https://doi.org/10.5281/zenodo.4735828
In addition, please send an email to [me](mailto:[email protected]) so that the paper may be added to my 'List of Publications Using FOQAT'.

Expand Down Expand Up @@ -63,7 +63,7 @@ remotes::install_github("tianshu129/foqat")

### Functions
Functions in foqat are listed below:
<img src="https://s4.ax1x.com/2022/02/01/HF4zDg.png" align="center"/>
<img src="https://s1.ax1x.com/2022/04/06/qvG8DU.png" align="center"/>


### Link
Expand Down
4 changes: 1 addition & 3 deletions man/fm.Rd

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

5 changes: 2 additions & 3 deletions man/geom_psd.Rd

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

2 changes: 1 addition & 1 deletion vignettes/Basic_Functions.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ statdf(aqi)

## Resample time series

We can resample time series by using `trs()`.
We can resample time series by using `trs()`, which will give you a new time series with new resolution and complete timestamps.
You can use `bkip` to set a new time resolution.
The time series can be clipped by using `st` (start time) and `et` (end time).
The default function of resampling is `mean`.
Expand Down

0 comments on commit 60226fa

Please sign in to comment.