qvalue density function error
1
0
Entering edit mode
Tim • 0
@47994544
Last seen 22 hours ago
Australia

I'm trying to run the following function

qval <- qvalue(DE.object$p.value[, 2], fdr.level = 0.05) 

And I get this error:
Error in density(x, adjust = adj) : unused argument (adjust = adj)

Can anyone help? Would be greatly appreciated

Thanks!

> sessionInfo()
R version 4.4.1 (2024-06-14 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 22631)
qvalue • 302 views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 2 days ago
United States

It's likely that stats::density.default got masked by a package that you loaded, and now the masking density function is being called, and it doesn't have an 'adjust' argument. You will get messages when functions are masked by package loading. As an example, here is what happens when I load dplyr

> library(dplyr)

Attaching package: 'dplyr'

The following objects are masked from 'package:stats':

    filter, lag

The following objects are masked from 'package:base':

    intersect, setdiff,
    setequal, union

And now if I try to use base::union without using the qualified name, I will get dplyr::union instead. If qvalue called stats::density directly it wouldn't be a problem, but it's not super common IME for people to write code that includes the qualified name for every function used (I sure don't do that...).

0
Entering edit mode

Thanks for your advice James. I couldn't find any other packages that use the density function. I also tried a simple test and got a different error:

> qval2 <- qvalue(c(0.1,0.2,0.5))
Error in smooth.spline(lambda, pi0, df = smooth.df) : 
  missing or infinite values in inputs are not allowed

Do you know what this error means?

```

ADD REPLY
0
Entering edit mode

I cleared the global environment, and that fixed the problem, qvalue is now working for me. Thanks for your help James, sorry I am still a beginner with R, am still learning how to use it properly.

Tim

ADD REPLY

Login before adding your answer.

Traffic: 783 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6