something weird has happened....!!!!!!!!!!

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

something weird has happened....!!!!!!!!!!

akshay kulkarni
dear Members,



Today something weird has happened on my R console. I have attached two screenshots of the same vector in my R console but they differ.


Also one of my function returns negative values, even after double checking the code, which should return only positive values..


Whats wrong..? Reinstall R?


Thanks for help....


AKSHAY M KULKARNI



______________________________________________
[hidden email] 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.

rscreenshot1.png (336K) Download Attachment
Rscreenshot2.png (348K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: something weird has happened....!!!!!!!!!!

Duncan Murdoch-2
On 15/12/2017 7:45 AM, akshay kulkarni wrote:
> dear Members,
>
>
>
> Today something weird has happened on my R console. I have attached two screenshots of the same vector in my R console but they differ.

Those are function calls, you aren't just printing the same vector
twice, you're producing two vectors.

But in what way do they differ?  I looked at 3 entries, and they were
identical.

Duncan Murdoch

>
>
> Also one of my function returns negative values, even after double checking the code, which should return only positive values..
>
>
> Whats wrong..? Reinstall R?
>
>
> Thanks for help....
>
>
> AKSHAY M KULKARNI
>
>
>
>
> ______________________________________________
> [hidden email] 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.
>

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: something weird has happened....!!!!!!!!!!

R help mailing list-2
In reply to this post by akshay kulkarni
Dear Akshay,
Where is the problem !!Two data set seems identical  except one of them show 10 column and other showing 11 column on r console .  
Regards.............Tanvir Ahamed    Stockholm, Sweden     |  [hidden email]  

    On Friday, December 15, 2017, 3:49:03 PM GMT+1, akshay kulkarni <[hidden email]> wrote:  
 
 dear Members,



Today something weird has happened on my R console. I have attached two screenshots of the same vector in my R console but they differ.


Also one of my function returns negative values, even after double checking the code, which should return only positive values..


Whats wrong..? Reinstall R?


Thanks for help....


AKSHAY M KULKARNI

______________________________________________
[hidden email] 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.  
        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: something weird has happened....!!!!!!!!!!

Jeff Newmiller
In reply to this post by Duncan Murdoch-2
Entry 250 is different between the two. However, I (we?) have no idea what that function is so it might be using randomness as part of its calculation.
--
Sent from my phone. Please excuse my brevity.

On December 15, 2017 7:11:30 AM PST, Duncan Murdoch <[hidden email]> wrote:

>On 15/12/2017 7:45 AM, akshay kulkarni wrote:
>> dear Members,
>>
>>
>>
>> Today something weird has happened on my R console. I have attached
>two screenshots of the same vector in my R console but they differ.
>
>Those are function calls, you aren't just printing the same vector
>twice, you're producing two vectors.
>
>But in what way do they differ?  I looked at 3 entries, and they were
>identical.
>
>Duncan Murdoch
>>
>>
>> Also one of my function returns negative values, even after double
>checking the code, which should return only positive values..
>>
>>
>> Whats wrong..? Reinstall R?
>>
>>
>> Thanks for help....
>>
>>
>> AKSHAY M KULKARNI
>>
>>
>>
>>
>> ______________________________________________
>> [hidden email] 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.
>>
>
>______________________________________________
>[hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: something weird has happened....!!!!!!!!!!

MacQueen, Don
In reply to this post by akshay kulkarni
You could try this and see what you get:

  unique(  yguii(ZEEL.NS, "o") - yguii(ZEEL.NS, "o")  )

or maybe

  table(  yguii(ZEEL.NS, "o") - yguii(ZEEL.NS, "o")  )

You showed two sets of output from the expression
   yguii(ZEEL.NS, "o")

Were they done one right after the other? Or could ZEEL.NS have changed in between?

The function could be using a variable that's only defined in the global environment (presumably by mistake, but it's an easy mistake to make), and its value changed in between function calls.

Reinstalling R would be a waste of time.

-Don

--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
 
 

On 12/15/17, 4:45 AM, "R-help on behalf of akshay kulkarni" <[hidden email] on behalf of [hidden email]> wrote:

    dear Members,
   
   
   
    Today something weird has happened on my R console. I have attached two screenshots of the same vector in my R console but they differ.
   
   
    Also one of my function returns negative values, even after double checking the code, which should return only positive values..
   
   
    Whats wrong..? Reinstall R?
   
   
    Thanks for help....
   
   
    AKSHAY M KULKARNI
   
   
   

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: something weird has happened....!!!!!!!!!!

R help mailing list-2
You can see if your function uses R's random number generator with
the following function.

isRandom <- function(expr) {
    randomSeedBefore <- get0(".Random.seed")
    force(expr)
    !identical(randomSeedBefore, get0(".Random.seed"))
}
isRandom(1:10)
#[1] FALSE
isRandom(runif(3)>.4)
#[1] TRUE

It gives a false negative if a function restores .Random.seed after making
some random numbers, but that is fairly uncommon.  It may give misleading
results if you use functions like parLapply.



Bill Dunlap
TIBCO Software
wdunlap tibco.com

On Fri, Dec 15, 2017 at 8:52 AM, MacQueen, Don <[hidden email]> wrote:

> You could try this and see what you get:
>
>   unique(  yguii(ZEEL.NS, "o") - yguii(ZEEL.NS, "o")  )
>
> or maybe
>
>   table(  yguii(ZEEL.NS, "o") - yguii(ZEEL.NS, "o")  )
>
> You showed two sets of output from the expression
>    yguii(ZEEL.NS, "o")
>
> Were they done one right after the other? Or could ZEEL.NS have changed in
> between?
>
> The function could be using a variable that's only defined in the global
> environment (presumably by mistake, but it's an easy mistake to make), and
> its value changed in between function calls.
>
> Reinstalling R would be a waste of time.
>
> -Don
>
> --
> Don MacQueen
> Lawrence Livermore National Laboratory
> 7000 East Ave., L-627
> Livermore, CA 94550
> 925-423-1062
> Lab cell 925-724-7509
>
>
>
> On 12/15/17, 4:45 AM, "R-help on behalf of akshay kulkarni" <
> [hidden email] on behalf of [hidden email]> wrote:
>
>     dear Members,
>
>
>
>     Today something weird has happened on my R console. I have attached
> two screenshots of the same vector in my R console but they differ.
>
>
>     Also one of my function returns negative values, even after double
> checking the code, which should return only positive values..
>
>
>     Whats wrong..? Reinstall R?
>
>
>     Thanks for help....
>
>
>     AKSHAY M KULKARNI
>
>
>
>
> ______________________________________________
> [hidden email] 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.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: something weird has happened....!!!!!!!!!!

David Winsemius
In reply to this post by akshay kulkarni

> On Dec 15, 2017, at 4:45 AM, akshay kulkarni <[hidden email]> wrote:
>
> dear Members,
>
>
>
> Today something weird has happened on my R console. I have attached two screenshots of the same vector in my R console but they differ.
>
>
> Also one of my function returns negative values, even after double checking the code, which should return only positive values..
>
>
> Whats wrong..? Reinstall R?
>
>
> Thanks for help....

We have no way of knowing what the function `yguii` might be doing. Apparently it has some sort of "random" internal process. If you want to see whether this is really a deterministic process (a pseudo-random process), then you should use `set.seed` to establish a reproducible state in the RNG prior to your function call.

>
>
> AKSHAY M KULKARNI
>
>
> <rscreenshot1.png><Rscreenshot2.png>______________________________________________
> [hidden email] 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

'Any technology distinguishable from magic is insufficiently advanced.'   -Gehm's Corollary to Clarke's Third Law

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: something weird has happened....!!!!!!!!!!

Jeff Newmiller
In reply to this post by Jeff Newmiller
Be sure to keep the mailing list in the loop by using reply-all or equivalent in your email program.

You can use the set.seed function with any fixed value before you call functions that use randomness to create a reproducible output.
--
Sent from my phone. Please excuse my brevity.

On December 15, 2017 9:07:24 AM PST, akshay kulkarni <[hidden email]> wrote:

>dear Jeff,
>
>                 I think you have hit the bulls eye.
>
>I am using MICE to populate NA values(imputation) in the source data.
>Everytime I call the function MICE populates different values instead
>of the NA's , right? Is this the randomness you are speaking about?
>
>
>I will test the function again tomorrow. Hope you are right....!!!!!!
>
>
>Thanks a lot......!!!!!!!!
>
>
>yours
>
>AKSHAY M KULKARNI
>
>________________________________
>From: Jeff Newmiller <[hidden email]>
>Sent: Friday, December 15, 2017 10:09 PM
>To: [hidden email]; Duncan Murdoch; akshay kulkarni;
>[hidden email]
>Subject: Re: [R] something weird has happened....!!!!!!!!!!
>
>Entry 250 is different between the two. However, I (we?) have no idea
>what that function is so it might be using randomness as part of its
>calculation.
>--
>Sent from my phone. Please excuse my brevity.
>
>On December 15, 2017 7:11:30 AM PST, Duncan Murdoch
><[hidden email]> wrote:
>>On 15/12/2017 7:45 AM, akshay kulkarni wrote:
>>> dear Members,
>>>
>>>
>>>
>>> Today something weird has happened on my R console. I have attached
>>two screenshots of the same vector in my R console but they differ.
>>
>>Those are function calls, you aren't just printing the same vector
>>twice, you're producing two vectors.
>>
>>But in what way do they differ?  I looked at 3 entries, and they were
>>identical.
>>
>>Duncan Murdoch
>>>
>>>
>>> Also one of my function returns negative values, even after double
>>checking the code, which should return only positive values..
>>>
>>>
>>> Whats wrong..? Reinstall R?
>>>
>>>
>>> Thanks for help....
>>>
>>>
>>> AKSHAY M KULKARNI
>>>
>>>
>>>
>>>
>>> ______________________________________________
>>> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>R-help -- Main R Mailing List: Primary help - Homepage -
>SfS<https://stat.ethz.ch/mailman/listinfo/r-help>
>stat.ethz.ch
>The main R mailing list, for announcements about the development of R
>and the availability of new code, questions and answers about problems
>and solutions using R ...
>
>
>
>>> PLEASE do read the posting guide
>>http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>>>
>>
>>______________________________________________
>>[hidden email] mailing list -- To UNSUBSCRIBE and more, see
>>https://stat.ethz.ch/mailman/listinfo/r-help
>R-help -- Main R Mailing List: Primary help - Homepage -
>SfS<https://stat.ethz.ch/mailman/listinfo/r-help>
>stat.ethz.ch
>The main R mailing list, for announcements about the development of R
>and the availability of new code, questions and answers about problems
>and solutions using R ...
>
>
>
>>PLEASE do read the posting guide
>>http://www.R-project.org/posting-guide.html
>>and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: [FORGED] something weird has happened....!!!!!!!!!!

Rolf Turner
In reply to this post by akshay kulkarni
On 16/12/17 01:45, akshay kulkarni wrote:

> dear Members,
>
>
>
> Today something weird has happened on my R console. I have attached two screenshots of the same vector in my R console but they differ.
>
>
> Also one of my function returns negative values, even after double checking the code, which should return only positive values..
>
>
> Whats wrong..?

How on earth could anyone possibly tell on the basis of the (opaque)
pseudo-information that you have given us?

> Reinstall R?

It is possible, but *highly unlikely* that this is what you should do.

As I said, it's impossible to suggest what you really should do unless
you provide some genuine information.

Few members of this list are telepathic.  I certainly am not.

cheers,

Rolf Turner

--
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

______________________________________________
[hidden email] 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.