[R] coursera course - assgnment - error : Error in which(!is.Na(content[["sulfate"]])) : , could not find function "is.Na"

David Winsemius dwinsemius at comcast.net
Thu Nov 3 18:59:33 CET 2016


> On Nov 3, 2016, at 9:40 AM, Roelof Wobben <r.wobben at home.nl> wrote:
> 
> Hello,
> 
> I want to try to get all the data of a cloumn namend "sulfate" which is not Na.
> 
> So I did :
> 
> corr <- function(directory, threshold = 0) {
> 
>  # lezen van alle bestanden in  de directory
> 
>  file_list <-  list.files( directory, pattern = "*.csv", full.names = TRUE)
> 
>   # lezen van alle bestanden in a loop
>  #  1) bepalen van de complete_cases
>  #  2) controleren of het hoger/lager is dan de treshold.
>  #  3) als het hoger is.
>  #     a) lezen van de nitraat en controleren of het geen Na is
>  #     b) lezen van de sulfaat en controleren of het geen Na is.
>  #     c) als beide geen Na zijn, dan de correlatie bepalen
> 
>  for(file in file_list) {
>    content <- read.csv(file)
>    if (complete.cases(content) > 0) {
>      sulfate <- which (!is.Na(content[["sulfate"]]))
>      print(sulfate)
> 
>    }
> 
>    }
> 
>  }
> 
> but now I see the above error.
> 
> What did I do wrong ?

You are sending a request for academic assistance to a mailing list that specifically describes an expectation that you will use the academic assistance resources are your institution of higher learning. Since Coursera is a fee-based enterprise now, I would expect that they have some sort of web-page interface for collaborating with your coursemates.

For this and other advice about constructing non-homework questions likely to get answers on Rhelp, you should read the Posting Guide whose link is appended to every distributed post to Rhelp.

-- 
David
> 
> Regards,
> 
> Roelof
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius
Alameda, CA, USA



More information about the R-help mailing list