Interactive plot

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Interactive plot

Ron_M
Hi all,

I have created following codes :


mat = cbind(c(0.000059710430,0.000023057380), c(0.000023057380, 0.00005971089))
set.seed = 1000
vary = runif(dim(mat)[1], 2000, 3000)
calc = function(mat, vary)
    {
     result = vector(length = (length(vary)+1))
     result[1] = sqrt(t(vary) %*% vary)
     for (i in 1 : length(vary))
        {
         result[(i+1)] = sum(vary)*sum(vary*mat[,i])
        }
     barplot(result)
     return(result)
    }


Now I want to present the plot in some interactive manner. I want to put a slider in the plot where user move the slider for the 1st element of the vector "vary" and automatically this result will be reflected at the plot window. I already gone through some examples of "tkrplot" library, however unfortunately could not figure out how i can apply them in my problem.

If anyone here explain me how to do that I would be grateful.

Regards,


Send instant messages to your online friends http://uk.messenger.yahoo.com 
        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
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: Interactive plot

Liviu Andronic
On 6/29/08, Ron Michael <[hidden email]> wrote:
>  Now I want to present the plot in some interactive manner. I want to put a slider in the plot where user move the slider for the 1st element of the vector "vary" and automatically this result will be reflected at the plot window.
>
playwith: A GUI for interactive plots using GTK+ ? [1]

[1] http://cran.at.r-project.org/web/packages/playwith/index.html

______________________________________________
[hidden email] mailing list
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: Interactive plot

Ron_M
whenever I try to load "playwith" package I get following error :
 
> library(playwith)
Loading required package: lattice
Loading required package: grid
Error in inDL(x, as.logical(local), as.logical(now), ...) :
  unable to load shared library 'C:/PROGRA~1/R/R-27~1.1/library/RGtk2/libs/RGtk2.dll':
  LoadLibrary failure:  The specified module could not be found.

Error: package/namespace load failed for 'playwith'

What to do?

--- On Sun, 29/6/08, Liviu Andronic <[hidden email]> wrote:

From: Liviu Andronic <[hidden email]>
Subject: Re: [R] Interactive plot
To: "Ron Michael" <[hidden email]>
Cc: [hidden email]
Date: Sunday, 29 June, 2008, 7:46 PM

On 6/29/08, Ron Michael <[hidden email]> wrote:
>  Now I want to present the plot in some interactive manner. I want to put
a slider in the plot where user move the slider for the 1st element of the
vector "vary" and automatically this result will be reflected at the
plot window.
>
playwith: A GUI for interactive plots using GTK+ ? [1]

[1] http://cran.at.r-project.org/web/packages/playwith/index.html

Send instant messages to your online friends http://uk.messenger.yahoo.com 
        [[alternative HTML version deleted]]


______________________________________________
[hidden email] mailing list
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: Interactive plot

Gabor Grothendieck
Install the GTK runtime:

http://www.ggobi.org/rgtk2/

On Sun, Jun 29, 2008 at 9:06 AM, Ron Michael <[hidden email]> wrote:

> whenever I try to load "playwith" package I get following error :
>
>> library(playwith)
> Loading required package: lattice
> Loading required package: grid
> Error in inDL(x, as.logical(local), as.logical(now), ...) :
>   unable to load shared library 'C:/PROGRA~1/R/R-27~1.1/library/RGtk2/libs/RGtk2.dll':
>   LoadLibrary failure:  The specified module could not be found.
>
> Error: package/namespace load failed for 'playwith'
>
> What to do?
>
> --- On Sun, 29/6/08, Liviu Andronic <[hidden email]> wrote:
>
> From: Liviu Andronic <[hidden email]>
> Subject: Re: [R] Interactive plot
> To: "Ron Michael" <[hidden email]>
> Cc: [hidden email]
> Date: Sunday, 29 June, 2008, 7:46 PM
>
> On 6/29/08, Ron Michael <[hidden email]> wrote:
>>  Now I want to present the plot in some interactive manner. I want to put
> a slider in the plot where user move the slider for the 1st element of the
> vector "vary" and automatically this result will be reflected at the
> plot window.
>>
> playwith: A GUI for interactive plots using GTK+ ? [1]
>
> [1] http://cran.at.r-project.org/web/packages/playwith/index.html
>
> Send instant messages to your online friends http://uk.messenger.yahoo.com
>        [[alternative HTML version deleted]]
>
>
> ______________________________________________
> [hidden email] mailing list
> 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
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: Interactive plot

Ron_M
Hi, whenever I try to load the playwith package I am getting following warning :
 
> library(playwith)
Loading required package: lattice
Loading required package: grid
Warning message:
In namespaceImportFrom(self, asNamespace(ns)) :
  replacing previous import: addhandler

Can anyone please tell me why I am getting that warning?

--- On Sun, 29/6/08, Gabor Grothendieck <[hidden email]> wrote:

From: Gabor Grothendieck <[hidden email]>
Subject: Re: [R] Interactive plot
To: [hidden email]
Cc: [hidden email]
Date: Sunday, 29 June, 2008, 8:18 PM

Install the GTK runtime:

http://www.ggobi.org/rgtk2/

On Sun, Jun 29, 2008 at 9:06 AM, Ron Michael <[hidden email]>
wrote:
> whenever I try to load "playwith" package I get following error
:
>
>> library(playwith)
> Loading required package: lattice
> Loading required package: grid
> Error in inDL(x, as.logical(local), as.logical(now), ...) :
>   unable to load shared library
'C:/PROGRA~1/R/R-27~1.1/library/RGtk2/libs/RGtk2.dll':

>   LoadLibrary failure:  The specified module could not be found.
>
> Error: package/namespace load failed for 'playwith'
>
> What to do?
>
> --- On Sun, 29/6/08, Liviu Andronic <[hidden email]> wrote:
>
> From: Liviu Andronic <[hidden email]>
> Subject: Re: [R] Interactive plot
> To: "Ron Michael" <[hidden email]>
> Cc: [hidden email]
> Date: Sunday, 29 June, 2008, 7:46 PM
>
> On 6/29/08, Ron Michael <[hidden email]> wrote:
>>  Now I want to present the plot in some interactive manner. I want to
put
> a slider in the plot where user move the slider for the 1st element of the
> vector "vary" and automatically this result will be reflected at
the

> plot window.
>>
> playwith: A GUI for interactive plots using GTK+ ? [1]
>
> [1] http://cran.at.r-project.org/web/packages/playwith/index.html
>
> Send instant messages to your online friends http://uk.messenger.yahoo.com
>        [[alternative HTML version deleted]]
>
>
> ______________________________________________
> [hidden email] mailing list
> 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.
>
>

Send instant messages to your online friends http://uk.messenger.yahoo.com 
        [[alternative HTML version deleted]]


______________________________________________
[hidden email] mailing list
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: Interactive plot

Ron_M
Hi all R users. I already done through some of the examples given with playwith packages and feel nowhere they are matching with my requirement. Can amyone please suggest me how to create my desired interactive plot with "tkrplot" ?
 
I want following. Let look at following codes :
 
mat = cbind(c(0.000059710430,0.000023057380), c(0.000023057380, 0.00005971089)) set.seed = 1000 vary = runif(dim(mat)[1], 2000, 3000) calc = function(mat, vary)
{
result = vector(length = (length(vary)+1))
result[1] = sqrt(t(vary) %*% vary)
for (i in 1 : length(vary))
{
result[(i+1)] = sum(vary)*sum(vary*mat[,i])
}
barplot(result)
return(result)
}
 
Now I want to put a slider in the plot where user move the slider for the 1st element of the vector "vary" and automatically this result will be reflected at the plot window. Can anyone please tell me how to do that with tkrplot or TeachingDemos ?
 
 


--- On Sun, 29/6/08, Ron Michael <[hidden email]> wrote:

From: Ron Michael <[hidden email]>
Subject: Re: [R] Interactive plot
To: "Gabor Grothendieck" <[hidden email]>
Cc: [hidden email]
Date: Sunday, 29 June, 2008, 11:48 PM

Hi, whenever I try to load the playwith package I am getting following warning :
 
> library(playwith)
Loading required package: lattice
Loading required package: grid
Warning message:
In namespaceImportFrom(self, asNamespace(ns)) :
  replacing previous import: addhandler

Can anyone please tell me why I am getting that warning?

--- On Sun, 29/6/08, Gabor Grothendieck <[hidden email]> wrote:

From: Gabor Grothendieck <[hidden email]>
Subject: Re: [R] Interactive plot
To: [hidden email]
Cc: [hidden email]
Date: Sunday, 29 June, 2008, 8:18 PM

Install the GTK runtime:

http://www.ggobi.org/rgtk2/

On Sun, Jun 29, 2008 at 9:06 AM, Ron Michael <[hidden email]>
wrote:
> whenever I try to load "playwith" package I get following error
:
>
>> library(playwith)
> Loading required package: lattice
> Loading required package: grid
> Error in inDL(x, as.logical(local), as.logical(now), ...) :
>   unable to load shared library
'C:/PROGRA~1/R/R-27~1.1/library/RGtk2/libs/RGtk2.dll':

>   LoadLibrary failure:  The specified module could not be found.
>
> Error: package/namespace load failed for 'playwith'
>
> What to do?
>
> --- On Sun, 29/6/08, Liviu Andronic <[hidden email]> wrote:
>
> From: Liviu Andronic <[hidden email]>
> Subject: Re: [R] Interactive plot
> To: "Ron Michael" <[hidden email]>
> Cc: [hidden email]
> Date: Sunday, 29 June, 2008, 7:46 PM
>
> On 6/29/08, Ron Michael <[hidden email]> wrote:
>>  Now I want to present the plot in some interactive manner. I want to
put
> a slider in the plot where user move the slider for the 1st element of the
> vector "vary" and automatically this result will be reflected at
the

> plot window.
>>
> playwith: A GUI for interactive plots using GTK+ ? [1]
>
> [1] http://cran.at.r-project.org/web/packages/playwith/index.html
>
> Send instant messages to your online friends http://uk.messenger.yahoo.com
>        [[alternative HTML version deleted]]
>
>
> ______________________________________________
> [hidden email] mailing list
> 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.
>
>

Send instant messages to your online friends http://uk.messenger.yahoo.com 
        [[alternative HTML version deleted]]______________________________________________
[hidden email] mailing list
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.

Send instant messages to your online friends http://uk.messenger.yahoo.com 
        [[alternative HTML version deleted]]


______________________________________________
[hidden email] mailing list
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: Interactive plot

Gabor Grothendieck
In ?playwith the third example seems pretty close to what you
want.  Here it is changed to correspond to your setup.

Remove the barplot line from calc since we don't want calc to do
any plotting and then try this:

library(lattice)
playwith(barchart(seq_along(result) ~ result,
        data = data.frame(result = calc(mat, c(alpha, vary[2])))),
        parameters = list(alpha = seq(2000, 3000, by = 10)))



On Sun, Jun 29, 2008 at 1:07 PM, Ron Michael <[hidden email]> wrote:

> Hi all R users. I already done through some of the examples given with playwith packages and feel nowhere they are matching with my requirement. Can amyone please suggest me how to create my desired interactive plot with "tkrplot" ?
>
> I want following. Let look at following codes :
>
> mat = cbind(c(0.000059710430,0.000023057380), c(0.000023057380, 0.00005971089)) set.seed = 1000 vary = runif(dim(mat)[1], 2000, 3000) calc = function(mat, vary)
> {
> result = vector(length = (length(vary)+1))
> result[1] = sqrt(t(vary) %*% vary)
> for (i in 1 : length(vary))
> {
> result[(i+1)] = sum(vary)*sum(vary*mat[,i])
> }
> barplot(result)
> return(result)
> }
>
> Now I want to put a slider in the plot where user move the slider for the 1st element of the vector "vary" and automatically this result will be reflected at the plot window. Can anyone please tell me how to do that with tkrplot or TeachingDemos ?
>
>
>
>
> --- On Sun, 29/6/08, Ron Michael <[hidden email]> wrote:
>
> From: Ron Michael <[hidden email]>
> Subject: Re: [R] Interactive plot
> To: "Gabor Grothendieck" <[hidden email]>
> Cc: [hidden email]
> Date: Sunday, 29 June, 2008, 11:48 PM
>
> Hi, whenever I try to load the playwith package I am getting following warning :
>
>> library(playwith)
> Loading required package: lattice
> Loading required package: grid
> Warning message:
> In namespaceImportFrom(self, asNamespace(ns)) :
>   replacing previous import: addhandler
>
> Can anyone please tell me why I am getting that warning?
>
> --- On Sun, 29/6/08, Gabor Grothendieck <[hidden email]> wrote:
>
> From: Gabor Grothendieck <[hidden email]>
> Subject: Re: [R] Interactive plot
> To: [hidden email]
> Cc: [hidden email]
> Date: Sunday, 29 June, 2008, 8:18 PM
>
> Install the GTK runtime:
>
> http://www.ggobi.org/rgtk2/
>
> On Sun, Jun 29, 2008 at 9:06 AM, Ron Michael <[hidden email]>
> wrote:
>> whenever I try to load "playwith" package I get following error
> :
>>
>>> library(playwith)
>> Loading required package: lattice
>> Loading required package: grid
>> Error in inDL(x, as.logical(local), as.logical(now), ...) :
>>   unable to load shared library
> 'C:/PROGRA~1/R/R-27~1.1/library/RGtk2/libs/RGtk2.dll':
>>   LoadLibrary failure:  The specified module could not be found.
>>
>> Error: package/namespace load failed for 'playwith'
>>
>> What to do?
>>
>> --- On Sun, 29/6/08, Liviu Andronic <[hidden email]> wrote:
>>
>> From: Liviu Andronic <[hidden email]>
>> Subject: Re: [R] Interactive plot
>> To: "Ron Michael" <[hidden email]>
>> Cc: [hidden email]
>> Date: Sunday, 29 June, 2008, 7:46 PM
>>
>> On 6/29/08, Ron Michael <[hidden email]> wrote:
>>>  Now I want to present the plot in some interactive manner. I want to
> put
>> a slider in the plot where user move the slider for the 1st element of the
>> vector "vary" and automatically this result will be reflected at
> the
>> plot window.
>>>
>> playwith: A GUI for interactive plots using GTK+ ? [1]
>>
>> [1] http://cran.at.r-project.org/web/packages/playwith/index.html
>>
>> Send instant messages to your online friends http://uk.messenger.yahoo.com
>>        [[alternative HTML version deleted]]
>>
>>
>> ______________________________________________
>> [hidden email] mailing list
>> 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.
>>
>>
>
> Send instant messages to your online friends http://uk.messenger.yahoo.com
>        [[alternative HTML version deleted]]______________________________________________
> [hidden email] mailing list
> 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.
>
> Send instant messages to your online friends http://uk.messenger.yahoo.com
>        [[alternative HTML version deleted]]
>
>
> ______________________________________________
> [hidden email] mailing list
> 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
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: Interactive plot

Ron_M
It is not working here. I am getting following errors [big list :( ] :
 
> library(playwith)
Loading required package: grid
Warning message:
In namespaceImportFrom(self, asNamespace(ns)) :
  replacing previous import: addhandler
> library(lattice)
> playwith(barchart(seq_along(result) ~ result,
+ data = data.frame(result = calc(mat, c(alpha, vary[2])))),
+ parameters = list(alpha = seq(2000, 3000, by = 10)))
Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Go back to previous plot call") :
  Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin, GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Go forward to next plot call") :
  Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin, GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Redraw the current plot (hold Shift for full reload)") :
  Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin, GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Show help page for this plot function") :
  Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin, GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
Loading required package: RGtk2
Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Always show this window") :
  Cannot find 'tooltip-text' to set in GtkToggleToolButton, GtkToolButton, GtkToolItem, GtkBin, GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Keep this window, do not replace it (open next plot in a new window)") :
  Cannot find 'tooltip-text' to set in GtkToggleToolButton, GtkToolButton, GtkToolItem, GtkBin, GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Copy this plot to the clipboard (as a bitmap)") :
  Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin, GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "View and edit attached data objects") :
  Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin, GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Change the plot type and settings") :
  Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin, GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Choose Lattice theme") :
  Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin, GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Time mode: scroll along the x-axis") :
  Cannot find 'tooltip-text' to set in GtkToggleToolButton, GtkToolButton, GtkToolItem, GtkBin, GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Choose a panel to expand and focus (for further interaction)") :
  Cannot find 'tooltip-text' to set in GtkToggleToolButton, GtkToolButton, GtkToolItem, GtkBin, GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Identify data points by clicking on them") :
  Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin, GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Add your own labels to the plot") :
  Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin, GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Add an arrow to the plot") :
  Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin, GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Edit annotations (including arrows)") :
  Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin, GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Remove labels and annotations") :
  Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin, GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Select a new plot region with the mouse") :
  Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin, GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Zoom out to show 4x plot area") :
  Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin, GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Show the full scale starting from zero") :
  Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin, GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject

 
 
Any idea how to fix that?
 


--- On Mon, 30/6/08, Gabor Grothendieck <[hidden email]> wrote:

From: Gabor Grothendieck <[hidden email]>
Subject: Re: [R] Interactive plot
To: [hidden email]
Cc: [hidden email]
Date: Monday, 30 June, 2008, 12:30 AM

In ?playwith the third example seems pretty close to what you
want.  Here it is changed to correspond to your setup.

Remove the barplot line from calc since we don't want calc to do
any plotting and then try this:

library(lattice)
playwith(barchart(seq_along(result) ~ result,
        data = data.frame(result = calc(mat, c(alpha, vary[2])))),
        parameters = list(alpha = seq(2000, 3000, by = 10)))



On Sun, Jun 29, 2008 at 1:07 PM, Ron Michael <[hidden email]>
wrote:
> Hi all R users. I already done through some of the examples given with
playwith packages and feel nowhere they are matching with my requirement. Can
amyone please suggest me how to create my desired interactive plot with
"tkrplot" ?
>
> I want following. Let look at following codes :
>
> mat = cbind(c(0.000059710430,0.000023057380), c(0.000023057380,
0.00005971089)) set.seed = 1000 vary = runif(dim(mat)[1], 2000, 3000) calc =
function(mat, vary)

> {
> result = vector(length = (length(vary)+1))
> result[1] = sqrt(t(vary) %*% vary)
> for (i in 1 : length(vary))
> {
> result[(i+1)] = sum(vary)*sum(vary*mat[,i])
> }
> barplot(result)
> return(result)
> }
>
> Now I want to put a slider in the plot where user move the slider for the
1st element of the vector "vary" and automatically this result will
be reflected at the plot window. Can anyone please tell me how to do that with
tkrplot or TeachingDemos ?

>
>
>
>
> --- On Sun, 29/6/08, Ron Michael <[hidden email]> wrote:
>
> From: Ron Michael <[hidden email]>
> Subject: Re: [R] Interactive plot
> To: "Gabor Grothendieck" <[hidden email]>
> Cc: [hidden email]
> Date: Sunday, 29 June, 2008, 11:48 PM
>
> Hi, whenever I try to load the playwith package I am getting following
warning :

>
>> library(playwith)
> Loading required package: lattice
> Loading required package: grid
> Warning message:
> In namespaceImportFrom(self, asNamespace(ns)) :
>   replacing previous import: addhandler
>
> Can anyone please tell me why I am getting that warning?
>
> --- On Sun, 29/6/08, Gabor Grothendieck <[hidden email]>
wrote:

>
> From: Gabor Grothendieck <[hidden email]>
> Subject: Re: [R] Interactive plot
> To: [hidden email]
> Cc: [hidden email]
> Date: Sunday, 29 June, 2008, 8:18 PM
>
> Install the GTK runtime:
>
> http://www.ggobi.org/rgtk2/
>
> On Sun, Jun 29, 2008 at 9:06 AM, Ron Michael
<[hidden email]>
> wrote:
>> whenever I try to load "playwith" package I get following
error

> :
>>
>>> library(playwith)
>> Loading required package: lattice
>> Loading required package: grid
>> Error in inDL(x, as.logical(local), as.logical(now), ...) :
>>   unable to load shared library
> 'C:/PROGRA~1/R/R-27~1.1/library/RGtk2/libs/RGtk2.dll':
>>   LoadLibrary failure:  The specified module could not be found.
>>
>> Error: package/namespace load failed for 'playwith'
>>
>> What to do?
>>
>> --- On Sun, 29/6/08, Liviu Andronic <[hidden email]>
wrote:
>>
>> From: Liviu Andronic <[hidden email]>
>> Subject: Re: [R] Interactive plot
>> To: "Ron Michael" <[hidden email]>
>> Cc: [hidden email]
>> Date: Sunday, 29 June, 2008, 7:46 PM
>>
>> On 6/29/08, Ron Michael <[hidden email]> wrote:
>>>  Now I want to present the plot in some interactive manner. I want
to
> put
>> a slider in the plot where user move the slider for the 1st element of
the
>> vector "vary" and automatically this result will be
reflected at
> the
>> plot window.
>>>
>> playwith: A GUI for interactive plots using GTK+ ? [1]
>>
>> [1] http://cran.at.r-project.org/web/packages/playwith/index.html
>>
>> Send instant messages to your online friends

>>        [[alternative HTML version deleted]]
>>
>>
>> ______________________________________________
>> [hidden email] mailing list
>> 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.
>>
>>
>
> Send instant messages to your online friends http://uk.messenger.yahoo.com
>        [[alternative HTML version
deleted]]______________________________________________
> [hidden email] mailing list
> 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.
>
> Send instant messages to your online friends http://uk.messenger.yahoo.com
>        [[alternative HTML version deleted]]
>
>
> ______________________________________________
> [hidden email] mailing list
> 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.
>
>

Send instant messages to your online friends http://uk.messenger.yahoo.com 
        [[alternative HTML version deleted]]


______________________________________________
[hidden email] mailing list
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: Interactive plot

Gabor Grothendieck
I get those errors too but it works anyways.

On Sun, Jun 29, 2008 at 2:09 PM, Ron Michael <[hidden email]> wrote:

> It is not working here. I am getting following errors [big list :( ] :
>
>
>
>> library(playwith)
>
> Loading required package: grid
> Warning message:
> In namespaceImportFrom(self, asNamespace(ns)) :
>   replacing previous import: addhandler
>> library(lattice)
>> playwith(barchart(seq_along(result) ~ result,
> + data = data.frame(result = calc(mat, c(alpha, vary[2])))),
> + parameters = list(alpha = seq(2000, 3000, by = 10)))
> Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Go back to
> previous plot call") :
>   Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin,
> GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
> Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Go forward to next
> plot call") :
>   Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin,
> GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
> Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Redraw the current
> plot (hold Shift for full reload)") :
>   Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin,
> GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
> Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Show help page for
> this plot function") :
>   Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin,
> GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
> Loading required package: RGtk2
> Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Always show this
> window") :
>   Cannot find 'tooltip-text' to set in GtkToggleToolButton, GtkToolButton,
> GtkToolItem, GtkBin, GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned,
> GObject, RGtkObject
> Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Keep this window,
> do not replace it (open next plot in a new window)") :
>   Cannot find 'tooltip-text' to set in GtkToggleToolButton, GtkToolButton,
> GtkToolItem, GtkBin, GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned,
> GObject, RGtkObject
> Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Copy this plot to
> the clipboard (as a bitmap)") :
>   Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin,
> GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
> Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "View and edit
> attached data objects") :
>   Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin,
> GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
> Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Change the plot
> type and settings") :
>   Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin,
> GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
> Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Choose Lattice
> theme") :
>   Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin,
> GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
> Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Time mode: scroll
> along the x-axis") :
>   Cannot find 'tooltip-text' to set in GtkToggleToolButton, GtkToolButton,
> GtkToolItem, GtkBin, GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned,
> GObject, RGtkObject
> Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Choose a panel to
> expand and focus (for further interaction)") :
>   Cannot find 'tooltip-text' to set in GtkToggleToolButton, GtkToolButton,
> GtkToolItem, GtkBin, GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned,
> GObject, RGtkObject
> Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Identify data
> points by clicking on them") :
>   Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin,
> GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
> Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Add your own
> labels to the plot") :
>   Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin,
> GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
> Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Add an arrow to
> the plot") :
>   Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin,
> GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
> Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Edit annotations
> (including arrows)") :
>   Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin,
> GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
> Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Remove labels and
> annotations") :
>   Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin,
> GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
> Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Select a new plot
> region with the mouse") :
>   Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin,
> GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
> Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Zoom out to show
> 4x plot area") :
>   Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin,
> GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
> Error in `[[<-.GObject`(`*tmp*`, "tooltip-text", value = "Show the full
> scale starting from zero") :
>   Cannot find 'tooltip-text' to set in GtkToolButton, GtkToolItem, GtkBin,
> GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
>
>
>
>
>
> Any idea how to fix that?
>
>
>
> --- On Mon, 30/6/08, Gabor Grothendieck <[hidden email]> wrote:
>
> From: Gabor Grothendieck <[hidden email]>
> Subject: Re: [R] Interactive plot
> To: [hidden email]
> Cc: [hidden email]
> Date: Monday, 30 June, 2008, 12:30 AM
>
> In ?playwith the third example seems pretty close to what you
> want.  Here it is changed to correspond to your setup.
> Remove the barplot line from calc since we don't want calc to do
> any plotting and then try this:
> library(lattice)
> playwith(barchart(seq_along(result) ~ result,
> data = data.frame(result = calc(mat, c(alpha, vary[2])))),
> parameters = list(alpha = seq(2000, 3000, by = 10)))
> On Sun, Jun 29, 2008 at 1:07 PM, Ron Michael <[hidden email]>
> wrote:
>> Hi all R users. I already done through some of the examples given with
> playwith packages and feel nowhere they are matching with my requirement.
> Can
> amyone please suggest me how to create my desired interactive plot with
> "tkrplot" ?
>>
>> I want following. Let look at following codes :
>>
>> mat = cbind(c(0.000059710430,0.000023057380), c(0.000023057380,
> 0.00005971089)) set.seed = 1000 vary = runif(dim(mat)[1], 2000, 3000) calc =
> function(mat, vary)
>> {
>> result = vector(length = (length(vary)+1))
>> result[1] = sqrt(t(vary) %*% vary)
>> for (i in 1 : length(vary))
>> {
>> result[(i+1)] = sum(vary)*sum(vary*mat[,i])
>> }
>> barplot(result)
>> return(result)
>> }
>>
>> Now I want to put a slider in the plot where user move the slider for the
> 1st element of the vector "vary" and automatically this result will
> be reflected at the plot window. Can anyone please tell me how to do that
> with
> tkrplot or TeachingDemos ?
>>
>>
>>
>>
>> --- On Sun, 29/6/08, Ron Michael <[hidden email]> wrote:
>>
>> From: Ron Michael <[hidden email]>
>> Subject: Re: [R] Interactive plot
>> To: "Gabor Grothendieck" <[hidden email]>
>> Cc: [hidden email]
>> Date: Sunday, 29 June, 2008, 11:48 PM
>>
>> Hi, whenever I try to load the playwith package I am getting following
> warning :
>>
>>> library(playwith)
>> Loading required package: lattice
>> Loading required package: grid
>> Warning message:
>> In namespaceImportFrom(self, asNamespace(ns)) :
>>   replacing previous import: addhandler
>>
>> Can anyone please tell me why I am getting that warning?
>>
>> --- On Sun, 29/6/08, Gabor Grothendieck <[hidden email]>
> wrote:
>>
>> From: Gabor Grothendieck <[hidden email]>
>> Subject: Re: [R] Interactive plot
>> To: [hidden email]
>> Cc: [hidden email]
>> Date: Sunday, 29 June, 2008, 8:18 PM
>>
>> Install the GTK runtime:
>>
>> http://www.ggobi.org/rgtk2/
>>
>> On Sun, Jun 29, 2008 at 9:06 AM, Ron Michael
> <[hidden email]>
>> wrote:
>>> whenever I try to load "playwith" package I get following
> error
>> :
>>>
>>>> library(playwith)
>>> Loading required package: lattice
>>> Loading required package: grid
>>> Error in inDL(x, as.logical(local), as.logical(now), ...) :
>>>   unable to load shared library
>> 'C:/PROGRA~1/R/R-27~1.1/library/RGtk2/libs/RGtk2.dll':
>>>   LoadLibrary failure:  The specified module could not be found.
>>>
>>> Error: package/namespace load failed for 'playwith'
>>>
>>> What to do?
>>>
>>> --- On Sun, 29/6/08, Liviu Andronic <[hidden email]>
> wrote:
>>>
>>> From: Liviu Andronic <[hidden email]>
>>> Subject: Re: [R] Interactive plot
>>> To: "Ron Michael" <[hidden email]>
>>> Cc: [hidden email]
>>> Date: Sunday, 29 June, 2008, 7:46 PM
>>>
>>> On 6/29/08, Ron Michael <[hidden email]> wrote:
>>>>  Now I want to present the plot in some interactive manner. I want
> to
>> put
>>> a slider in the plot where user move the slider for the 1st element of
> the
>>> vector "vary" and automatically this result will be
> reflected at
>> the
>>> plot window.
>>>>
>>> playwith: A GUI for interactive plots using GTK+ ? [1]
>>>
>>> [1] http://cran.at.r-project.org/web/packages/playwith/index.html
>>>
>>> Send instant messages to your online friends
> http://uk.messenger.yahoo.com
>>>        [[alternative HTML version deleted]]
>>>
>>>
>>> ______________________________________________
>>> [hidden email] mailing list
>>> 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.
>>>
>>>
>>
>> Send instant messages to your online friends http://uk.messenger.yahoo.com
>>        [[alternative HTML version
> deleted]]______________________________________________
>> [hidden email] mailing list
>> 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.
>>
>> Send instant messages to your online friends http://uk.messenger.yahoo.com
>>        [[alternative HTML version deleted]]
>>
>>
>> ______________________________________________
>> [hidden email] mailing list
>> 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.
>>
>>
>
> Send instant messages to your online friends http://uk.messenger.yahoo.com

______________________________________________
[hidden email] mailing list
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: Interactive plot

Greg Snow-2
In reply to this post by Ron_M
Here is a way that works for me using tkexamp in the TeachingDemos package (which uses tkrplot internally):

calc2 <- function(mat, vary1=0, vary2=0) calc(mat, c(vary1,vary2))

library(TeachingDemos)
tkexamp( calc2(mat, vary2=vary[2]),
        list(vary1=list('slider',from=0,to=4000, resolution=100, init=vary[1])))

# or

tkexamp( calc2(mat),
        list( vary1=list('slider', from=0, to=4000, resolution=100, init=vary[1]),
                vary2=list('slider', from=0, to=4000, resolution=100, init=vary[2])))

If you really want to use tkrplot directly, let me know, but it is a lot more code than above.

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[hidden email]
(801) 408-8111



> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Ron Michael
> Sent: Saturday, June 28, 2008 11:00 PM
> To: [hidden email]
> Subject: [R] Interactive plot
>
> Hi all,
>
> I have created following codes :
>
>
> mat = cbind(c(0.000059710430,0.000023057380),
> c(0.000023057380, 0.00005971089)) set.seed = 1000 vary =
> runif(dim(mat)[1], 2000, 3000) calc = function(mat, vary)
>     {
>      result = vector(length = (length(vary)+1))
>      result[1] = sqrt(t(vary) %*% vary)
>      for (i in 1 : length(vary))
>         {
>          result[(i+1)] = sum(vary)*sum(vary*mat[,i])
>         }
>      barplot(result)
>      return(result)
>     }
>
>
> Now I want to present the plot in some interactive manner. I
> want to put a slider in the plot where user move the slider
> for the 1st element of the vector "vary" and automatically
> this result will be reflected at the plot window. I already
> gone through some examples of "tkrplot" library, however
> unfortunately could not figure out how i can apply them in my problem.
>
> If anyone here explain me how to do that I would be grateful.
>
> Regards,
>
>
> Send instant messages to your online friends
> http://uk.messenger.yahoo.com
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> 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
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.