Reputation: 2233
I have a complicated source code that makes use of several packages.Is there a way to get a list of the function and the package it associated with? for example in my code:
uploaded.data.Factors.Included <- reactive({
inFile <- input$datafile
if (is.null(inFile)) {return(NULL)}
SPY <- read.csv(inFile$datapath, header = input$header, sep = input$sep, quote = "")
How can I get somthing like :
uploaded.data.Factors.Included <- shiny::reactive({
inFile <- input$datafile
if (is.null(inFile)) {return(NULL)}
SPY <- base:: read.csv(inFile$datapath, header = input$header, sep = input$sep, quote = "")
Or as a list:
Shiny reactive
Base read.csv
Upvotes: 0
Views: 80
Reputation: 317
It seems that your question is different than I thought.
You have a script (not a package) that calls different functions from several packages. So:
library(dplyr)
library(tidyr)
select(df, var1, var2, var5) # part of dplyr
gather(data, key, value) # part of tidyr
And you would like to know to which package the functions belong? But not only that , but a list of all the functions in use in the script, with their package. I don't know a automated way to do that.
An idea (without code):
Upvotes: 0
Reputation: 317
I guess you could check the namespace of the package? I mean literally check the file NAMESPACE. It will contain all the exported functions of that package.
Upvotes: 1