Skip to content

Commit c661ef6

Browse files
committed
Make cov and cor similar to mean and var by removing keyword arguments.
This fixes #13081 and the type instability that motivated that issue.
1 parent d0a50e0 commit c661ef6

File tree

7 files changed

+165
-144
lines changed

7 files changed

+165
-144
lines changed

Diff for: NEWS.md

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Library improvements
2626
* The functions `remotecall`, `remotecall_fetch`, and `remotecall_wait` now have the
2727
function argument as the first argument to allow for do-block syntax ([#13338]).
2828

29+
* `cov` and `cor` don't use keyword arguments anymore and are therefore now type stable ([#13465]).
30+
2931
Deprecated or removed
3032
---------------------
3133

Diff for: base/deprecated.jl

+11-1
Original file line numberDiff line numberDiff line change
@@ -841,4 +841,14 @@ for f in (:remotecall, :remotecall_fetch, :remotecall_wait)
841841
@deprecate ($f)(w::Worker, f::Function, args...) ($f)(f, w::Worker, args...)
842842
@deprecate ($f)(id::Integer, f::Function, args...) ($f)(f, id::Integer, args...)
843843
end
844-
end
844+
end
845+
846+
@deprecate cov(x::AbstractVector; corrected=true, mean=nothing) covm(x, mean, corrected)
847+
@deprecate cov(X::AbstractMatrix; vardim=1, corrected=true, mean=nothing) covm(X, mean, vardim, corrected)
848+
@deprecate cov(x::AbstractVector, y::AbstractVector; corrected=true, mean=nothing) covm(x, mean[1], y, mean[2], corrected)
849+
@deprecate cov(X::AbstractVecOrMat, Y::AbstractVecOrMat; vardim=1, corrected=true, mean=nothing) covm(X, mean[1], Y, mean[2], vardim, corrected)
850+
851+
@deprecate cor(x::AbstractVector; mean=nothing) corm(x, mean)
852+
@deprecate cor(X::AbstractMatrix; vardim=1, mean=nothing) corm(X, mean, vardim)
853+
@deprecate cor(x::AbstractVector, y::AbstractVector; mean=nothing) corm(x, mean[1], y, mean[2])
854+
@deprecate cor(X::AbstractVecOrMat, Y::AbstractVecOrMat; vardim=1, mean=nothing) corm(X, mean[1], Y, mean[2], vardim)

Diff for: base/docs/helpdb.jl

-26
Original file line numberDiff line numberDiff line change
@@ -1140,15 +1140,6 @@ Get the precision of a floating point number, as defined by the effective number
11401140
"""
11411141
precision
11421142

1143-
doc"""
1144-
cor(v1[, v2][, vardim=1, mean=nothing])
1145-
1146-
Compute the Pearson correlation between the vector(s) in `v1` and `v2`.
1147-
1148-
Users can use the keyword argument `vardim` to specify the variable dimension, and `mean` to supply pre-computed mean values.
1149-
"""
1150-
cor
1151-
11521143
doc"""
11531144
partitions(n)
11541145
@@ -9003,23 +8994,6 @@ The process was stopped by a terminal interrupt (CTRL+C).
90038994
"""
90048995
InterruptException
90058996

9006-
doc"""
9007-
cov(v1[, v2][, vardim=1, corrected=true, mean=nothing])
9008-
9009-
Compute the Pearson covariance between the vector(s) in `v1` and `v2`. Here, `v1` and `v2` can be either vectors or matrices.
9010-
9011-
This function accepts three keyword arguments:
9012-
9013-
- `vardim`: the dimension of variables. When `vardim = 1`, variables are considered in columns while observations in rows; when `vardim = 2`, variables are in rows while observations in columns. By default, it is set to `1`.
9014-
- `corrected`: whether to apply Bessel's correction (divide by `n-1` instead of `n`). By default, it is set to `true`.
9015-
- `mean`: allow users to supply mean values that are known. By default, it is set to `nothing`, which indicates that the mean(s) are unknown, and the function will compute the mean. Users can use `mean=0` to indicate that the input data are centered, and hence there's no need to subtract the mean.
9016-
9017-
The size of the result depends on the size of `v1` and `v2`. When both `v1` and `v2` are vectors, it returns the covariance between them as a scalar. When either one is a matrix, it returns a covariance matrix of size `(n1, n2)`, where `n1` and `n2` are the numbers of slices in `v1` and `v2`, which depend on the setting of `vardim`.
9018-
9019-
Note: `v2` can be omitted, which indicates `v2 = v1`.
9020-
"""
9021-
cov
9022-
90238997
doc"""
90248998
den(x)
90258999

Diff for: base/statistics.jl

+86-87
Original file line numberDiff line numberDiff line change
@@ -261,66 +261,67 @@ unscaled_covzm(x::AbstractMatrix, y::AbstractMatrix, vardim::Int) =
261261

262262
# covzm (with centered data)
263263

264-
covzm(x::AbstractVector; corrected::Bool=true) = unscaled_covzm(x) / (length(x) - Int(corrected))
265-
266-
covzm(x::AbstractMatrix; vardim::Int=1, corrected::Bool=true) =
264+
covzm(x::AbstractVector, corrected::Bool=true) = unscaled_covzm(x) / (length(x) - Int(corrected))
265+
covzm(x::AbstractMatrix, vardim::Int=1, corrected::Bool=true) =
267266
scale!(unscaled_covzm(x, vardim), inv(size(x,vardim) - Int(corrected)))
268-
269-
covzm(x::AbstractVector, y::AbstractVector; corrected::Bool=true) =
267+
covzm(x::AbstractVector, y::AbstractVector, corrected::Bool=true) =
270268
unscaled_covzm(x, y) / (length(x) - Int(corrected))
271-
272-
covzm(x::AbstractVecOrMat, y::AbstractVecOrMat; vardim::Int=1, corrected::Bool=true) =
269+
covzm(x::AbstractVecOrMat, y::AbstractVecOrMat, vardim::Int=1, corrected::Bool=true) =
273270
scale!(unscaled_covzm(x, y, vardim), inv(_getnobs(x, y, vardim) - Int(corrected)))
274271

275272
# covm (with provided mean)
276273

277-
covm(x::AbstractVector, xmean; corrected::Bool=true) =
278-
covzm(x .- xmean; corrected=corrected)
274+
covm(x::AbstractVector, xmean, corrected::Bool=true) =
275+
covzm(x .- xmean, corrected)
276+
covm(x::AbstractMatrix, xmean, vardim::Int=1, corrected::Bool=true) =
277+
covzm(x .- xmean, vardim, corrected)
278+
covm(x::AbstractVector, xmean, y::AbstractVector, ymean, corrected::Bool=true) =
279+
covzm(x .- xmean, y .- ymean, corrected)
280+
covm(x::AbstractVecOrMat, xmean, y::AbstractVecOrMat, ymean, vardim::Int=1, corrected::Bool=true) =
281+
covzm(x .- xmean, y .- ymean, vardim, corrected)
279282

280-
covm(x::AbstractMatrix, xmean; vardim::Int=1, corrected::Bool=true) =
281-
covzm(x .- xmean; vardim=vardim, corrected=corrected)
283+
# cov (API)
284+
doc"""
285+
cov(x[, corrected=true])
282286
283-
covm(x::AbstractVector, xmean, y::AbstractVector, ymean; corrected::Bool=true) =
284-
covzm(x .- xmean, y .- ymean; corrected=corrected)
287+
Compute the variance of the vector `x`. If `corrected` is `true` (the default) then the sum is scaled with `n-1` wheares the sum is scaled with `n` if `corrected` is `false` where `n = length(x)`.
288+
"""
289+
cov(x::AbstractVector, corrected::Bool) = covm(x, Base.mean(x), corrected)
290+
# This ugly hack is necessary to make the method below considered more specific than the deprecated method. When the old keyword version has been completely deprecated, these two methods can be merged
291+
cov{T<:AbstractVector}(x::T) = covm(x, Base.mean(x), true)
285292

286-
covm(x::AbstractVecOrMat, xmean, y::AbstractVecOrMat, ymean; vardim::Int=1, corrected::Bool=true) =
287-
covzm(x .- xmean, y .- ymean; vardim=vardim, corrected=corrected)
293+
doc"""
294+
cov(X[, vardim=1, corrected=true])
288295
289-
# cov (API)
296+
Compute the covariance matrix of the matrix `X` along the dimension `vardim`. If `corrected` is `true` (the default) then the sum is scaled with `n-1` wheares the sum is scaled with `n` if `corrected` is `false` where `n = size(X, vardim)`.
297+
"""
298+
cov(X::AbstractMatrix, vardim::Int, corrected::Bool=true) =
299+
covm(X, _vmean(X, vardim), vardim, corrected)
300+
# This ugly hack is necessary to make the method below considered more specific than the deprecated method. When the old keyword version has been completely deprecated, these two methods can be merged
301+
cov{T<:AbstractMatrix}(X::T) = cov(X, 1, true)
290302

291-
function cov(x::AbstractVector; corrected::Bool=true, mean=nothing)
292-
mean == 0 ? covzm(x; corrected=corrected) :
293-
mean === nothing ? covm(x, Base.mean(x); corrected=corrected) :
294-
isa(mean, Number) ? covm(x, mean; corrected=corrected) :
295-
throw(ArgumentError("invalid value of mean, $(mean)::$(typeof(mean))"))
296-
end
303+
doc"""
304+
cov(x, y[, corrected=true])
297305
298-
function cov(x::AbstractMatrix; vardim::Int=1, corrected::Bool=true, mean=nothing)
299-
mean == 0 ? covzm(x; vardim=vardim, corrected=corrected) :
300-
mean === nothing ? covm(x, _vmean(x, vardim); vardim=vardim, corrected=corrected) :
301-
isa(mean, AbstractArray) ? covm(x, mean; vardim=vardim, corrected=corrected) :
302-
throw(ArgumentError("invalid value of mean, $(mean)::$(typeof(mean))"))
303-
end
306+
Compute the covariance between the vectors `x` and `y`. If `corrected` is `true` (the default) then the sum is scaled with `n-1` wheares the sum is scaled with `n` if `corrected` is `false` where `n = length(x) = length(y)`.
307+
"""
308+
cov(x::AbstractVector, y::AbstractVector, corrected::Bool) =
309+
covm(x, Base.mean(x), y, Base.mean(y), corrected)
310+
# This ugly hack is necessary to make the method below considered more specific than the deprecated method. When the old keyword version has been completely deprecated, these two methods can be merged
311+
cov{T<:AbstractVector,S<:AbstractVector}(x::T, y::S) =
312+
covm(x, Base.mean(x), y, Base.mean(y), true)
304313

305-
function cov(x::AbstractVector, y::AbstractVector; corrected::Bool=true, mean=nothing)
306-
mean == 0 ? covzm(x, y; corrected=corrected) :
307-
mean === nothing ? covm(x, Base.mean(x), y, Base.mean(y); corrected=corrected) :
308-
isa(mean, (Number,Number)) ? covm(x, mean[1], y, mean[2]; corrected=corrected) :
309-
throw(ArgumentError("invalid value of mean, $(mean)::$(typeof(mean))"))
310-
end
314+
doc"""
315+
cov(X, Y[, vardim=1, corrected=true])
311316
312-
function cov(x::AbstractVecOrMat, y::AbstractVecOrMat; vardim::Int=1, corrected::Bool=true, mean=nothing)
313-
if mean == 0
314-
covzm(x, y; vardim=vardim, corrected=corrected)
315-
elseif mean === nothing
316-
covm(x, _vmean(x, vardim), y, _vmean(y, vardim); vardim=vardim, corrected=corrected)
317-
elseif isa(mean, (Any,Any))
318-
covm(x, mean[1], y, mean[2]; vardim=vardim, corrected=corrected)
319-
else
320-
throw(ArgumentError("invalid value of mean, $(mean)::$(typeof(mean))"))
321-
end
322-
end
317+
Compute the covariance between the vectors or matrices `X` and `Y` along the dimension `vardim`. If `corrected` is `true` (the default) then the sum is scaled with `n-1` wheares the sum is scaled with `n` if `corrected` is `false` where `n = size(X, vardim) = size(Y, vardim)`.
323318
319+
"""
320+
cov(X::AbstractVecOrMat, Y::AbstractVecOrMat, vardim::Int, corrected::Bool=true) =
321+
covm(X, _vmean(X, vardim), Y, _vmean(Y, vardim), vardim, corrected)
322+
# This ugly hack is necessary to make the method below considered more specific than the deprecated method. When the old keyword version has been completely deprecated, these two methods can be merged
323+
cov{T<:AbstractVecOrMat,S<:AbstractVecOrMat}(X::T, Y::S) =
324+
covm(X, _vmean(X, vardim), Y, _vmean(Y, vardim), 1, true)
324325

325326
##### correlation #####
326327

@@ -340,7 +341,6 @@ function cov2cor!{T}(C::AbstractMatrix{T}, xsd::AbstractArray)
340341
end
341342
return C
342343
end
343-
344344
function cov2cor!(C::AbstractMatrix, xsd::Number, ysd::AbstractArray)
345345
nx, ny = size(C)
346346
length(ysd) == ny || throw(DimensionMismatch("inconsistent dimensions"))
@@ -351,7 +351,6 @@ function cov2cor!(C::AbstractMatrix, xsd::Number, ysd::AbstractArray)
351351
end
352352
return C
353353
end
354-
355354
function cov2cor!(C::AbstractMatrix, xsd::AbstractArray, ysd::Number)
356355
nx, ny = size(C)
357356
length(xsd) == nx || throw(DimensionMismatch("inconsistent dimensions"))
@@ -362,7 +361,6 @@ function cov2cor!(C::AbstractMatrix, xsd::AbstractArray, ysd::Number)
362361
end
363362
return C
364363
end
365-
366364
function cov2cor!(C::AbstractMatrix, xsd::AbstractArray, ysd::AbstractArray)
367365
nx, ny = size(C)
368366
(length(xsd) == nx && length(ysd) == ny) ||
@@ -378,10 +376,10 @@ end
378376
# corzm (non-exported, with centered data)
379377

380378
corzm{T}(x::AbstractVector{T}) = one(real(T))
381-
382-
corzm(x::AbstractMatrix; vardim::Int=1) =
383-
(c = unscaled_covzm(x, vardim); cov2cor!(c, sqrt!(diag(c))))
384-
379+
function corzm(x::AbstractMatrix, vardim::Int=1)
380+
c = unscaled_covzm(x, vardim)
381+
return cov2cor!(c, sqrt!(diag(c)))
382+
end
385383
function corzm(x::AbstractVector, y::AbstractVector)
386384
n = length(x)
387385
length(y) == n || throw(DimensionMismatch("inconsistent lengths"))
@@ -401,57 +399,58 @@ function corzm(x::AbstractVector, y::AbstractVector)
401399
end
402400
return xy / (sqrt(xx) * sqrt(yy))
403401
end
404-
405-
corzm(x::AbstractVector, y::AbstractMatrix; vardim::Int=1) =
402+
corzm(x::AbstractVector, y::AbstractMatrix, vardim::Int=1) =
406403
cov2cor!(unscaled_covzm(x, y, vardim), sqrt(sumabs2(x)), sqrt!(sumabs2(y, vardim)))
407-
408-
corzm(x::AbstractMatrix, y::AbstractVector; vardim::Int=1) =
404+
corzm(x::AbstractMatrix, y::AbstractVector, vardim::Int=1) =
409405
cov2cor!(unscaled_covzm(x, y, vardim), sqrt!(sumabs2(x, vardim)), sqrt(sumabs2(y)))
410-
411-
corzm(x::AbstractMatrix, y::AbstractMatrix; vardim::Int=1) =
406+
corzm(x::AbstractMatrix, y::AbstractMatrix, vardim::Int=1) =
412407
cov2cor!(unscaled_covzm(x, y, vardim), sqrt!(sumabs2(x, vardim)), sqrt!(sumabs2(y, vardim)))
413408

414409
# corm
415410

416411
corm{T}(x::AbstractVector{T}, xmean) = one(real(T))
412+
corm(x::AbstractMatrix, xmean, vardim::Int=1) = corzm(x .- xmean, vardim)
413+
corm(x::AbstractVector, xmean, y::AbstractVector, ymean) = corzm(x .- xmean, y .- ymean)
414+
corm(x::AbstractVecOrMat, xmean, y::AbstractVecOrMat, ymean, vardim::Int=1) =
415+
corzm(x .- xmean, y .- ymean, vardim)
417416

418-
corm(x::AbstractMatrix, xmean; vardim::Int=1) = corzm(x .- xmean; vardim=vardim)
417+
# cor
418+
doc"""
419+
cor(x)
419420
420-
corm(x::AbstractVector, xmean, y::AbstractVector, ymean) = corzm(x .- xmean, y .- ymean)
421+
Return the number one.
422+
"""
423+
cor{T<:AbstractVector}(x::T) = one(real(eltype(x)))
424+
# This ugly hack is necessary to make the method below considered more specific than the deprecated method. When the old keyword version has been completely deprecated, these two methods can be merged
421425

422-
corm(x::AbstractVecOrMat, xmean, y::AbstractVecOrMat, ymean; vardim::Int=1) =
423-
corzm(x .- xmean, y .- ymean; vardim=vardim)
426+
doc"""
427+
cor(X[, vardim=1])
424428
425-
# cor
429+
Compute the Pearson correlation matrix of the matrix `X` along the dimension `vardim`.
430+
"""
431+
cor(X::AbstractMatrix, vardim::Int) = corm(X, _vmean(X, vardim), vardim)
432+
# This ugly hack is necessary to make the method below considered more specific than the deprecated method. When the old keyword version has been completely deprecated, these two methods can be merged
433+
cor{T<:AbstractMatrix}(X::T) = corm(X, _vmean(X, vardim), 1)
426434

427-
cor{T}(x::AbstractVector{T}; mean=nothing) = one(real(T))
435+
doc"""
436+
cor(x, y)
428437
429-
function cor(x::AbstractMatrix; vardim::Int=1, mean=nothing)
430-
mean == 0 ? corzm(x; vardim=vardim) :
431-
mean === nothing ? corm(x, _vmean(x, vardim); vardim=vardim) :
432-
isa(mean, AbstractArray) ? corm(x, mean; vardim=vardim) :
433-
throw(ArgumentError("invalid value of mean, $(mean)::$(typeof(mean))"))
434-
end
438+
Compute the Pearson correlation between the vectors `x` and `y`.
439+
"""
440+
cor{T<:AbstractVector,S<:AbstractVector}(x::T, y::S) = corm(x, Base.mean(x), y, Base.mean(y))
441+
# This ugly hack is necessary to make the method below considered more specific than the deprecated method. When the old keyword version has been completely deprecated, these two methods can be merged
435442

436-
function cor(x::AbstractVector, y::AbstractVector; mean=nothing)
437-
mean == 0 ? corzm(x, y) :
438-
mean === nothing ? corm(x, Base.mean(x), y, Base.mean(y)) :
439-
isa(mean, (Number,Number)) ? corm(x, mean[1], y, mean[2]) :
440-
throw(ArgumentError("invalid value of mean, $(mean)::$(typeof(mean))"))
441-
end
443+
doc"""
444+
cor(X, Y[, vardim=1])
442445
443-
function cor(x::AbstractVecOrMat, y::AbstractVecOrMat; vardim::Int=1, mean=nothing)
444-
if mean == 0
445-
corzm(x, y; vardim=vardim)
446-
elseif mean === nothing
447-
corm(x, _vmean(x, vardim), y, _vmean(y, vardim); vardim=vardim)
448-
elseif isa(mean, (Any,Any))
449-
corm(x, mean[1], y, mean[2]; vardim=vardim)
450-
else
451-
throw(ArgumentError("invalid value of mean, $(mean)::$(typeof(mean))"))
452-
end
453-
end
446+
Compute the Pearson correlation between the vectors or matrices `X` and `Y` along the dimension `vardim`.
454447
448+
"""
449+
cor(x::AbstractVecOrMat, y::AbstractVecOrMat, vardim::Int) =
450+
corm(x, _vmean(x, vardim), y, _vmean(y, vardim), vardim)
451+
# This ugly hack is necessary to make the method below considered more specific than the deprecated method. When the old keyword version has been completely deprecated, these two methods can be merged
452+
cor(x::AbstractVecOrMat, y::AbstractVecOrMat) =
453+
corm(x, _vmean(x, vardim), y, _vmean(y, vardim), 1)
455454

456455
##### median & quantiles #####
457456

Diff for: doc/stdlib/math.rst

+35-11
Original file line numberDiff line numberDiff line change
@@ -1691,29 +1691,53 @@ Statistics
16911691
16921692
Like ``quantile``\ , but overwrites the input vector.
16931693

1694-
.. function:: cov(v1[, v2][, vardim=1, corrected=true, mean=nothing])
1694+
.. function:: cov(x[, corrected=true])
16951695

16961696
.. Docstring generated from Julia source
16971697
1698-
Compute the Pearson covariance between the vector(s) in ``v1`` and ``v2``\ . Here, ``v1`` and ``v2`` can be either vectors or matrices.
1698+
Compute the variance of the vector ``x``\ . If ``corrected`` is ``true`` (the default) then the sum is scaled with ``n-1`` wheares the sum is scaled with ``n`` if ``corrected`` is ``false`` where ``n = length(x)``\ .
16991699

1700-
This function accepts three keyword arguments:
1700+
.. function:: cov(X[, vardim=1, corrected=true])
17011701

1702-
* ``vardim``\ : the dimension of variables. When ``vardim = 1``\ , variables are considered in columns while observations in rows; when ``vardim = 2``\ , variables are in rows while observations in columns. By default, it is set to ``1``\ .
1703-
* ``corrected``\ : whether to apply Bessel's correction (divide by ``n-1`` instead of ``n``\ ). By default, it is set to ``true``\ .
1704-
* ``mean``\ : allow users to supply mean values that are known. By default, it is set to ``nothing``\ , which indicates that the mean(s) are unknown, and the function will compute the mean. Users can use ``mean=0`` to indicate that the input data are centered, and hence there's no need to subtract the mean.
1702+
.. Docstring generated from Julia source
1703+
1704+
Compute the covariance matrix of the matrix ``X`` along the dimension ``vardim``\ . If ``corrected`` is ``true`` (the default) then the sum is scaled with ``n-1`` wheares the sum is scaled with ``n`` if ``corrected`` is ``false`` where ``n = size(X, vardim)``\ .
1705+
1706+
.. function:: cov(x, y[, corrected=true])
1707+
1708+
.. Docstring generated from Julia source
17051709
1706-
The size of the result depends on the size of ``v1`` and ``v2``\ . When both ``v1`` and ``v2`` are vectors, it returns the covariance between them as a scalar. When either one is a matrix, it returns a covariance matrix of size ``(n1, n2)``\ , where ``n1`` and ``n2`` are the numbers of slices in ``v1`` and ``v2``\ , which depend on the setting of ``vardim``\ .
1710+
Compute the covariance between the vectors ``x`` and ``y``\ . If ``corrected`` is ``true`` (the default) then the sum is scaled with ``n-1`` wheares the sum is scaled with ``n`` if ``corrected`` is ``false`` where ``n = length(x) = length(y)``\ .
17071711

1708-
Note: ``v2`` can be omitted, which indicates ``v2 = v1``\ .
1712+
.. function:: cov(X, Y[, vardim=1, corrected=true])
17091713

1710-
.. function:: cor(v1[, v2][, vardim=1, mean=nothing])
1714+
.. Docstring generated from Julia source
1715+
1716+
Compute the covariance between the vectors or matrices ``X`` and ``Y`` along the dimension ``vardim``\ . If ``corrected`` is ``true`` (the default) then the sum is scaled with ``n-1`` wheares the sum is scaled with ``n`` if ``corrected`` is ``false`` where ``n = size(X, vardim) = size(Y, vardim)``\ .
1717+
1718+
.. function:: cor(x)
17111719

17121720
.. Docstring generated from Julia source
17131721
1714-
Compute the Pearson correlation between the vector(s) in ``v1`` and ``v2``\ .
1722+
Return the number one.
1723+
1724+
.. function:: cor(X[, vardim=1])
1725+
1726+
.. Docstring generated from Julia source
1727+
1728+
Compute the Pearson correlation matrix of the matrix ``X`` along the dimension ``vardim``\ .
1729+
1730+
.. function:: cor(x, y)
1731+
1732+
.. Docstring generated from Julia source
1733+
1734+
Compute the Pearson correlation between the vectors ``x`` and ``y``\ .
1735+
1736+
.. function:: cor(X, Y[, vardim=1])
1737+
1738+
.. Docstring generated from Julia source
17151739
1716-
Users can use the keyword argument ``vardim`` to specify the variable dimension, and ``mean`` to supply pre-computed mean values.
1740+
Compute the Pearson correlation between the vectors or matrices ``X`` and ``Y`` along the dimension ``vardim``\ .
17171741

17181742
Signal Processing
17191743
-----------------

Diff for: test/docs.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ f12593_2() = 1
415415
@test (Docs.@repl @r_str) !== nothing
416416

417417
# Simple tests for apropos:
418-
@test contains(sprint(apropos, "pearson"), "cov")
418+
@test contains(sprint(apropos, "pearson"), "cor")
419419
@test contains(sprint(apropos, r"ind(exes|ices)"), "eachindex")
420420
@test contains(sprint(apropos, "print"), "Profile.print")
421421

0 commit comments

Comments
 (0)