Grokbase Groups R r-help June 2016
FAQ
Dear R users,


I have been using rnorm, rbinom and have been getting the following warning
message when I do not have any NAs in my generated values.


Warning messages:1: In rnorm(nref, mean = mu.m2[[k]], sd = sqrt(disp.m2[[k]])) :
   NAs produced




In one of the resources I found in over the internet explains that the
mean and sd should be declared as integers. So I tried that which did
not solve the issue.




Can anyone advise me on how to eliminate the warning message?




Thank you.


  [[alternative HTML version deleted]]

Search Discussions

  • Tom Wright at Jun 14, 2016 at 8:12 pm
    As you probably already guessed we are going to need to see the
    contents of nref, mu.m2 and disp.m2 to help.
    dput(nref)
    dput(mu.m2)
    dput(disp.m2)


    k might help too.

    On Tue, Jun 14, 2016 at 2:06 PM, JI Cho wrote:
    Dear R users,

    I have been using rnorm, rbinom and have been getting the following warning
    message when I do not have any NAs in my generated values.

    Warning messages:1: In rnorm(nref, mean = mu.m2[[k]], sd = sqrt(disp.m2[[k]])) :
    NAs produced


    In one of the resources I found in over the internet explains that the
    mean and sd should be declared as integers. So I tried that which did
    not solve the issue.


    Can anyone advise me on how to eliminate the warning message?


    Thank you.

    [[alternative HTML version deleted]]

    ______________________________________________
    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.
  • Bert Gunter at Jun 14, 2016 at 9:31 pm
    Do not believe everything you read on the internet!


    "In one of the resources I found in over the internet explains that the
    mean and sd should be declared as integers."


    That is compete crap. The mean of a norma/Gaussian can be any real;
    the sd can be any positive real.
    Moreover, one does not need to "declare" R variables. Have you gone
    through any R tutorials? -- there are many good ones on the web.
    Please do so if you haven't before posting here.


    Cheers,
    Bert


    Bert Gunter


    "The trouble with having an open mind is that people keep coming along
    and sticking things into it."
    -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )



    On Tue, Jun 14, 2016 at 11:06 AM, JI Cho wrote:
    Dear R users,

    I have been using rnorm, rbinom and have been getting the following warning
    message when I do not have any NAs in my generated values.

    Warning messages:1: In rnorm(nref, mean = mu.m2[[k]], sd = sqrt(disp.m2[[k]])) :
    NAs produced


    In one of the resources I found in over the internet explains that the
    mean and sd should be declared as integers. So I tried that which did
    not solve the issue.


    Can anyone advise me on how to eliminate the warning message?


    Thank you.

    [[alternative HTML version deleted]]

    ______________________________________________
    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.
  • Jim Lemon at Jun 14, 2016 at 11:30 pm
    Hi JI,
    The most likely problems are negative numbers for sd or "k" being
    larger than the number of mu.m2 or disp.m2 values.


    Jim

    On Wed, Jun 15, 2016 at 4:06 AM, JI Cho wrote:
    Dear R users,

    I have been using rnorm, rbinom and have been getting the following warning
    message when I do not have any NAs in my generated values.

    Warning messages:1: In rnorm(nref, mean = mu.m2[[k]], sd = sqrt(disp.m2[[k]])) :
    NAs produced


    In one of the resources I found in over the internet explains that the
    mean and sd should be declared as integers. So I tried that which did
    not solve the issue.


    Can anyone advise me on how to eliminate the warning message?


    Thank you.

    [[alternative HTML version deleted]]

    ______________________________________________
    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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupr-help @
categoriesr
postedJun 14, '16 at 6:06p
activeJun 14, '16 at 11:30p
posts4
users4
websiter-project.org
irc#r

People

Translate

site design / logo © 2017 Grokbase