Re: [R] "In sqrt(VS) : NaNs produced"

2020-01-22 Thread Richard O'Keefe
> sqrt(c(1,-2,3))
[1] 1.00  NaN 1.732051
Warning message:
In sqrt(c(1, -2, 3)) : NaNs produced
You might want to put
if (any(VS < 0)) stop("some VS are negative")
just after the definition of VS.

On Tue, 21 Jan 2020 at 02:01, Atul Saini  wrote:
>
> Hello R,
>  I am attaching the script and data please help me to solve the
> problem of
>
> "In sqrt(VS) : NaNs produced"  with the p value of dumy$Mar
>
> Regards,
> __
> R-help@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.

__
R-help@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.


Re: [R] "In sqrt(VS) : NaNs produced"

2020-01-20 Thread John Kane
As a follow-up to Michael's post, here is a link to some advice on how
create the example.
/http://adv-r.had.co.nz/Reproducibility.html "> How to write a
reproducible example 


On Mon, 20 Jan 2020 at 08:49, Michael Dewey  wrote:

> Your script and data were stripped so we are none the wiser I am afraid.
> You need to embed the script in your post and give a minimal data-set
> which exhibits the problem using dput() and embed that in the post too.
>
> Michael
>
> On 19/01/2020 08:25, Atul Saini wrote:
> > Hello R,
> >   I am attaching the script and data please help me to solve
> the
> > problem of
> >
> > "In sqrt(VS) : NaNs produced"  with the p value of dumy$Mar
> >
> > Regards,
> > __
> > R-help@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.
> >
>
> --
> Michael
> http://www.dewey.myzen.co.uk/home.html
>
> __
> R-help@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.
>


-- 
John Kane
Kingston ON Canada

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] "In sqrt(VS) : NaNs produced"

2020-01-20 Thread Michael Dewey
Your script and data were stripped so we are none the wiser I am afraid. 
You need to embed the script in your post and give a minimal data-set 
which exhibits the problem using dput() and embed that in the post too.


Michael

On 19/01/2020 08:25, Atul Saini wrote:

Hello R,
  I am attaching the script and data please help me to solve the
problem of

"In sqrt(VS) : NaNs produced"  with the p value of dumy$Mar

Regards,
__
R-help@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.



--
Michael
http://www.dewey.myzen.co.uk/home.html

__
R-help@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.