How to draw a funnel plot in R using Plot_ly function?
1
0
Entering edit mode
3.9 years ago

How to draw a funnel plot using plotly package in R.

My input data:

      Pathways                                        Corr

Glycolysis and Gluconeogenesis 0.455493708 Ethanol metabolism 0.429998123 Glycerophospholipid metabolism 0.421699867 Phosphoinositide Signalling 0.391815903 Purine metabolism 0.39031344 Cyclic nucleotides metabolism 0.383469071 Pyrimidine metabolism 0.382263162 Fatty acid metabolism 0.382037554 Sphingolipid metabolism 0.372782697 Xenobiotics metabolism 0.370505068

My code:

library(plotly) f <- as.data.frame(read.delim(file = "FUNNEL1.txt")) f1 <- as.data.frame(f) fig <- plot_ly(f1, type = "funnelarea") fig

R software error • 1.3k views
ADD COMMENT
1
Entering edit mode
3.9 years ago
Dunois ★ 2.8k

You need to specify what's going into the funnel plot with values and text.

plot_ly()  %>%
  add_trace(
    type = "funnelarea",
    values = f$Corr,
    text = f$Pathways)

funnelplot

ADD COMMENT
0
Entering edit mode

Thanks sir for your valuable help.

ADD REPLY
0
Entering edit mode

You're welcome!!

And you don't need to address me (or other random strangers) as "sir". We're just humans too, and there is no artificial hierarchy here. You are nobody's subordinate, and nobody is your superior.

(And besides, you don't necessarily know a user's gender, or whether they subscribe to the notion of having a gender, for that matter.)

ADD REPLY

Login before adding your answer.

Traffic: 2653 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