Functions with File names

I have been given a hypothesis test to solve. I have done this and now required to 'solve the problem with the following functions, called from a script'

The functions are hypothesis(file_name), Assumptions(file_name) etc

When i attempt this, It says the function hypothesis is unavailable even after i define the hypothesis for its own object. How can I insert a file (a csv file) directly into an object/function i have created?

How have you defined your hypothesis function?

hypothesis <- paste0("We are testing H0: Beta = 0 against H1: Beta != 0")

given the next function, assumptions, contains a set of functions relative to a data set (x)

How can i now carry out this function where i only have to type hypothesis(x), where x is the data set

But this doesn't do anything except paste text.

Something like

myFunction <- function(filename){
myObject <- read.csv(filename)
}

myNewObject <- myFunction("foo.csv")
1 Like

Thanks for that i managed to get it working.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.