Skip to content

Commit a480818

Browse files
Merge branch 'master' into inherits
2 parents f0e05ab + 44b0ad9 commit a480818

File tree

4 files changed

+33
-45
lines changed

4 files changed

+33
-45
lines changed

R/FDboost.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ FDboost <- function(formula, ### response ~ xvars
456456
### save formula of FDboost before it is changed
457457
formulaFDboost <- formula
458458

459-
tf <- terms.formula(formula, specials = c("c"))
459+
tf <- terms.formula(formula, specials = "c")
460460
trmstrings <- attr(tf, "term.labels")
461461
equalBrackets <- NULL
462462
if(length(trmstrings) > 0){
@@ -465,8 +465,8 @@ FDboost <- function(formula, ### response ~ xvars
465465
## check if number of opening brackets is equal to number of closing brackets
466466
equalBrackets <- sapply(seq_along(trmstrings2), function(i)
467467
{
468-
sapply(regmatches(trmstrings2[i], gregexpr("\\(", trmstrings2[i])), length) ==
469-
sapply(regmatches(trmstrings2[i], gregexpr("\\)", trmstrings2[i])), length)
468+
lengths(regmatches(trmstrings2[i], gregexpr("\\(", trmstrings2[i]))) ==
469+
lengths(regmatches(trmstrings2[i], gregexpr("\\)", trmstrings2[i])))
470470
})
471471
}
472472

@@ -621,7 +621,7 @@ FDboost <- function(formula, ### response ~ xvars
621621
nr <- nrow(response)
622622
if(!is.list(time))
623623
stopifnot(ncol(response) == length(time)) else
624-
stopifnot(all(ncol(response) == sapply(time[sapply(time, is.vector)], length)))
624+
stopifnot(all(ncol(response) == lengths(time[sapply(time, is.vector)])))
625625
nc <- ncol(response)
626626
dresponse <- as.vector(response) # column-wise stacking of response
627627
## convert characters to factor
@@ -633,7 +633,7 @@ FDboost <- function(formula, ### response ~ xvars
633633
stopifnot(is.null(dim(response))) ## stopifnot(is.vector(response))
634634
# check length of response and its time and index
635635
if(is.list(time))
636-
stopifnot(all(length(response) == sapply(time, length)) & length(response) == length(id)) else
636+
stopifnot(all(length(response) == lengths(time)) & length(response) == length(id)) else
637637
stopifnot(length(response) == length(time) & length(response) == length(id))
638638

639639
if(anyNA(response)) warning("For non-grid observations the response should not contain missing values.")
@@ -944,7 +944,7 @@ FDboost <- function(formula, ### response ~ xvars
944944
### multiply integration weights numInt to weights and w
945945
if(is.numeric(numInt)){
946946
.numInt_len_check <- if(is.list(time))
947-
all(length(numInt) == sapply(time, length)) else
947+
all(length(numInt) == lengths(time)) else
948948
length(numInt) == length(time)
949949
if(!.numInt_len_check)
950950
stop("Length of integration weights and time vector are not equal.")

R/crossvalidation.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,7 +1248,7 @@ plot.validateFDboost <- function(x, riskopt=c("mean", "median"),
12481248
c(min(c(0, ylim[1] * ifelse(ylim[1] < 0, 2, 0.5))),
12491249
riskMean[paste(mOptMean)]), lty = 2)
12501250
legend("topright", legend=paste(c(mOptMean)),
1251-
lty=c(2), col=c("black"))
1251+
lty=2, col="black")
12521252

12531253
}
12541254

@@ -1261,7 +1261,7 @@ plot.validateFDboost <- function(x, riskopt=c("mean", "median"),
12611261
riskMedian[paste(mOptMedian)]), lty = 2)
12621262

12631263
legend("topright", legend=paste(c(mOptMedian)),
1264-
lty=c(2), col=c("black"))
1264+
lty=2, col="black")
12651265
}
12661266

12671267
}

R/utilityFunctions.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#' @export
1313
o_control <- function(k_min=20, rule=2, silent=TRUE, cyclic=FALSE, knots=NULL) {
1414
RET <- list(k_min=k_min, rule=rule, silent=silent, cyclic=cyclic, knots=knots)
15-
class(RET) <- c("offset_control")
15+
class(RET) <- "offset_control"
1616
RET
1717
}
1818

README.md

Lines changed: 24 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
1-
FDboost
2-
======
1+
# FDboost
32

4-
[![Build Status (Linux)](https://travis-ci.org/boost-R/FDboost.svg?branch=master)](https://travis-ci.org/boost-R/FDboost)
5-
<!--[![Build status (Windows)](https://ci.appveyor.com/api/projects/status/5mkvicgin1j6pfc6/branch/master?svg=true)](https://ci.appveyor.com/project/hofnerb/mboost-h73a1/branch/master) -->
6-
[![CRAN Status Badge](https://www.r-pkg.org/badges/version/FDboost)](https://cran.r-project.org/package=FDboost)
7-
<!--[![Coverage Status](https://coveralls.io/repos/github/boost-R/mboost/badge.svg?branch=master)](https://coveralls.io/github/boost-R/mboost?branch=master) -->
8-
[![](https://cranlogs.r-pkg.org/badges/FDboost)](https://cran.rstudio.com/web/packages/FDboost/index.html)
3+
<!-- badges: start -->
4+
5+
[![CRAN status](https://www.r-pkg.org/badges/version/FDboost)](https://CRAN.R-project.org/package=FDboost)
6+
[![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/FDboost)](https://www.r-pkg.org/pkg/FDboost)
7+
8+
<!-- badges: end -->
99

1010
`FDboost` Boosting Functional Regression Models.
1111

12-
The package FDboost fits regression models for functional data, i.e.,
12+
The package FDboost fits regression models for functional data, i.e.,
1313
scalar-on-function, function-on-scalar, and function-on-function regression models,
14-
by a component-wise gradient boosting algorithm.
14+
by a component-wise gradient boosting algorithm.
1515
Furthermore, it can be used to fit density-on-scalar regression models.
1616

1717
## Using FDboost
1818

1919
For installation instructions see below.
2020

2121
Instructions on how to use `FDboost` can be found in various places:
22+
2223
- Read the tutorial paper [doi:10.18637/jss.v094.i10](doi:10.18637/jss.v094.i10)
2324
- Have a look at the manual, which also contains example code
24-
- Check the vignettes:
25+
- Check the vignettes:
2526
- [function-on-function regression](https://cran.r-project.org/web/packages/FDboost/vignettes/FLAM_canada.pdf)
2627
- [scalar-on-function regression](https://cran.r-project.org/web/packages/FDboost/vignettes/FLAM_fuel.pdf)
2728
- [function-on-scalar regression](https://cran.r-project.org/web/packages/FDboost/vignettes/FLAM_viscosity.pdf)
@@ -31,30 +32,17 @@ Instructions on how to use `FDboost` can be found in various places:
3132

3233
For issues, bugs, feature requests etc. please use the [GitHub Issues](https://github.com/boost-R/FDboost/issues).
3334

34-
## Installation Instructions
35-
36-
- Current version (from CRAN):
37-
```r
38-
install.packages("FDboost")
39-
```
40-
41-
- Latest **patch version** (patched version of CRAN package; under development) from GitHub:
42-
```r
43-
library("devtools")
44-
install_github("boost-R/FDboost")
45-
library("FDboost")
46-
```
47-
48-
<!-- - Latest **development version** (version with new features; under development) from GitHub:
49-
```r
50-
library("devtools")
51-
install_github("boost-R/mboost", ref = "devel")
52-
library("mboost")
53-
```
54-
-->
55-
56-
To be able to use the `install_github()` command, one needs to install `devtools` first:
57-
```r
58-
install.packages("devtools")
59-
```
35+
## Installation
36+
37+
Install the last release from [CRAN](https://cran.r-project.org):
38+
39+
```r
40+
install.packages("FDboost")
41+
```
42+
43+
Install the development version from [GitHub](https://github.com/):
6044

45+
```r
46+
# install.packages("pak")
47+
pak::pak("boost-R/FDboost")
48+
```

0 commit comments

Comments
 (0)