TwoSampleMR | R package for performing 2-sample MR using MR-Base database | Encryption library
kandi X-RAY | TwoSampleMR Summary
kandi X-RAY | TwoSampleMR Summary
R package for performing 2-sample MR using MR-Base database
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of TwoSampleMR
TwoSampleMR Key Features
TwoSampleMR Examples and Code Snippets
Community Discussions
Trending Discussions on TwoSampleMR
QUESTION
I am trying to edit a function in R, the function is in a package called 'TwoSampleMR', the function itself is called 'forest_plot_1_to_many', the function plots a forest plot of multilple exposures against an outcome.
I want to change the size of the text within the plot, unfortunately the font size is pre set and cannot be edited the when the function is called. Therefore, I am trying to edit the function itself. A lot of articles say use trace() but this confuses me and i don't think it's what i'm looking for as I'm not fixing and error in the code, im just changing it.
one article I saw said use fix() or edit() fot edit the function, so I try: fix(fores_plot_1_to_many)
and got the edit pop up as a result, i make the adjustment - 'size=10' to 'size=15'.
but then the function doesn't work at all with an error:
could not find function "forest_plot_names2"
my question is can fix() and edit() be used to alter functions?
workable example: ...ANSWER
Answered 2019-Jan-05 at 13:52This probably happens because forest_plot_1_to_many
uses the unexported forest_plot_names2
function. Because forest_plot_1_to_many
is in the TwoSampleMR
namespace, it can 'see' other function in that namespace, even if they are not exported. When you copy the function to your global environment If you change the function's environment it can no longer 'see' those unexported functions. This is true if you use fix
, or if you simply print the function and copy/paste/edit/evaluate it manually.
For a quick-and-dirty work-around, you can use :::
to call unexported functions. When you fix
forest_plot_1_to_many
replace all calls to forest_plot_names2
with TwoSampleMR:::forest_plot_names2
. More complicated things are possible with e.g., fixInNamespace
but I don't have much experience with that.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install TwoSampleMR
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page