Re: [R] dplyr - add/expand rows

2017-11-28 Thread Michael Lawrence
Or with the Bioconductor IRanges package:

df <- with(input, DataFrame(station, year=IRanges(from, to), record))
expand(df, "year")

DataFrame with 24 rows and 3 columns
station year  record
  
1   07EA001  1960 QMS
2   07EA001  1961 QMC
3   07EA001  1962 QMC
4   07EA001  1963 QMC
5   07EA001  1964 QMC
... ...   ... ...
20  07EA001  1979 QRC
21  07EA001  1980 QRC
22  07EA001  1981 QRC
23  07EA001  1982 QRC
24  07EA001  1983 QRC

If you tell the computer more about your data, it can do more things for
you.

Michael

On Tue, Nov 28, 2017 at 7:34 AM, Martin Morgan <
martin.mor...@roswellpark.org> wrote:

> On 11/26/2017 08:42 PM, jim holtman wrote:
>
>> try this:
>>
>> ##
>>
>> library(dplyr)
>>
>> input <- tribble(
>>~station, ~from, ~to, ~record,
>>   "07EA001" ,1960  ,  1960  , "QMS",
>>   "07EA001"  ,   1961 ,   1970  , "QMC",
>>   "07EA001" ,1971  ,  1971  , "QMM",
>>   "07EA001" ,1972  ,  1976  , "QMC",
>>   "07EA001" ,1977  ,  1983  , "QRC"
>> )
>>
>> result <- input %>%
>>rowwise() %>%
>>do(tibble(station = .$station,
>>  year = seq(.$from, .$to),
>>  record = .$record)
>>)
>>
>> ###
>>
>
> In a bit more 'base R' mode I did
>
>   input$year <- with(input, Map(seq, from, to))
>   res0 <- with(input, Map(data.frame, station=station, year=year,
>   record=record))
>as_tibble(do.call(rbind, unname(res0)))# A tibble: 24 x 3
>
> resulting in
>
> > as_tibble(do.call(rbind, unname(res0)))# A tibble: 24 x 3
>station  year record
>   
>  1 07EA001  1960QMS
>  2 07EA001  1961QMC
>  3 07EA001  1962QMC
>  4 07EA001  1963QMC
>  5 07EA001  1964QMC
>  6 07EA001  1965QMC
>  7 07EA001  1966QMC
>  8 07EA001  1967QMC
>  9 07EA001  1968QMC
> 10 07EA001  1969QMC
> # ... with 14 more rows
>
> I though I should have been able to use `tibble` in the second step, but
> that leads to a (cryptic) error
>
> > res0 <- with(input, Map(tibble, station=station, year=year,
> record=record))Error in captureDots(strict = `__quosured`) :
>   the argument has already been evaluated
>
> The 'station' and 'record' columns are factors, so different from the
> original input, but this seems the appropriate data type for theses columns.
>
> It's interesting to compare the 'specialized' knowledge needed for each
> approach -- rowwise(), do(), .$ for tidyverse, with(), do.call(), maybe
> rbind() and Map() for base R.
>
> Martin
>
>
>
>>
>>
>> Jim Holtman
>> Data Munger Guru
>>
>> What is the problem that you are trying to solve?
>> Tell me what you want to do, not how you want to do it.
>>
>> On Sun, Nov 26, 2017 at 2:10 PM, Bert Gunter 
>> wrote:
>>
>> To David W.'s point about lack of a suitable reprex ("reproducible
>>> example"), Bill's solution seems to be for only one station.
>>>
>>> Here is a reprex and modification that I think does what was requested
>>> for
>>> multiple stations, again using base R and data frames, not dplyr and
>>> tibbles.
>>>
>>> First the reprex with **two** stations:
>>>
>>> d <- data.frame( station = rep(c("one","two"),c(5,4)),

>>> from = c(60,61,71,72,76,60,65,82,83),
>>>  to = c(60,70,71,76,83,64, 81, 82,83),
>>>  record = c("A","B","C","B","D","B","B","D","E"))
>>>
>>> d

>>>station from to record
>>> 1 one   60 60  A
>>> 2 one   61 70  B
>>> 3 one   71 71  C
>>> 4 one   72 76  B
>>> 5 one   76 83  D
>>> 6 two   60 64  B
>>> 7 two   65 81  B
>>> 8 two   82 82  D
>>> 9 two   83 83  E
>>>
>>> ## Now the conversion code using base R, especially by():
>>>
>>> out <- by(d, d$station, function(x) with(x, {

>>> +i <- to - from +1
>>> +data.frame(YEAR =sequence(i) -1 +rep(from,i), RECORD =rep(record,i))
>>> + }))
>>>
>>>
>>> out <- data.frame(station =

>>> rep(names(out),sapply(out,nrow)),do.call(rbind,out), row.names = NULL)
>>>
>>>
>>> out

>>> station YEAR RECORD
>>> 1  one   60  A
>>> 2  one   61  B
>>> 3  one   62  B
>>> 4  one   63  B
>>> 5  one   64  B
>>> 6  one   65  B
>>> 7  one   66  B
>>> 8  one   67  B
>>> 9  one   68  B
>>> 10 one   69  B
>>> 11 one   70  B
>>> 12 one   71  C
>>> 13 one   72  B
>>> 14 one   73  B
>>> 15 one   74  B
>>> 16 one   75  B
>>> 17 one   76  B
>>> 18 one   76  D
>>> 19 one   77  D
>>> 20 one   78  D
>>> 21 one   79  D
>>> 22 one   80  D
>>> 23 one   81  D
>>> 24 one   82  D
>>> 25 one   83  D
>>> 26 two   60  B
>>> 27 two   61  B
>>> 28 

[R] The R Journal, Volume 8, Issue 1

2016-09-08 Thread Michael Lawrence
Dear all,

The latest issue of The R Journal is now available at
http://journal.r-project.org/archive/2016-1/

Many thanks to all contributors.

Michael Lawrence

___
r-annou...@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-announce

__
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] Is that an efficient way to find the overlapped , upstream and downstream ranges for a bunch of ranges

2016-04-11 Thread Michael Lawrence
For the sake of prosterity, this question was asked and answered here:
https://support.bioconductor.org/p/80448

On Tue, Apr 5, 2016 at 10:27 AM, 何尧  wrote:
> I do have a bunch of genes ( nearly ~5)  from the whole genome, which 
> read in genomic ranges
>
> A range(gene) can be seem as an observation has three columns chromosome, 
> start and end, like that
>
>seqnames start end width strand
>
> gene1 chr1 1   5 5  +
>
> gene2 chr110  15 6  +
>
> gene3 chr112  17 6  +
>
> gene4 chr120  25 6  +
>
> gene5 chr130  4011  +
>
> I just wondering is there an efficient way to find overlapped, upstream and 
> downstream genes for each gene in the granges
>
> For example, assuming all_genes_gr is a ~5 genes genomic range, the 
> result I want like belows:
>
> gene_nameupstream_genedownstream_geneoverlapped_gene
> gene1NAgene2NA
> gene2gene1gene4gene3
> gene3gene1gene4gene2
> gene4gene3gene5NA
>
> Currently ,  the strategy I use is like that,
> library(GenomicRanges)
> find_overlapped_gene <- function(idx, all_genes_gr) {
>   #cat(idx, "\n")
>   curr_gene <- all_genes_gr[idx]
>   other_genes <- all_genes_gr[-idx]
>   n <- countOverlaps(curr_gene, other_genes)
>   gene <- subsetByOverlaps(curr_gene, other_genes)
>   return(list(n, gene))
> }
>
> system.time(lapply(1:100, function(idx)  find_overlapped_gene(idx, 
> all_genes_gr)))
> However, for 100 genes, it use nearly ~8s by system.time().That means if I 
> had 5 genes, nearly one hour for just find overlapped gene.
>
> I am just wondering any algorithm or strategy to do that efficiently, perhaps 
> 5 genes in ~10min or even less
>
>
>
>
>
> [[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.

__
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] How to filter data using sets generated by flattening with dcast, when I can't store those sets in a data frame

2015-03-16 Thread Michael Lawrence
The data structures you mention are complex, and too much of their
complexity leaks into client code. Instead, aim to use higher level code
constructs on simpler data structures. In R, the most convenient operations
are those that are statistical in nature.

For example, one might solve your problem by saying: restrict to the subset
of the important days (1, 4, 7), and count the occurrences of each patient
in that subset to find those patients with the sufficient number of
important measurements.

criticalDays <- c(1, 4, 8)
criticalDf <- subset(df, Day %in% criticalDays)
keepPatients <- table(criticalDf$ID) == length(criticalDays)
df[keepPatients[df$ID],]

Note that the code above assumes that the ID variable is a factor, which it
should be.

Michael

On Thu, Mar 12, 2015 at 12:55 AM, Jocelyn Ireson-Paine 
wrote:

> This is a fairly long question. It's about a problem that's easy to
> specify in terms of sets, but that I found hard to solve in R by using
> them, because of the strange design of R data structures. In explaining it,
> I'm going to touch on the reshape2 library, dcast, sets, and the
> non-orthogonality of R.
>
> My problem stems from some drug-trial data that I've been analysing for
> the Oxford Pain Research Unit. Here's an example. Imagine a data frame
> representing patients in a trial of pain-relief drugs. The trial lasts for
> ten days. Each patient's pain is measured once a day, and the values are
> recorded in a data frame, one row per patient per day. Like this:
>
>   ID  Day  Pain
>11  10
>12   9
>14   7
>17   2
>22   8
>23   7
>31  10
>33   6
>34   6
>38   2
>
> Unfortunately, many patients have measurements missing. Thus, in the
> example above, patient 1 was only observed on days 1, 2, 4, and 7, rather
> than on the full ten days. But a patient's measurements are only useful to
> us if that patient has a certain minimum set of days, so I need to check
> for patients who lack those days. Let's assume that these days are numbers
> 1, 4, and 9.
>
> Such a question is trivial to state in terms of sets. Let D(i) denote the
> set of days on which patient i was measured: then I want to find out which
> patients p, or how many patients p, have a D(p) that contains the set
> {1,4,9}.
>
> The obvious way to solve this is to write a function that tells me whether
> one set is a superset of another. Then flatten my data frame so that it
> looks like this:
>
>   ID  Days
>1  {1,2,4,7}
>2  {2,3}
>3  {1,3,4,8}
>
> And finally, filter it by some R translation of
>
>   flattened[ includes( flattened$Days, {1,4,9} ), ]
>
> I started with the built-in functions that operate on sets represented as
> vectors. These are described in
>  https://stat.ethz.ch/R-manual/R-devel/library/base/html/sets.html ,
> "Set Operations". For example:
>
>   > union( c(1,2,3), c(2,4,6) )
>   [1] 1 2 3 4 6
>   > intersect( c(1,2,3), c(2,4,6) )
>   [1] 2
>
> So I first wrote a set-inclusion function:
>
>   # True if vector a is a superset of vector b.
>   #
>   includes <- function( a, b )
>   {
> return( setequal( union( a, b ), a ) )
>   }
>
> Here are some sample calls:
>
>   > includes( c(1), c() )
>   [1] TRUE
>   > includes( c(1), c(1) )
>   [1] TRUE
>   > includes( c(1), c(1,2) )
>   [1] FALSE
>   > includes( c(2,1), c(1,2) )
>   [1] TRUE
>   > includes( c(2,1,3), c(1,2) )
>   [1] TRUE
>   > includes( c(2,1,3), c(4,1,2) )
>   [1] FALSE
>
> I then made myself a variable holding my sample data frame:
>
>   df <- data.frame( ID = c( 1, 1, 1, 1, 2, 2, 3, 3, 3, 3 )
>   , Day = c( 1, 2, 4, 7, 2, 3, 1, 3, 4, 8 )
>   )
>
> And I tried flattening it, using dcast and an aggregator function as
> described in (amongst many other places) http://seananderson.ca/2013/
> 10/19/reshape.html , "An Introduction to reshape2" by Sean C. Anderson.
>
> The idea behind this is that (for my data) dcast will call the aggregator
> function once per patient ID, passing it all the Day values for the
> patient. The aggregator must combine them in some way, and dcast puts its
> results into a new column. For example, here's an aggregator that merely
> sums its arguments:
>
>   aggregator_making_sum <- function( ... )
>   {
> return( sum( ... ) )
>   }
>
> If I call it, I get this:
>
>   >  dcast( df, ID~. , fun.aggregate=aggregator_making_sum )
>   Using Day as value column: use value.var to override.
> ID  .
>   1  1 14
>   2  2  5
>   3  3 16
>
> And here's an aggregator that converts the argument list to a string:
>
>   aggregator_making_string <- function( ... )
>   {
> return( toString( ... ) )
>   }
>
> Calling it gives this:
>
>   >  dcast( df, ID~. , fun.aggregate=aggregator_making_string )
>   Using Day as value column: use value.var to override.
> ID  .
>   1  1 1, 2, 4, 7
>   2  2   2, 3
>   3  3 1, 3, 4, 8
>
> In both of these, the three dots denote all arguments to the aggregator

Re: [R] Installing gWidgetsRGtk2: R session is headless

2014-10-23 Thread Michael Lawrence
Perhaps this is a permissions (Xauthority) issue: is the same user running
both the X11 display and the R session?



On Thu, Oct 23, 2014 at 2:40 AM, R  wrote:

> I have written some gWidgets scripts before in the past but have a
> different box now (Debian KWheezy) and cannot get gWidgets working. It may
> be an obvious mistake but auntie Google (who has helped me a lot to get as
> far as I am now) leaves me in the dark now.
> Here is where I am stuck:
> - - - - -
> > library( gWidgets )
> > library( gWidgetsRGtk2 )
> Loading required package: RGtk2
> No protocol specified
> R session is headless; GTK+ not initialized.
> >  obj <- gbutton("Hello world", container = gwindow())
>
> (R:15675): GLib-GObject-WARNING **: invalid (NULL) pointer instance
>
> (R:15675): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion
> `G_TYPE_CHECK_INSTANCE (instance)' failed
>
> (R:15675): Gtk-WARNING **: Screen for GtkWindow not set; you must always
> set
> a screen for a GtkWindow before using the window
>
> (R:15675): Gdk-CRITICAL **: IA__gdk_screen_get_default_colormap: assertion
> `GDK_IS_SCREEN (screen)' failed
>
> (R:15675): Gdk-CRITICAL **: IA__gdk_colormap_get_visual: assertion
> `GDK_IS_COLORMAP (colormap)' failed
>
> (R:15675): Gdk-CRITICAL **: IA__gdk_screen_get_default_colormap: assertion
> `GDK_IS_SCREEN (screen)' failed
>
> (R:15675): Gdk-CRITICAL **: IA__gdk_screen_get_root_window: assertion
> `GDK_IS_SCREEN (screen)' failed
>
> (R:15675): Gdk-CRITICAL **: IA__gdk_screen_get_root_window: assertion
> `GDK_IS_SCREEN (screen)' failed
>
> (R:15675): Gdk-CRITICAL **: IA__gdk_window_new: assertion `GDK_IS_WINDOW
> (parent)' failed
>
>  *** caught segfault ***
> address 0x18, cause 'memory not mapped'
>
> Traceback:
>  1: .Call(name, ..., PACKAGE = PACKAGE)
>  2: .RGtkCall("S_gtk_widget_show", object, PACKAGE = "RGtk2")
>  3: method(obj, ...)
>  4: window$Show()
>  5: .gwindow(toolkit, title, visible, width, height, parent, handler,
>  action, ...)
>  6: .gwindow(toolkit, title, visible, width, height, parent, handler,
>  action, ...)
>  7: gwindow()
>  8: .gbutton(toolkit, text, border, handler, action, container, ...)
>  9: .gbutton(toolkit, text, border, handler, action, container, ...)
> 10: gbutton("Hello world", container = gwindow())
>
>
> - - - - -
> > sessionInfo()
> R version 3.1.1 (2014-07-10)
> Platform: x86_64-pc-linux-gnu (64-bit)
>
> locale:
>  [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
>  [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
>  [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8
>  [7] LC_PAPER=en_US.UTF-8   LC_NAME=C
>  [9] LC_ADDRESS=C   LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats graphics  grDevices utils datasets  methods   base
>
> loaded via a namespace (and not attached):
> [1] tools_3.1.1
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] RGtk2 drawing area as cairo device - no points

2014-09-18 Thread Michael Lawrence
Just wanted to acknowledge this. It's a known issue, and one that has been
tricky to solve, because it's platform-specific, so it's probably some sort
of bug in the abstraction (GDK).

On Wed, Sep 17, 2014 at 12:26 AM, François Rebaudo <
francois.reba...@legs.cnrs-gif.fr> wrote:

> Hi,
> The following code adapted from Michael post (https://stat.ethz.ch/
> pipermail/r-help/2012-March/306069.html) works just fine on Linux Debian,
> but not on Windows 7 (no points on plots 2 and 3). More surprisingly, if the
> first plot is a boxplot, it works on both OS... and if I do a pdf (using
> pdf()), I get my points... Thanks in advance for your
> help.
>
> library(RGtk2)
> library(cairoDevice)
> win = gtkWindow(show = FALSE)
> win$setDefaultSize(500, 500)
> da = gtkDrawingArea()
> asCairoDevice(da)
> win$add(da)
> win$showAll()
> layout(matrix(c(1,1,2,3),2,2,byrow=TRUE))
> par(mar=c(0,0,0,0))
> plot(1:10) #boxplot(1:10)
> plot(1:10)
> plot(1:10)
>
>  sessionInfo()
>>
> R version 3.1.0 (2014-04-10)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
>
> locale:
> [1] LC_COLLATE=French_France.1252  LC_CTYPE=French_France.1252
> [3] LC_MONETARY=French_France.1252 LC_NUMERIC=C
> [5] LC_TIME=French_France.1252
>
> attached base packages:
> [1] stats graphics  grDevices utils datasets  methods   base
>
> loaded via a namespace (and not attached):
> [1] tools_3.1.0
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] interactive labeling/highlighting on multiple xy scatter plots

2014-08-01 Thread Michael Lawrence
You should check out the animint package.

https://github.com/tdhock/animint



On Mon, Jul 28, 2014 at 5:48 PM, Shi, Tao  wrote:

> hi list,
>
> I'm comparing the changes of ~100 analytes in multiple treatment
> conditions.  I plotted them in several different xy scattter plots.  It
> would be nice if I mouse over one point on one scatter plot, the label of
> the analyte on that scatter plot AS WELL AS on all other scatter plots will
> be automatically shown.  I know brushing in rggobi does this, but its
> interface is not good and it needs R or ggobi to run (I want send the
> results to the collaborators and let them to play with it without the need
> of installing R or ggobi on their machine).  rCharts is nice but so far it
> can only create one scatter plot at a time.
>
> Any good suggestions?
>
> Many thanks!
>
> Tao
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] Unable to compile & install rggobi

2012-04-27 Thread Michael Lawrence
GGobi needs a 64 bit binary before we can get rggobi available on Windows
again.

On Fri, Apr 27, 2012 at 6:27 PM, Indrajit Sengupta
wrote:

> I came across this web site:
>
> http://cran.r-project.org/bin/windows/contrib/2.15/check/
>
> Where I checked the file: rggobi-check.log
>
> The contents of this file is giving the same kind of error that I am
> facing. Does that mean, this package does not work with R 2.15 yet? Is it a
> bug?
>
> Regards,
> Indrajit
>
>
>
> 
> From: Prof Brian Ripley 
>
> Cc: R Help 
> Sent: Friday, April 27, 2012 2:21 PM
> Subject: Re: [R] Unable to compile & install rggobi
>
> On 27/04/2012 08:56, Indrajit Sengupta wrote:
> > I am currently using R 2.15.0 with R Tools 2.15 (in Windows XP). I
> downloaded the source for RGgobi and extracted it to a folder.
> >
> > Then I tried compiling and installing with the following command and got
> an error message:
> >
> --
> > D:\Work\tmp>R CMD INSTALL --build "D:\\DPF\\Rggobi\\rggobi"
> > * installing to library 'C:/Program Files/R/R-2.15.0/library'
> > * installing *source* package 'rggobi' ...
> > ** libs
> > cygwin warning:
> >MS-DOS style path detected: C:/PROGRA~1/R/R-215~1.0/etc/i386/Makeconf
> >Preferred POSIX equivalent is:
> /cygdrive/c/PROGRA~1/R/R-215~1.0/etc/i386/Makeconf
> >CYGWIN environment variable option "nodosfilewarning" turns off this
> warning.
> >Consult the user's guide for more details about POSIX paths:
> >  http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
> > gcc  -I"C:/PROGRA~1/R/R-215~1.0/include" -DNDEBUG -D_R_=1 -DUSE_R=1
> -mms-bitfields -I/include/gtk-2.0 -I/include/gdk-pixbuf-2.0
> -I/../lib/gtk-2.0/include -
> > I/include/atk-1.0 -I/include/cairo -I/include/pango-1.0
> -I/include/glib-2.0 -I/../lib/glib-2.0/include -I/include/libxml2
> -I/include -I/include/ggobi -IC:/
> > PROGRA~1/R/R-215~1.0/include -I/include/libxml-O3 -Wall
> -std=gnu99 -mtune=core2 -c RSEval.c -o RSEval.o
> > In file included from RSEval.c:6:0:
> > RSGGobi.h:5:22: fatal error: GGobiAPI.h: No such file or directory
> > compilation terminated.
> > make: *** [RSEval.o] Error 1
> > ERROR: compilation failed for package 'rggobi'
> > * removing 'C:/Program Files/R/R-2.15.0/library/rggobi'
> >
> --
> >
> > Can anybody help in figuring out what is the problem? I have installed
> GGobi&  RGtk2 previously.
>
> You need to set some environment variables: study the rggobi sources for
> what. E.g. I bet GGobi is not installed in the root, so -I/include/ggobi
> will not work.
>
> > Regards,
> > Indrajit
> > [[alternative HTML version deleted]]
> >
> >
> >
> >
> > __
> > R-help@r-project.org 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.
>
> Please do as you were asked: no HTML, programming questions to R-devel,
> questions about packages to the maintainer 
>
> --
> Brian D. Ripley,  rip...@stats.ox.ac.uk
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford,Tel:  +44 1865 272861 (self)
> 1 South Parks Road,+44 1865 272866 (PA)
> Oxford OX1 3TG, UKFax:  +44 1865 272595
> [[alternative HTML version deleted]]
>
>
> __
> R-help@r-project.org 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.
>
>

[[alternative HTML version deleted]]

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


Re: [R] "figure margins too large" in RGtk2 drawing area as cairo device - why?

2012-03-09 Thread Michael Lawrence
Hi Mark,

This comes down to the way that GTK+ allocates size to its widgets. The
allocation of a widget is initialized to have a width and height of 1. When
a child is added to a visible parent, the parent will execute its lay out
algorithm and allocate a certain amount of space to the widget. The widget
is notified of this change via an event that arrives after an iteration of
the event loop. An event loop iteration may be forced in a number of ways;
you've discovered the Sys.sleep() method.

However, it is generally not good practice to show a container before
adding its children, unless widgets are being added in the middle of a
session, which is rare. If you were to instead do something like this:

win = gtkWindow(show = FALSE)
win$setDefaultSize(500, 500)
da = gtkDrawingArea()
asCairoDevice(da)
win$add(da)
win$showAll()
plot(1:10)

Then GTK+ will correctly initialize the allocation of the widget, I think
even before a configure event is received. The above approach is my
recommended solution to your problem.

Thanks,
Michael

On Fri, Mar 9, 2012 at 1:39 AM, Mark Heckmann  wrote:

> Thanks, Peter.
> I did the following: restart R and run the same code with and without a
> minimal system pause (Sys.sleep) after the line that adds the device to the
> GTK window.
> Adding a pause will make it work, though I do not understand what is
> happening here. Note the different settings of par("din").
> This is probably not the expected behavior, I guess.
> Any ideas why this is the case? It seems as if "din" is not adjusted on
> time? Might that be?
>
>
> > library(RGtk2)
> > library(cairoDevice)
> >
> > win = gtkWindow()
> > da = gtkDrawingArea()
> > asCairoDevice(da)
> [1] TRUE
> > win$add(da)
> > plot(1:10)
> Fehler in plot.new() : Grafikränder zu groß
> > par(c("din", "mai"))
> $din
> [1] 0.0139 0.0139
>
> $mai
> [1] 0.7791667 0.6263889 0.6263889 0.3208333
>
>
> > win = gtkWindow()
> > da = gtkDrawingArea()
> > asCairoDevice(da)
> [1] TRUE
> > win$add(da)
> > Sys.sleep(.1)
> > plot(1:10)
> > par(c("din", "mai"))
> $din
> [1] 2.78 2.78
>
> $mai
> [1] 0.7791667 0.6263889 0.6263889 0.3208333
>
>
> Thanks in advance
> --- Mark
>
>
> Am 09.03.2012 um 00:01 schrieb peter dalgaard:
>
> >
> > On Mar 8, 2012, at 23:25 , Mark Heckmann wrote:
> >
> >> Peter, thanks for the answer!
> >> Indeed, it does work if I set par(mar=c(0,0,0,0)) but not when it is
> set to the default values mar=c(5.1, 4.1, 4.1, 2.1).
> >> The par settings returned in the example are the defaults, so no
> extraordinary big mar settings or char size (see below).
> >> Also, it does not matter what size the drawing area is set to (e.g.
> 1000x 1000). The error always occurs.
> >> Any idea?
> >>
> >
> > The other parameters...
> >
> > What about "din" and "mai"? The margin problem usually means that the
> sum of the relevant margins is bigger than the device size. E.g.
> >
> >> quartz()
> >> par(mai=rep(4,4))
> >> plot(0)
> > Error in plot.new() : figure margins too large
> >
> >
> >
> >> examples:
> >>
> >>> win = gtkWindow()
> >>> da = gtkDrawingArea()
> >>> win$add(da)
> >>> asCairoDevice(da)
> >> [1] TRUE
> >>> par(c("mar", "cra", "oma"))
> >> $mar
> >> [1] 5.1 4.1 4.1 2.1
> >>
> >> $cra
> >> [1]  7 11
> >>
> >> $oma
> >> [1] 0 0 0 0
> >>
> >>> plot(1:10)
> >> Fehler in plot.new() : Grafikränder zu groß  ###ERROR###
> >>
> >> Thanks
> >> Mark
> >>
> >>
> >> Am 08.03.2012 um 22:48 schrieb peter dalgaard:
> >>
> >>>
> >>> On Mar 8, 2012, at 20:27 , Mark Heckmann wrote:
> >>>
>  When using a gtkDrawingArea as a Cairo device I very often encounter
> the error: "figure margins too large"
>  Even for the below "getting started" example from
> http://www.ggobi.org/rgtk2/ this is the case.
> 
> > win = gtkWindow()
> > da = gtkDrawingArea()
> > win$add(da)
> > asCairoDevice(da)
>  [1] TRUE
> > plot(1:10)
>  Fehler in plot.new() : Grafikränder zu groß
> >
> 
>  Also enlarging the drawing area does not help.
> 
> > win = gtkWindow()
> > da = gtkDrawingArea()
> > win$add(da)
> > asCairoDevice(da)
>  [1] TRUE
> > da$setSizeRequest(700, 700)
> > plot(1:10)
>  Fehler in plot.new() : Grafikränder zu groß
> 
>  Any ideas?
> >>>
> >>> I'd check the par() settings for the device. Especially mar/mai and
> cra/cin to see whether margins are set unusually large and/or character
> sizes are unusually big, but check help(par) yourself.
> >>>
> >>> --
> >>> Peter Dalgaard, Professor,
> >>> Center for Statistics, Copenhagen Business School
> >>> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
> >>> Phone: (+45)38153501
> >>> Email: pd@cbs.dk  Priv: pda...@gmail.com
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >> 
> >> Mark Heckmann
> >> Blog: www.markheckmann.de
> >> R-Blog: http://ryouready.wordpress.com
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >
> > --
> > Peter Dalgaard, Professor,
> > Center for Stat

Re: [R] changing the drawing context using Cairo and RGtk2

2012-03-08 Thread Michael Lawrence
On Wed, Mar 7, 2012 at 1:47 PM, Mark Heckmann  wrote:

> Michael, thanks for your answer!
>
> The attribute solution has its problems though.
> First, how it will work:
>
> foo <- function(){
>   w <- gtkWindow()
>   da <- gtkDrawingArea()
>   w$add(da)
>   asCairoDevice(da)
>   print(dev.cur())
>   gObjectSetData(da, "dev.number", data = dev.cur())
>   dev.set(gObjectGetData(da, "dev.number"))
>   par(mar=c(0,0,0,0))
>   plot(1:10)
> }
>
> The problem arises when I try to convert a drawing area to Cairo WITHIN
> another function.
> Than dev.cur() does not work as I expected. The device returned is the
> Null device instead.
>
> foo_2 <- function(){
>   da <- gtkDrawingArea()
>   asCairoDevice(da)
>   print(dev.cur())# NULL DEVICE!
>   gObjectSetData(da, "dev.number", data = dev.cur())
>   da
> }
>
> foo <- function(){
>   w <- gtkWindow()
>   e <- environment()
>   da <- foo_2()
>   w$add(da)
>   dev.cur()
>   dev.set(gObjectGetData(da, "dev.number"))
>   par(mar=c(0,0,0,0))
>   plot(1:10)
> }
>
> As in most cases the code for creating and converting a drawing area is
> not located in the main function but rather inside a handler etc. the
> attribute solution will often work.
> Or am I missing something here?
>
>
The R graphics device is not actually created until the widget is realized
(in GTK terms), because it cannot plot anything until then. The difference
in the code above is that in the first case you are adding the drawing area
to the visible window (and thus realizing it) prior to calling dev.cur().
The order is reversed in the second case.

Michael

I think this problem is very general when working with RGtk2, Cairo and
> multiple drawing areas (e.g. on notebook tabs).
> So I wonder if there is another way to go about it. Do you have an idea?
>
> Thanks in advance
> --Mark
>
>
> Am 06.03.2012 um 13:52 schrieb Michael Lawrence:
>
> Currently, the GtkDrawingArea object has no real knowledge that it is
> being used as a graphics device. You could do something like: stick the
> device ID on da1/da2 as an attribute, and then have a function that does
> dev.set with that attribute.
>
> Michael
>
> On Mon, Mar 5, 2012 at 1:14 PM, Mark Heckmann wrote:
>
>> I am not too familiar with Cairo and RGtk2 and have the following problem:
>> I have a container with two GTK drawing areas converted into Cairo
>> devices.
>> I know that I can set the current drawing context e.g. using dev.set().
>> But this is tedious. How can I set the context using the objects da1 or
>> da2?
>>
>>  w <- gtkWindow()
>>  w$setSizeRequest(400, 400)
>>  vbox <- gtkVBox()
>>  da1 <- gtkDrawingArea()
>>  da2 <- gtkDrawingArea()
>>  vbox$add(da1)
>>  vbox$add(da2)
>>  dummy <- asCairoDevice(da1)
>>  dummy <- asCairoDevice(da2)
>>  w$add(vbox)
>>  par(oma=c(0,0,0,0), mar=c(0,0,0,0))
>>  plot(1:10)
>>
>> THX
>> --Mark
>> 
>> Mark Heckmann
>> Blog: www.markheckmann.de
>> R-Blog: http://ryouready.wordpress.com
>>
>> __
>> R-help@r-project.org 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.
>>
>
>
> 
> Mark Heckmann
> Blog: www.markheckmann.de
> R-Blog: http://ryouready.wordpress.com
>
>
>
>
>
>
>
>
>
>
>

[[alternative HTML version deleted]]

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


Re: [R] changing the drawing context using Cairo and RGtk2

2012-03-06 Thread Michael Lawrence
Currently, the GtkDrawingArea object has no real knowledge that it is being
used as a graphics device. You could do something like: stick the device ID
on da1/da2 as an attribute, and then have a function that does dev.set with
that attribute.

Michael

On Mon, Mar 5, 2012 at 1:14 PM, Mark Heckmann  wrote:

> I am not too familiar with Cairo and RGtk2 and have the following problem:
> I have a container with two GTK drawing areas converted into Cairo devices.
> I know that I can set the current drawing context e.g. using dev.set().
> But this is tedious. How can I set the context using the objects da1 or
> da2?
>
>  w <- gtkWindow()
>  w$setSizeRequest(400, 400)
>  vbox <- gtkVBox()
>  da1 <- gtkDrawingArea()
>  da2 <- gtkDrawingArea()
>  vbox$add(da1)
>  vbox$add(da2)
>  dummy <- asCairoDevice(da1)
>  dummy <- asCairoDevice(da2)
>  w$add(vbox)
>  par(oma=c(0,0,0,0), mar=c(0,0,0,0))
>  plot(1:10)
>
> THX
> --Mark
> 
> Mark Heckmann
> Blog: www.markheckmann.de
> R-Blog: http://ryouready.wordpress.com
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] RGtk2: How to overlay a gtkDrawingArea with a button or any other widget?

2012-01-16 Thread Michael Lawrence
Sorry for the late reply to this one. You'll need to make sure that the
drawing area is realized prior to plotting, i.e., it should be in a visible
container. Also, since you are using GtkFixed, you will need to set an
explicit size request on the drawing area (otherwise it has zero area).

Michael

On Wed, Dec 21, 2011 at 4:31 PM, Mark Heckmann  wrote:

> I try to overlay a plot inside a gtkDrawingArea with a button (or any
> other widget).
> I tried to put both into a gtkFixed container.
> But this does not work, no printing occurs.
> Does someone know a solution?
>
> What I tried:
>
> w <- gtkWindow()
> w$setSizeRequest(400,400)
> fx <- gtkFixed()
> da <- gtkDrawingArea()
> fx$put(da, 100, 100)
> asCairoDevice(da)
> par(mar=c(0,0,0,0))
> plot(1:10)
> btn.1 <- gtkButton("button")
> fx$put(btn.1, 200, 200)
> w$add(fx)
>
> Thanks
> Mark
>
> 
> Mark Heckmann
> Blog: www.markheckmann.de
> R-Blog: http://ryouready.wordpress.com
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] RGtk2 problems

2011-10-26 Thread Michael Lawrence
The gain from updating will be that RGtk2 now looks in a specific (internal)
place for the libraries, so you should no longer need to worry about library
conflicts and PATH settings. In theory.

Michael

On Tue, Oct 25, 2011 at 5:46 PM, Aref  wrote:

> Thank you for the response and I am sorry about the html--will
> remember next time.
> The version of RGtk2 installed is 2.20.8 I installed it through R from
> CRAN repository.
> I believe that the problem is that during the installation the
> environment variable GTK_BASEPATH was set to some other location than
> where GTK+ was installed--overwritten by the R installation process. I
> found this after I fixed the issue by copying the libraries into R
> \bin. This is probably not the best solution but it works. I will be
> updating R soon to 2.14 when it comes out and hopefully things will
> work better now that I have the environment variable pointing to the
> right place for the GTK+ libraries.
>
>
> On Oct 24, 12:12 am, Prof Brian Ripley  wrote:
> > Please update your R (and probably your RGtk2: you did not tell us its
> > version), as the posting guide asked you to do before posting.
> >
> > On Sun, 23 Oct 2011, Aref Nammari wrote:
> > > Hello,
> >
> > > I hope this is the right place to ask for help with a problem I am
> > > having with RGtk2 installation with R on Windows XP.
> > > I am running R 2.11.1 and have installed the package RGtk2 from CRAN.
> >
> > As a binary package, I guess, but please tell us (it matters).
> >
> > > I also have GTK 2.10.11 installed as well as GTK2-runtime 2.22.0. I
> > > have added the environment variable GTK_PATH and set its value to the
> > > root location where GTK is installed.
> >
> > But you need the Gtk+ bin directory in your PATH.  Environment
> > variable GTK_PATH is only needed when RGtk2 is installed from the
> > sources.
> >
> > Which Gtk+ you need in your path depends on the version of RGtk2 you
> > have and how you installed it.  For current binary versions, see
> >
> > http://cran.r-project.org/bin/windows/contrib/2.13/@ReadMe
> >
> >
> >
> > > When I try to run RGtk2 in R by
> > > typing library(RGtk2) a popup dialog appears with the following error
> > > message:
> >
> > > The procedure entry point gdk_app_launch_context_get_type could not be
> > > located in the dynamic link library libgdk-win32-2.0-0.dll
> >
> > > In the R window I get :
> >
> > > Error in inDL(x, as.logical(local), as.logical(now), ...) :
> > >  unable to load shared library 'C:/PROGRA~1/R/R-211~1.1/library/RGtk2/
> > > libs/RGtk2.dll':
> > >  LoadLibrary failure:  The specified procedure could not be found.
> >
> > > Failed to load RGtk2 dynamic library, attempting to install it.
> > > Error : .onLoad failed in loadNamespace() for 'RGtk2', details:
> > >  call: install_all()
> > >  error: This platform is not yet supported by the automatic
> > > installer. Please install GTK+ manually, if necessary. See:
> > >http://www.gtk.org<
> http://www.google.com/url?sa=D&q=http://www.gtk.org&usg=AFQjCNFJhHsdo...>
> > > Error: package/namespace load failed for 'RGtk2'
> >
> > > Any help in figuring out what could be the problem is greatly
> > > appreciated.
> >
> > > Cheers,
> >
> > >[[alternative HTML version deleted]]
> >
> > Please do as the posting guide asked of you and not send HTML.
> >
> > > __
> > > r-h...@r-project.org mailing list
> > >https://stat.ethz.ch/mailman/listinfo/r-help
> > > PLEASE do read the posting guidehttp://
> www.R-project.org/posting-guide.html
> > > and provide commented, minimal, self-contained, reproducible code.
> >
> > --
> > Brian D. Ripley,  rip...@stats.ox.ac.uk
> > Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> > University of Oxford, Tel:  +44 1865 272861 (self)
> > 1 South Parks Road, +44 1865 272866 (PA)
> > Oxford OX1 3TG, UKFax:  +44 1865 272595
> >
> > __
> > r-h...@r-project.org mailing listhttps://
> stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guidehttp://
> www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] cairo device and locator on windows

2011-04-18 Thread Michael Lawrence
I will look into this.

Michael

On Sun, Apr 17, 2011 at 8:34 PM, Richard M. Heiberger wrote:

> In several tries, I am finding the locator and identify functions on the
> cairo device on Windows,
> with R-2.13.0, do not seem to work correctly.  Here is my experience with
> locator where I click the
> four corners of the device window.
>
> First, with the windows() device, the results are consistent with what I
> see
> on screen
> > windows()
> > plot(1,1)
> > locator()
> $x
> [1] 0.6075000 1.3981252 1.3653126 0.6090625
> $y
> [1] 0.6117440 0.6239533 1.3931395 1.3983721
> >
>
>
> Second, with the Cairo device, the results are not consistent with what I
> see on screen.
> > library(cairoDevice)
> > Cairo()
> > plot(1,1)
> > locator()
> $x
> [1] 0.6715602 1.7007429 1.7071620 0.6672808
> $y
> [1] 0.2775717 0.2945700 1.3144688 1.3290388
> >
>
> Any guidance on making Cairo work would be appreciated.
>
> Rich
>
>[[alternative HTML version deleted]]
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] RGtk2: How to populate an GtkListStore data model?

2011-04-04 Thread Michael Lawrence
On Sun, Apr 3, 2011 at 8:29 PM, Cleber N. Borges wrote:

> hello all
> I am trying to learn how to use the RGtk2 package...
> so, my first problem is: I don't get the right way for populate my
> gtkListStore object!
> any help is welcome... because I am trying several day to mount the code...
> Thanks in advanced
> Cleber N. Borges
> ---
> # my testing code
>
> library(RGtk2)
> win <- gtkWindowNew()
> datamodel <- gtkListStoreNew('gchararray')
> treeview <- gtkTreeViewNew()
> renderer <- gtkCellRendererText()
> col_0 <- gtkTreeViewColumnNewWithAttributes(title="TitleXXX",
> cell=renderer, "text"="Bar")
> nc_next <- gtkTreeViewInsertColumn(object=treeview, column=col_0,
> position=0)
> gtkTreeViewSetModel( treeview, datamodel )
> win$add( treeview ) # is there an alternative function for this?
>
> # iter <- gtkTreeModelGetIterFirst( datamodel )[[2]]
> # this function don't give VALID iter
> # gtkListStoreIterIsValid( datamodel, iter )  result in FALSE
> iter <- gtkListStoreInsert( datamodel, position=0 )[[2]]
> gtkListStoreIterIsValid( datamodel, iter )
>
> # the help of this function say to terminated in -1 value
> # but -1 crash the R-pckage (or the gtk)...
>

Sorry about this. The help is autogenerated from the GTK+ C documentation.


> gtkListStoreSet(object=datamodel, iter=iter, 0, "textFoo")
> # don't make any difference in the window... :-(
>
>
>
It would be much easier to use rGtkDataFrame for populating this list. See
the help for that function.


> 
> R version 2.13.0 alpha (2011-03-27 r55091)
> Platform: i386-pc-mingw32/i386 (32-bit)
>
> locale:
> [1] LC_COLLATE=Portuguese_Brazil.1252
> [2] LC_CTYPE=Portuguese_Brazil.1252
> [3] LC_MONETARY=Portuguese_Brazil.1252
> [4] LC_NUMERIC=C
> [5] LC_TIME=Portuguese_Brazil.1252
>
> attached base packages:
> [1] stats graphics  grDevices utils datasets  methods
> [7] base
>
> other attached packages:
> [1] RGtk2_2.20.8
>
> loaded via a namespace (and not attached):
> [1] tools_2.13.0
> >
>
>
> my gtk version == 2.16.2
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] RGtk in a windows 64 bits machine

2011-03-14 Thread Michael Lawrence
Have you installed the 64 bit binaries of GTK+?

http://ftp.gnome.org/pub/gnome/binaries/win64/gtk+/2.22/gtk+-bundle_2.22.1-20101229_win64.zip

Michael

On Mon, Mar 14, 2011 at 4:56 AM, Joaquim Tinoco
wrote:

> Dear all,
>
>
>
> I am relatively new to R!
>
> I migrated from a windows 32-bits machine to windows 64-bits machine and
> now when I try loading and use "RGtk2" library the following error message
> is presented:
>
>
>
> > library("RGtk2")
>
> Error in inDL(x, as.logical(local), as.logical(now), ...) :
>
>  unable to load shared object
> 'C:/Users/JOAQUIM/Documents/R/win-library/2.12/RGtk2/libs/x64/RGtk2.dll':
>
>  LoadLibrary failure:  %1 não é uma aplicação de Win32 válida.
>
>
>
> Failed to load RGtk2 dynamic library, attempting to install it.
>
> Error : .onLoad failed in loadNamespace() for 'RGtk2', details:
>
>  call: install_all()
>
>  error: This platform is not yet supported by the automatic installer.
> Please install GTK+ manually, if necessary. See: http://www.gtk.org
>
> Error: package/namespace load failed for 'RGtk2'
>
>
>
> Someone know why this error appears??
>
> I am running Windows  7, with R 2.12.2
>
>
>
> Thanks you.
>
>
>
>
> Best regards,
>
>Joaquim Tinoco
>
>
>
>
>[[alternative HTML version deleted]]
>
>
> __
> R-help@r-project.org 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.
>
>

[[alternative HTML version deleted]]

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


Re: [R] problems with playwith

2011-03-01 Thread Michael Lawrence
Do you get an error message in a dialog box? My guess is that you just need
to update your GTK+.

On Tue, Mar 1, 2011 at 8:58 AM, R Heberto Ghezzo, Dr <
heberto.ghe...@mcgill.ca> wrote:

> hello, i tried to run playwith but :
>
> > library(playwith)
> Loading required package: lattice
> Loading required package: cairoDevice
> Loading required package: gWidgetsRGtk2
> Loading required package: gWidgets
> Error in inDL(x, as.logical(local), as.logical(now), ...) :
>  unable to load shared object 'H:/R/cran/RGtk2/libs/i386/RGtk2.dll':
>  LoadLibrary failure:  The specified procedure could not be found.
> Failed to load RGtk2 dynamic library, attempting to install it.
> Learn more about GTK+ at http://www.gtk.org
> If the package still does not load, please ensure that GTK+ is installed
> and that it is on your PATH environment variable
> IN ANY CASE, RESTART R BEFORE TRYING TO LOAD THE PACKAGE AGAIN
> Error : .onAttach failed in attachNamespace() for 'gWidgetsRGtk2', details:
>  call: .Call(name, ..., PACKAGE = PACKAGE)
>  error: C symbol name "S_gtk_icon_factory_new" not in DLL for package
> "RGtk2"
> Error: package 'gWidgetsRGtk2' could not be loaded
> >
> > Sys.getenv("PATH")
>
>
>
>
>PATH
> "H:\\R/GTK/bin;H:\\R/GTK/lib;H:\\R/ImageMagick;C:\\windows\\system32;C:\\windows;C:\\windows\\System32\\Wbem;C:\\windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program
> Files\\Common Files\\Ulead Systems\\MPEG;C:\\Program
> Files\\QuickTime\\QTSystem\\;H:\\R\\GTK\\GTK2-Runtime\\bin;H:\\PortableUSB/PortableApps/MikeTex/miktex/bin"
> >
> packages(lattice, cairoDevice, gWidgetsRGtk2, gWidgets, RGtk2, playwith)
> were reinstalled
> program GTK was reinstalled.
> using R-2-12-2 on Windows 7
> Can anybody suggest a solution?
> thanks
>
> R.Heberto Ghezzo Ph.D.
> Montreal - Canada
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] Failing to install {rggobi} on win-7 R 2.12.0

2011-02-05 Thread Michael Lawrence
Hi Tal,

Thanks for working through this. GGobi needs to be rebuilt for the new
version of GTK+. I'm probably the person to do that, but my time is short
these days. I'll try to get to it soon. The new binary will just include the
necessary DLLs, so that this GTK+ installation step is unnecessary.

Michael

On Sat, Feb 5, 2011 at 2:57 AM, Tal Galili  wrote:

> Dear Prof Brian Ripley and others,
>
> After (finally) checking again, I found that ggobi doesn't work with the
> newer GTK (probably needed for R 2.12.0).
>
> Here is the results of my experimentations:
>
>
> *What works:*
> Installing ggobi and the GTK (version 2.12.9) provided on:
> http://www.ggobi.org/downloads/
> Will *work* with R 2.11.1 + rggobi (version 2.1.14)
> (notice that the newest version 2.1.16, is not available for windows users.
>  And the newer version 2.1.16-3 is not available on CRAN:
> http://cran.r-project.org/web/packages/rggobi/index.html)
>
>
> *What doesn't work:*
> Trying this with R 2.12.0 with rggobi (version 2.1.16-3), will *crash* with
> the error:
>
> "the procedure entry point g_malloc_n could not be located in the
> dynamic link library libglic-2.0-0.dll"
>
>
> When then trying to install gtk+ from the dialog box offered, then it
> downloads GTK (version 2.22.0 instead of 2.12.9) from here:
>
> http://downloads.sourceforge.net/gtk-win/gtk2-runtime-2.22.0-2010-10-21-ash.exe?download
> '
>
> After doing this, ggobi (not rggobi) itself, won't run. It will crash with
> the error:
>
> "the procedure entry point g_assertion_message_error could not be located
> in
> the
> dynamic link library libglib-2.0-0.dll"
>
>
> Trying then to insert the dll's from the packages Prof Brian Ripley
> suggested (libxml2.dll and iconv.dll) won't fix the problem.
> Also using the libglib-2.0-0.dll from the old GTK package won't help.
> Also, reinstalling ggobi won't work.
>
>
>
> Any suggestions on how to make ggobi work with the newer version of GTK ?
>
> Thanks,
> Tal
>
>
>
>
>
>
> Contact
> Details:---
> Contact me: tal.gal...@gmail.com |  972-52-7275845
> Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
> www.r-statistics.com (English)
>
> --
>
>
>
>
> On Wed, Jan 26, 2011 at 4:50 PM, Tal Galili  wrote:
>
> > I checked it using:
> >
> > Sys.getenv("PATH")
> >
> > And the output includes the PATH to the GTK2 installation (it's the last
> > item in the following list):
> >
> >
> "C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program
> > Files (x86)\\Common Files\\Ulead Systems\\MPEG;C:\\Program
> > Files\\TortoiseGit\\bin;C:\\Program Files
> > (x86)\\QuickTime\\QTSystem\\;C:\\Program Files (x86)\\ggobi;C:\\Program
> > Files (x86)\\GTK2-Runtime\\bin"
> >
> >
> > What else might I try?
> >
> >
> > (Thanks)
> >
> >
> > Contact
> > Details:---
> > Contact me: tal.gal...@gmail.com |  972-52-7275845
> > Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
> > www.r-statistics.com (English)
> >
> >
> --
> >
> >
> >
> >
> > On Wed, Jan 26, 2011 at 4:23 PM, Prof Brian Ripley <
> rip...@stats.ox.ac.uk>wrote:
> >
> >> Your GTK+ installation is not being found: check your PATH.
> >>
> >>
> >> On Wed, 26 Jan 2011, Tal Galili wrote:
> >>
> >>  Hello Prof Brian Ripley, Yihui and Tom,
> >>>
> >>> Thank you for your suggestions.  It seemed to have made some
> differences
> >>> in
> >>> the error massages - but rggobi still fails to load.
> >>>
> >>> Steps taken:
> >>> 1) I removed the old GTK (through the uninstall interface)
> >>> 2) I ran  library(RGtk2) which downloaded the new GTK-runtime
> >>> version 2.22.0-2010-10-21 (instead of the one I got from ggobi, which
> >>> was 2.12.9-2).
> >>> 3) I downloaded both
> >>> ftp://ftp.zlatkovic.com/libxml/libxml2-2.7.7.win32.zip and
> >>> ftp://ftp.zlatkovic.com/libxml/iconv-1.9.2.win32.zip
> >>> Unzipped them, and moved their dll's (from their bin directory), into -
> >>> C:\Program Files (x86)\GTK2-Runtime\bin
> >>> 4) I then tried starting rggobi:  library(rggobi)  and got the
> following
> >>> error massages:
> >>>
> >>> Error 1:
> >>>  the program can't start because
> >>> libgdk-win32-2.0-0.dll
> >>> is missing from your computer.
> >>> Try reinstalling the program to fix this problem.
> >>>
> >>> It then tried to reinstall GTK, and after I refused to, it sent the
> >>> second
> >>> Error massage:
> >>>  the program can't start because
> >>> libfreetype-6.dll
> >>> is missing from your computer.
> >>> Try reinstalling the program to fix this problem.
> >>>
> >>>
> >>>
> >>> Any suggestions what else I should try?
> >>>
> >>> Many thanks for helping,
> >>> Tal
> >>>
> >>>

Re: [R] RGtk2 compilation problem

2011-01-06 Thread Michael Lawrence
On Thu, Jan 6, 2011 at 8:53 AM, Prof Brian Ripley wrote:

> You need RGtk2 2.20.7 which is now on CRAN.  Others have seen this, but it
> has taken a while to track down the exact cause.
>
> The diagnosis was that ML used a recent GNU tar which created a tarball
> with hard links that R's untar was not prepared to deal with. We consider
> that is a bug in GNU tar, but untar() has been updated in R-patched to cope.
>
>
After a lot of back and forth with the GNU tar guys, it turns out they do
not consider this to be a bug. I had to refresh my knowledge of hard linking
to understand. A hard link is from a file name to the actual inode in the
file system. Typically every file has a single hard link (the name of the
file). The -h option used to resolve a symbolic link differently, based on
whether the hard link count of the target was 1 or >=2. This was practically
useful in my mind, because symlinks to any files without any explicitly
added hard links would become a regular file in the archive. They have now
dropped this distinction, calling it an inconsistency (apparently other
implementations of tar have never made such a distinction). So symlinks now
become hard links in the archive (as long as the target is in the archive).
We may need to keep the fix in untar() to handle this. Either way, RGtk2
2.20.7 should work now.

Thanks,
Michael


> If you have such a tarball, try setting the environment variable
> R_INSTALL_TAR to 'tar' (or whatever GNU tar is called on your system) when
> installing the tarball.
>
> For those packaging source packages: in the unusual event that your package
> sources contains symbolic (or even hard) links, don't use GNU tar 1.24 or
> 1.25.
>
>
> On Thu, 6 Jan 2011, Shige Song wrote:
>
>  Look forward to it.
>>
>> Thanks.
>>
>> Shige
>>
>> On Sat, Jan 1, 2011 at 8:45 AM, Michael Lawrence
>>  wrote:
>>
>>> Please watch for 2.20.5 and let me know if it helps. Not really sure what
>>> is
>>> going on here, but someone else has reported the same issue.
>>>
>>> Thanks,
>>> Michael
>>>
>>> On Wed, Dec 29, 2010 at 6:44 AM, Shige Song  wrote:
>>>
>>>>
>>>> Dear All,
>>>>
>>>> I am trying to compile&install the package "RGtk2" on my Ubuntu 10.04
>>>> box. I did not have problem with earlier versions, but with the new
>>>> version, I got the following error message :
>>>>
>>>
> ...
>
> --
> Brian D. Ripley,  rip...@stats.ox.ac.uk
> Professor of Applied Statistics,  
> http://www.stats.ox.ac.uk/~ripley/<http://www.stats.ox.ac.uk/%7Eripley/>
> University of Oxford, Tel:  +44 1865 272861 (self)
> 1 South Parks Road, +44 1865 272866 (PA)
> Oxford OX1 3TG, UKFax:  +44 1865 272595
>

[[alternative HTML version deleted]]

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


Re: [R] RGtk2 compilation problem

2011-01-01 Thread Michael Lawrence
Please watch for 2.20.5 and let me know if it helps. Not really sure what is
going on here, but someone else has reported the same issue.

Thanks,
Michael

On Wed, Dec 29, 2010 at 6:44 AM, Shige Song  wrote:

> Dear All,
>
> I am trying to compile&install the package "RGtk2" on my Ubuntu 10.04
> box. I did not have problem with earlier versions, but with the new
> version, I got the following error message :
>
> -
> * installing *source* package ‘RGtk2’ ...
> checking for pkg-config... /usr/bin/pkg-config
> checking pkg-config is at least version 0.9.0... yes
> checking for INTROSPECTION... no
> checking for GTK... yes
> checking for GTHREAD... yes
> checking for gcc... gcc
> checking whether the C compiler works... yes
> checking for C compiler default output file name... a.out
> checking for suffix of executables...
> checking whether we are cross compiling... no
> checking for suffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether gcc accepts -g... yes
> checking for gcc option to accept ISO C89... none needed
> checking how to run the C preprocessor... gcc -E
> checking for grep that handles long lines and -e... /bin/grep
> checking for egrep... /bin/grep -E
> checking for ANSI C header files... yes
> checking for sys/types.h... yes
> checking for sys/stat.h... yes
> checking for stdlib.h... yes
> checking for string.h... yes
> checking for memory.h... yes
> checking for strings.h... yes
> checking for inttypes.h... yes
> checking for stdint.h... yes
> checking for unistd.h... yes
> checking for uintptr_t... yes
> configure: creating ./config.status
> config.status: creating src/Makevars
> ** libs
> gcc -std=gnu99 -I/usr/local/lib/R/include -g -D_R_=1 -pthread
> -D_REENTRANT -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include
> -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0
> -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0
> -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1
> -I/usr/include/freetype2 -I/usr/include/directfb
> -I/usr/include/libpng12   -I.  -DHAVE_UINTPTR_T  -I/usr/local/include
>  -fpic  -g -O2 -c RGtkDataFrame.c -o RGtkDataFrame.o
> In file included from RGtk2/gtk.h:19,
> from RGtkDataFrame.h:1,
> from RGtkDataFrame.c:1:
> ./RGtk2/gdkClasses.h:4:23: error: RGtk2/gdk.h: No such file or directory
> make: *** [RGtkDataFrame.o] Error 1
> ERROR: compilation failed for package ‘RGtk2’
> * removing ‘/usr/local/lib/R/library/RGtk2’
> * restoring previous ‘/usr/local/lib/R/library/RGtk2’
>
> The downloaded packages are in
>‘/tmp/RtmprSWbka/downloaded_packages’
> Updating HTML index of packages in '.Library'
> Warning message:
> In install.packages("RGtk2", dep = T) :
>  installation of package 'RGtk2' had non-zero exit status
>
> 
>
> I noticed the requirement for the package
> (http://cran.r-project.org/web/packages/RGtk2/index.html) saying
> "...GTK+ (>= 2.8.0)..." The latest GTK+ is 2.20, could this be the
> problem?
>
> Many thanks.
>
> Best,
> Shige
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] Problem in installing and starting Rattle

2010-11-18 Thread Michael Lawrence
On Mon, Nov 15, 2010 at 10:57 AM, Graham Williams <
graham.willi...@anu.edu.au> wrote:

> On 16 November 2010 02:40, Feng Mai  wrote:
>
> >
> > I also have the problem trying to start rattle
> >
> > Windows 7 32-bit R 2.12.0
> >
> > When I try library(rattle) I get an error message
> > "The procedure entry point deflateSetHeader could not be located in the
> > dynamic link library zilb1.dll"
> > I hit OK and it prompts me to install GTK+ again. I tried to uninstall
> GTK+
> > first and delete all related files as Dieter suggested but still wont
> work
> > :(
>
>
> Yes, this is another issue that arose with R 2.12.0 and discussed on the
> rattle-users mailing list (http://groups.google.com/group/rattle-users).
> Be
> sure to use the newest version of Rattle (currently 2.5.47) where this has
> been "fixed". I've not worked out why, but if the XML package is loaded
> before the RGtk2 package we see this error, but not if RGtk2 is loaded
> first. Rattle now loads RGtk2 first.
>
>
The reason is that the zlib1.dll provided with XML is older than the one
expected by the automatically installed GTK+ binaries. I'm working on a way
to make installing RGtk2 easier for others.


> Regards,
> Graham
>
>
>
> >
> > --
> > View this message in context:
> >
> http://r.789695.n4.nabble.com/Problem-in-installing-and-starting-Rattle-tp3042502p3043262.html
> > Sent from the R help mailing list archive at Nabble.com.
> >
> > __
> > R-help@r-project.org 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.
> >
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] Playwith-problem with loading

2010-11-18 Thread Michael Lawrence
On Tue, Nov 16, 2010 at 10:59 AM, Fencl, Martin wrote:

> Helllo,
> I am having trouble with running the library Playwith in the R-2.12.0.
> running under 32bit Windows XP. After calling the library the error message
> "The procedure entry point gdk_cairo_reset_clip could not be located in the
> dynamic library libgdk-win32-2.0-0.dll." occurs and the R asks for instaling
> the GTK+ package. However the instalation of GTK+ thorugh the R fails. I
> have installed GTK+ by installing GIMP 2.0 version 2.6.10 and set the path
> of environment variables. But it still does not work. It seems to be that
> the problem is in gtk2 (which I also installed).
> Thank you for any hints!
>
>
The GIMP binary of GTK+ has been known not to work well with R, and probably
simply is not new enough in this case. What do you mean the GTK+ installer
fails? Some details on that would be helpful.

Thanks,
Michael



>
> > library(playwith)
> Loading required package: lattice
> Loading required package: cairoDevice
> Loading required package: gWidgetsRGtk2
> Loading required package: gWidgets
> Error in inDL(x, as.logical(local), as.logical(now), ...) :
>  unable to load shared object
> 'C:/PROGRA~1/R/R-212~1.0/library/RGtk2/libs/i386/RGtk2.dll':
>  LoadLibrary failure:  The specified procedure could not be found.
>
>
> Failed to load RGtk2 dynamic library, attempting to install it.
> trying URL '
> http://downloads.sourceforge.net/gtk-win/gtk2-runtime-2.22.0-2010-10-21-ash.exe?download
> '
> Content type 'application/x-msdos-program' length 7820679 bytes (7.5 Mb)
> opened URL
> downloaded 7.5 Mb
>
> Learn more about GTK+ at http://www.gtk.org
> If the package still does not load, please ensure that GTK+ is installed
> and that it is on your PATH environment variable
> IN ANY CASE, RESTART R BEFORE TRYING TO LOAD THE PACKAGE AGAIN
> Error : .onAttach failed in attachNamespace() for 'gWidgetsRGtk2', details:
>  call: .Call(name, ..., PACKAGE = PACKAGE)
>  error: C symbol name "S_gtk_icon_factory_new" not in DLL for package
> "RGtk2"
> Error: package 'gWidgetsRGtk2' could not be loaded
> >
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


[R] [R-pkgs] RGtk2 2.20.x

2010-11-08 Thread Michael Lawrence
This is to announce the release of the RGtk2 2.20.x series. RGtk2 is an
interface between R and the GTK+ GUI toolkit and friends. The new release
updates the bindings to support up to GTK+ 2.20 (and remains backwards
compatible to 2.8). Previously, the interface supported only up to GTK+
2.12, which is several years old.

New features in GTK 2.20 (relative to 2.12) include:

* GtkInfoBar widget: Displays transient popup notifications, generally at
the bottom of the window (near the status bar).
* Off-screen rendering of widgets, e.g., automatically save a widget or
visualization to disk.
* GtkSpinner: Animated widget for indicating activity
* GtkToolPalette: Essentially a multi-row toolbar with drag and drop of
toolbar items between the palette and other tool item containers.

The bindings to Pango and Cairo were also updated to the latest stable
versions.

RGtk2 also adds a new library to its interface: GIO (2.22), a low-level
library supporting asynchronous streaming I/O, mounting of volumes,
networking, etc. Might be useful.

There is also a new mode of error handling available, that is disabled by
default. By setting the option "RGtk2::newErrorHandling" to TRUE, errors in
the libraries will result in errors in R (instead of warnings), and the
error object is no longer returned, which often simplifies return values by
no longer requiring a list to hold both the error and the original return
value. This is probably a more sensible strategy.

Windows users: The new binaries for Windows are being built against 2.20, so
you'll need to get GTK+ 2.20 (or higher, 2.22 is released but does not
really add any new features) for Windows at:
http://gtk-win.sourceforge.net/home/index.php/en/Downloads.

Thanks,
Michael

[[alternative HTML version deleted]]

___
R-packages mailing list
r-packa...@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-packages

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


Re: [R] RGTK2 - Entry Point not found

2010-10-28 Thread Michael Lawrence
2010/10/28 W Eryk Wolski 

> Failed to load RGtk2 dynamic library, attempting to install it.
> trying URL '
> http://downloads.sourceforge.net/gladewin32/gtk-2.12.9-win32-2.exe'
> Content type 'application/x-msdownload' length 7378984 bytes (7.0 Mb)
>
> I run the complete setup of GTK .
> Hence, I assume Version 2.12.9 is installed on my box.
>
> My path variable starts with:
> %GTK_BASEPATH%\bin;
>
>
> Any other ideas?
>
>
It may be that you have some other cairo DLL in your PATH that is somehow
conflicting with the one installed with GTK+...


>
>
> 2010/10/28 £ukasz Rêc³awowicz :
> > "The stable version of RGtk2 requires GTK version 2.8.0 or higher (and
> its
> > dependencies)."
> >
> > --
> > Mi³ego dnia
> >
> >
> >
> >
> >
>
>
>
> --
> Witold Eryk Wolski
>
> Heidmark str 5
> D-28329 Bremen
> tel.: 04215261837
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] Zoom in in a plot

2010-10-27 Thread Michael Lawrence
You might want to check out the Qt stuff we've been working on. The qtutils
package has a graphics device that supports zooming and other fun stuff.
Also, qtpaint provides a flexible low-level engine for interactive graphics.

See: http://github.com/ggobi/qtpaint and http://github.com/ggobi/qtutils.
They require qtbase from: http://github.com/ggobi/qtbase.

They require the installation of Qt: http://qt.nokia.com. Still working on
Windows support.

Michael

On Tue, Oct 26, 2010 at 11:19 PM, Alaios  wrote:

> Actually I want to see  how close are some point to a line segment  so I
> want to
> use some zoom lenses and zoom in and out into different parts of the plot
> and
> see how some places look like.
>
> Best Regards
>
>
>
>
> 
> From: Greg Snow 
>
> Sent: Tue, October 26, 2010 6:47:32 PM
> Subject: RE: [R] Zoom in in a plot
>
> For a quick exploration of the plot you can use the zoomplot function in
> the
> TeachingDemos package.  But for production graphs it is better to
> explicitly set
> the xlim and ylim parameters in creating the plot up front.
>
> --
> Gregory (Greg) L. Snow Ph.D.
> Statistical Data Center
> Intermountain Healthcare
> greg.s...@imail.org
> 801.408.8111
>
>
> > -Original Message-
> > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> > project.org] On Behalf Of Alaios
> > Sent: Tuesday, October 26, 2010 9:31 AM
> > To: Rhelp
> > Subject: [R] Zoom in in a plot
> >
> > in a simple plot. When i do plot is it possible to zoom in or out or
> > this is not
> > possible at all?
> >
> > Best Regards
> > Alex
> >
> >
> >
> >
> > [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org 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.
>
>
>
>
>[[alternative HTML version deleted]]
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] Problem loading RGtk2 (iconv.dll)

2010-05-28 Thread Michael Lawrence
This sounds like a DLL conflict to me. For example, do you have Matlab
installed? Sometimes if Matlab is on the PATH, the DLLs can conflict.

Michael

On Thu, May 27, 2010 at 11:06 PM, Tal Galili  wrote:

> Hello dear R-help list and Michael Lawrence.
>
> I wish to use GTK with R.
> I installed the newest RGtk2 and GTK from:
>
> http://sourceforge.net/projects/gladewin32/files/gtk%2B-win32-devel/2.12.9/gtk-dev-2.12.9-win32-2.exe/download
> on the path:
> C:\Program Files\Common Files\GTK\2.0\
>
> And followed the instructions on the installation manual for RGtk2, and
> added the line:
> GTK_PATH=C:/Program Files/Common Files/GTK/2.0
> To the
> etc/Renviron.site
> file.
>
>
> Yet when I come to  load the package via require("RGtk2"), I get the
> following *error massage*:
>
>> the procedure entry point libiconv_set_relocation_prefix could not be
>> located in the dynamic linke library iconv.dll
>
>
> And then (in the R console) I get:
> Loading required package: RGtk2
> Error in inDL(x, as.logical(local), as.logical(now), ...) :
>   unable to load shared library 'C:/Program
> Files/R/library/RGtk2/libs/RGtk2.dll':
>   LoadLibrary failure:  The specified procedure could not be found.
>
> The interesting thing is that after I install GTK (through the
> auto-install), then RGtk2 loads without error in R.  But if I try to run
> something, for example:
> demo(alphaSlider)
> I will get the error massage:
> Error in .Call(name, ..., PACKAGE = PACKAGE) :
>   C symbol name "S_gtk_window_new" not in DLL for package "RGtk2"
>
>
> Upon restarting R, again, I wouldn't be able to use  require("RGtk2")
>
> Here is my sessionInfo()
>
>> R version 2.11.0 (2010-04-22)
>
> i386-pc-mingw32
>
>
>> locale:
>
> [1] LC_COLLATE=English_United States.1252
>
> [2] LC_CTYPE=English_United States.1252
>
> [3] LC_MONETARY=English_United States.1252
>
> [4] LC_NUMERIC=C
>
> [5] LC_TIME=English_United States.1252
>
>
>> attached base packages:
>
> [1] stats graphics  grDevices utils datasets  methods   base
>
>
>> other attached packages:
>
> [1] RGtk2_2.12.18
>
>
>> loaded via a namespace (and not attached):
>
> [1] tools_2.11.0
>
>
> (I am running win XP)
>
>
> I tried searching for this error on the mailing list and on google, but
> couldn't find a solution.
>
>
> Thanks,
> Tal
>
>
>
>
>
>
>
> Contact
> Details:---
> Contact me: tal.gal...@gmail.com |  972-52-7275845
> Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
> www.r-statistics.com (English)
>
> --
>
>
>

[[alternative HTML version deleted]]

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


Re: [R] Follow up on installing formatR...

2010-04-19 Thread Michael Lawrence
On Mon, Apr 19, 2010 at 5:28 AM, Brian Lunergan  wrote:

> Good morning folks:
>
> Made a second go at installing this and succeeded, but with some strange
> behaviours along the way. First the system back story.
>
>
My only guess is that installing RGtk2 from source is only possible if you
have the gtk-devel package installed, i.e., the one with the headers.
Otherwise, you'll need the r-cran-rgtk2 binary.

Michael

Using up to date edition Ubuntu 8.04
>
> Using up to date edition of R 2.10.1
>
> Using the Toronto, Ontario repository to draw from.
>
> After the first attempt ended up with two of the four dependencies
> installed so only the Rgtk related items would be needed this time. Went
> into synaptic and found r-cran-rgtk2. Okay. Sounded likely so I installed
> it successfully.
>
Using a root terminal session I went back into R and ran
> install.packages("formatR"). Pulled in two dependencies plus the main
> choice. Rejected one and kept two when it came time to install but still
> installed successfully, or so it seemed when I ran library(formatR). Go
> figure. A copy of the message run follows. Any comments or suggestions will
> be of interest.
>
> > install.packages("formatR")
> Warning in install.packages("formatR") :
>  argument 'lib' is missing: using '/usr/local/lib/R/site-library'
> --- Please select a CRAN mirror for use in this session ---
> Loading Tcl/Tk interface ... done
> also installing the dependencies ‘RGtk2’, ‘gWidgetsRGtk2’
>
> trying URL 'http://probability.ca/cran/src/contrib/RGtk2_2.12.18.tar.gz'
> Content type 'application/x-gzip' length 2206504 bytes (2.1 Mb)
> opened URL
> ==
> downloaded 2.1 Mb
>
> trying URL '
> http://probability.ca/cran/src/contrib/gWidgetsRGtk2_0.0-64.tar.gz'
> Content type 'application/x-gzip' length 138192 bytes (134 Kb)
> opened URL
> ==
> downloaded 134 Kb
>
> trying URL 'http://probability.ca/cran/src/contrib/formatR_0.1-3.tar.gz'
> Content type 'application/x-gzip' length 2672 bytes
> opened URL
> ==
> downloaded 2672 bytes
>
> * installing *source* package ‘RGtk2’ ...
> checking for pkg-config... /usr/bin/pkg-config
> checking pkg-config is at least version 0.9.0... yes
> checking for LIBGLADE... no
> configure: WARNING: libglade not found
> checking for INTROSPECTION... no
> checking for GTK... no
> configure: error: GTK version 2.8.0 required
> ERROR: configuration failed for package ‘RGtk2’
> * removing ‘/usr/local/lib/R/site-library/RGtk2’
> * installing *source* package ‘gWidgetsRGtk2’ ...
> ** R
> ** inst
> ** preparing package for lazy loading
> ** help
> *** installing help indices
> ** building package indices ...
> * DONE (gWidgetsRGtk2)
> * installing *source* package ‘formatR’ ...
> ** R
> ** preparing package for lazy loading
> Loading required package: gWidgets
> Loading required package: MASS
> ** help
> *** installing help indices
> ** building package indices ...
> * DONE (formatR)
>
> The downloaded packages are in
>‘/tmp/RtmpNL20Be/downloaded_packages’
> Warning message:
> In install.packages("formatR") :
>  installation of package 'RGtk2' had non-zero exit status
> >
>
> --
> Brian Lunergan
> Nepean, Ontario
> Canada
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] RGtk2:::gdkColorToString throws an error

2010-03-13 Thread Michael Lawrence
Actually, the problem is more likely that RGtk2 is not built against GTK+
2.12 on Windows. I assume you're using an up-to-date version of R. I'll ask
Uwe about getting a newer version of GTK+.

On Mon, Mar 8, 2010 at 7:29 PM, Wincent  wrote:

> Dear Michael, thanks. I have installed gtk+ 2-12.9 revision 2 from
> http://gladewin32.sourceforge.net/, it still doesn't work.
> I tried gtk2-runtime-2.16.6-2010-02-24-ash.exe from
> http://gtk-win.sourceforge.net/home/index.php/en/Downloads, it did not
> solve the issue neither.
>
> Could you please give me more hints?  My OS is windows vista.
>
> Regards
>
> Ronggui
>
> On 26 October 2009 23:27, Michael Lawrence  wrote:
> > Hi and sorry for the late reply. The Gdk library is part of the GTK+
> bundle
> > (GTK+, Gdk and GdkPixbuf are distributed together and have synchronized
> > versions). So you'll just need GTK+ 2.12 or higher.
> >
> > Michael
> >
> > On Tue, Oct 20, 2009 at 8:16 AM, Ronggui Huang 
> > wrote:
> >>
> >> Dear all,
> >>
> >> I try to use RGtk2:::gdkColorToString, but it throws an error:
> >> Error in .RGtkCall("S_gdk_color_to_string", object, PACKAGE = "RGtk2") :
> >>  gdk_color_to_string exists only in Gdk >= 2.12.0
> >>
> >> I know what it means, but don't know to solve this problem because I
> >> don't know where I can download the referred gdk library. Any
> >> information? Thank you.
> >>
> >> --
> >> HUANG Ronggui, Wincent
> >> Doctoral Candidate
> >> Dept of Public and Social Administration
> >> City University of Hong Kong
> >> Home page: http://asrr.r-forge.r-project.org/rghuang.html
> >
> >
>
>
>
> --
> Wincent Ronggui HUANG
> Doctoral Candidate
> Dept of Public and Social Administration
> City University of Hong Kong
> http://asrr.r-forge.r-project.org/rghuang.html
>

[[alternative HTML version deleted]]

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


Re: [R] how to put ggobi display into a GUI window setup by gWidgets

2009-12-02 Thread Michael Lawrence
On Mon, Nov 30, 2009 at 7:49 AM, j verzani  wrote:

> jerry83  yahoo.com> writes:
>
> Jerry, see below:
>
> >
> >
> > Hi John,
> >
> > Thanks A LOT for your reply and the code. What I want to do is to include
> the
> ggobi display window to the widget
> > window setup by me. I tried add before but it said can not do it for
> GGobiScatterplotDisplay. Do you have
> > any idea about add displays?
> >
> > Thanks again for your help.
> > Â
> >
> > 
> > From: jverzaniNWBKZ [via R] 
> n4.nabble.com>
> >
> > Sent: Sun, November 29, 2009 5:19:43 PM
> > Subject: Re: [R] how to put ggobi display into a GUI window setup by
> gWidgets
> >
> > jerry83  yahoo.com> writes:
> >
> > >
> > >
> > > Hi,
> > >
> > > I want to put a ggobi display into a GUI window setup by gWidgets, but
> error
> > > occur said it is not a S4 object.
> > >
> > > Does anyone have any idea about how to put it in or maybe it can not be
> put
> > > into a widget at all?
> > >
> > > Thanks A LOT!
> >
> > To embed a GTK widget into gWidgets isn't too hard, just call the add
> method.
> > I'm not sure how  to get the GTK object you want from the ggobi
> > interface. Below is an example that you might be able to modify:
> >
> > ##
> > library(RGtk2)
> > library(rggobi)
> > library(gWidgets)
> > options(guiToolkit="RGtk2")
> >
> > ## ggoobi object
> > x <- ggobi(mtcars)
> >
> > ## grab child from main window. Modify (how?) to get
> > ## other widgets
> > toplevel <- ggobi_gtk_main_window(x)
> > child <- toplevel[[1]] Â # toplevel has only one child
> > toplevel$remove(child) Â # remove child if keeping toplevel
> > toplevel$destroy() Â  Â  Â # or destroy if not
> >
>
> ## add to a gWidget instance using gWidgetsRGtk2:
> > w <- gwindow("A gwidget's window")
> > g <- ggroup(cont = w, expand=TRUE)
> > add(g, child, expand=TRUE)
> >
> > --John
> >
>
>
> Here is some code to grab the display for a new display. I don't know
> how to get the initial display or even how to suppress it, but I'm
> not a ggobi user at this point.
>
> library(RGtk2)
> library(rggobi)
> library(gWidgets)
> options(guiToolkit="RGtk2")
>
> x <- ggobi(mtcars)
> ## not sure how to get the initial display,
> ## here we create a new display and move that
> disp <- display(x[1]) ## see display.GGobiData
>
>
Try

plotWidget <- display(x[1], embed=TRUE)

That will give you a display widget without hacking up the GGobi GUI.

## find table in the display heirarchy
> table <- disp[[2]]
>
> ## plot is third child (rulers are first two)
> plotWidget <- table[[3]]$getWidget()
> table$remove(plotWidget)
> ## hide window that held display. Destroy() causes errors
> disp$getParent()$hide()
>
> ## now we need to declass things so that gWidgets will
> ## recognize. The S3 classes from RGtk2 that gWidgets
> ## knows about are declared in package (should be
> ## dynamic, but aren't)
>
> class(plotWidget) <- class(plotWidget)[-(1:3)]
>
> w <- gwindow("A gwidget's window")
> g <- ggroup(cont = w, expand=TRUE)
> add(g, plotWidget, expand=TRUE)
>
>
>
> > __
> > [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.
> >
> > 
> >
> > View message @
> >
>
> http://n4.nabble.com/how-to-put-ggobi-display-into-a-GUI-window-setup-by-gWidgets-tp930529p930927.html
>
> > To unsubscribe from how to put ggobi display into a GUI window setup by
> gWidgets, click here.
> >
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] RGtk2:::gdkColorToString throws an error

2009-10-26 Thread Michael Lawrence
Hi and sorry for the late reply. The Gdk library is part of the GTK+ bundle
(GTK+, Gdk and GdkPixbuf are distributed together and have synchronized
versions). So you'll just need GTK+ 2.12 or higher.

Michael

On Tue, Oct 20, 2009 at 8:16 AM, Ronggui Huang wrote:

> Dear all,
>
> I try to use RGtk2:::gdkColorToString, but it throws an error:
> Error in .RGtkCall("S_gdk_color_to_string", object, PACKAGE = "RGtk2") :
>  gdk_color_to_string exists only in Gdk >= 2.12.0
>
> I know what it means, but don't know to solve this problem because I
> don't know where I can download the referred gdk library. Any
> information? Thank you.
>
> --
> HUANG Ronggui, Wincent
> Doctoral Candidate
> Dept of Public and Social Administration
> City University of Hong Kong
> Home page: http://asrr.r-forge.r-project.org/rghuang.html
>

[[alternative HTML version deleted]]

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


Re: [R] Redblack tree data structure

2009-09-04 Thread Michael Lawrence
Not sure of a RB tree available directly in R, but there's a nice public
domain C implementation from the UCSC genome browser library. It's used by
the IRanges Bioconductor package for implementing an interval tree.

On Fri, Sep 4, 2009 at 9:14 AM, Rune Schjellerup Philosof <
rphilo...@health.sdu.dk> wrote:

> I need to use a red-black tree, which package provides that data structure?
>
> --
> Best regards
>
> Rune Schjellerup Philosof
> Ph.d-stipendiat, Forskningsenheden for Biostatistik
>
> Telefon: 6550 3607
> E-mail:  rphilo...@health.sdu.dk
> Adresse: J.B. Winsløwsvej 9, 5000 Odense C
>
> SYDDANSK UNIVERSITET
> ___
> * Campusvej 55 * 5230 * Odense M * 6550 1000 * www.sdu.dk
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] How do I define the method for gcheckboxgroup in gWidgets?

2009-06-27 Thread Michael Lawrence
On Thu, Jun 25, 2009 at 8:29 AM, Bryan Hanson  wrote:

> Hi All...
>
> I¹m trying to build a small demo using gWidgets which permits interactive
> scaling and selection among different things to plot.  I can get the
> widgets
> for scaling to work just fine.  I am using gcheckboxgroup to make the
> (possibly multiple) selections.  However, I can¹t seem to figure out how to
> properly define the gcheckboxgroup; I can draw the widget properly, I think
> my handler would use the svalue right if it actually received it.  Part of
> the problem is using the index of the possible values rather than the
> values
> themselves, but I'm pretty sure this is not all of the problem.  I've been
> unable to find an example like this in any of the various resources I've
> come across.
>
> BTW,  report.which is really only there for troubleshooting.  It works to
> return the values, I can't get it to return the indices, which are probably
> what I need in this case.
>
> A demo script is at the bottom and the error is just below.
>
> > tmp <- gcheckboxgroup(stuff, handler = report.which, index = TRUE,
> + checked = c(TRUE, FALSE, FALSE, FALSE, FALSE), container = leftPanel)


The above code should "define" the gcheckboxgroup.

>
> > add(tmp, value = 1, expand = TRUE)


I'm not sure what you are trying to add here.


>
> Error in function (classes, fdef, mtable)  :
>  unable to find an inherited method for function ".add", for signature
> "gCheckboxgroupRGtk", "guiWidgetsToolkitRGtk2", "numeric"
>
> This error suggests that I don't have a method - I agree, but I don't know
> what goes into the method for gcheckboxgroup.
>
> For the sliders, it's clear to me how the actions and drawing of the
> widgets
> differ, but not so for gcheckboxgroup.
>
> A big TIA, Bryan
> *
> Bryan Hanson
> Professor of Chemistry & Biochemistry
> DePauw University, Greencastle IN USA
>
> Full Script:
>
> x <- 1:10
> y1 <- x
> y2 <- x^2
> y3 <- x^0.5
> y4 <- y^3
> df <- as.data.frame(cbind(x, y1, y2, y3, y4))
> stuff <- c("y = x", "y = x^2", "y = x^0.5", "y = x^3")
> which.y <- 2 # inital value, to be changed later by the widget
>
> # Define a function for the widget handlers
>
> update.Plot <- function(h,...) {
>plot(df[,1], df[,svalue(which.y)], type = "l",
>ylim = c(0, svalue(yrange)), main = "Interactive Selection & Scaling",
>xlab = "x values", ylab = "y values")
>}
>
> report.which <- function(h, ...) { print(svalue(h$obj), index = TRUE) }



In the above handler, do you mean to pass the 'index' parameter to the
svalue() function?


>
>
> # Define the actions & type of widget, along with returned values.
> # Must be done before packing widgets.
>
> yrange <- gslider(from = 0, to = max(y), by = 1.0,
>value = max(y), handler = update.Plot)
> which.y <- gcheckboxgroup(stuff, handler = report.which, index = TRUE,
>checked = c(TRUE, FALSE, FALSE, FALSE, FALSE))
>
> # Assemble the graphics window & groups of containers
>
> mainWin <- gwindow("Interactive Plotting")
> bigGroup <- ggroup(cont = mainWin)
> leftPanel <- ggroup(horizontal = FALSE, container = bigGroup)
>
> # Format and pack the widgets, & link to their actions/type
>
> tmp <- gframe("y range", container = leftPanel)
> add(tmp, yrange, expand = TRUE)
> tmp <- gcheckboxgroup(stuff, handler = report.which, index = TRUE,
>checked = c(TRUE, FALSE, FALSE, FALSE, FALSE), container = leftPanel)
> add(tmp, value = 1, expand = TRUE)
>
>
> # Put it all together
>
> add(mainWin, ggraphics()) # puts the active graphic window w/i mainWin
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] Gtk objects disappears

2009-06-13 Thread Michael Lawrence
I would recommend just running gtkMain(), so that GTK+ blocks R. Then you
need your GUI to call gtkMainQuit() when it's time to kill R.

On Fri, Jun 12, 2009 at 6:59 AM, Olivier Nuñez  wrote:

> Dear John,
>
> I have a question.
>
> When I  run a RGtk code in my terminal (without using the R GUI)
>
> R --vanilla << "EOF"
> source("myRGtkcode.R")
> EOF
>
> the GTK objects do not remain on the screen.
> Until now, I "bypass" this problem using the following commands:
>
> require(tcltk)
> tkmessageBox("Press to exit")
>
> But it is not really satisfactory and the tcltk Box cannot be
> minimized (at least in Mac OSX).
>
> Any idea?
>
> Best regards. Olivier
>
>
> --
> 
>
> Olivier G. Nuñez
> Email: onu...@iberstat.es
> Tel : +34 663 03 69 09
> Web: http://www.iberstat.es
>
> 
>
>
>
>
>
>[[alternative HTML version deleted]]
>
>
> __
> R-help@r-project.org 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.
>
>

[[alternative HTML version deleted]]

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


Re: [R] Programmatically copying a graphic to the clipboard

2009-06-13 Thread Michael Lawrence
Possible using RGtk2. Just need to get it into a GdkPixbuf. See
gtkClipboardSetImage(). To get a graphic as a pixbuf, you can use
cairoDevice (drawing to a GdkPixmap and copying over), or output the graphic
to a temporary file and read it back in.

Michael

On Fri, Jun 12, 2009 at 5:42 AM, Hadley Wickham  wrote:

> Hi all,
>
> Is there a cross-platform way to do this?  On the mac, I cando this by
> saving an eps file, and then using pbcopy. Is it possible on other
> platforms?
>
> Hadley
>
> --
> http://had.co.nz/
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] RGtk2 help: Show list of column names from dataset and categorize as factor or numeric

2009-06-04 Thread Michael Lawrence
On Thu, Jun 4, 2009 at 7:53 AM, Harsh  wrote:

> Hi UseRs,
> I recently started working with the RGtk2 library. The documentation
> is comprehensive and I've tried learning from the examples in most Gtk
> tutorials (which have C code). This is a little problematic, but has
> helped quite a bit in getting me started.
>
> I would like to create a GUI for file selection, which then displays
> the column names from the selected file, and provides the user with
> checkboxes with each column name for the user to select. Two columns
> of check boxes (Factor Type, Numeric Type) and one column of names is
> what I would like to display.
>

This would use what is known as a GtkTreeView widget. There is RGtkDataFrame
object that will tie an R data frame directly to a GtkTreeView as its
GtkTreeModel. See help(RGtkDataFrame). Using a GtkTreeView is pretty
complicated, but powerful. Basically, you create your RGtkDataFrame from an
R data.frame and pass it as the model to the gtkTreeView constructor. You
then need to add columns to the tree view to map the data to the view. Your
best bet is to check out the demos included with RGtk2, like "editableCells"
and "treeStore".


>
> Moreover, I am planning to create a GUI tool that would have tabs in a
> notebook layout, each tab providing a certain functionality, beginning
> from basic charting of data, and going on to applying regression
> models and such on the data.
>

help(GtkNotebook)


>
> This requires extensive knowledge in components that RGtk2 provides
> which could be implemented for the task outlined above. I have looked
> at the omegahat.org examples, but would like to see examples for such
> simple tasks as to how one could create a drop down list of column
> names to choose for x axis and another drop down allowing the choice
> of y axis, etc.
>

See help(GtkComboBox) and gtkComboBoxNewText().


>
> Having made the choice to use RGtk2, I would  appreciate if users
> could share their RGtk experience with me.
>

I wrote a paper on RGtk2, but for some reason it has never been published.
Probably time to write a book.


>
> Regards
> Harsh Singhal
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] GTK Tooltips under Linux

2009-06-02 Thread Michael Lawrence
I think I've got the threaded event loop working. Uploaded it to CRAN as
2.12.12. Should appear in a few days.

Michael

On Fri, May 29, 2009 at 11:24 AM, Ronggui Huang wrote:

> Noted with thanks.
>
> Regards
>
> Ronggui
>
> 2009/5/29 Michael Lawrence :
> >
> >
> > On Thu, May 28, 2009 at 7:35 PM, Ronggui Huang 
> > wrote:
> >>
> >> Dear all,
> >>
> >> I want to set tool-tips for a gtkButton. I use the following code
> >> which works under Windows. However, it doesn't work under Linux. Any
> >> hints? Thanks.
> >
> > Unfortunately, on platforms besides Windows, the event loop runs via an
> > input handler connected to X11. If you're waiting for a tooltip to show
> up,
> > there's obviously no input, so the event loop is not iterated.
> >
> > I think I could fix this by creating a separate thread that writes to a
> file
> > descriptor connected to an input handler. I'll try to do that.
> >
> > Michael
> >
> >>
> >> library(RGtk2)
> >> b<-gtkButtonNewWithLabel("OK")
> >> gtkTooltips()$setTip(b,"Memo for a Button.")
> >> gw <- gtkWindow(show=F)
> >> gw$Add(b)
> >> gw$Show()
> >>
> >> > sessionInfo()
> >> R version 2.8.0 Patched (2008-12-10 r47137)
> >> i686-pc-linux-gnu
> >>
> >> locale:
> >>
> >>
> LC_CTYPE=zh_CN.UTF-8;LC_NUMERIC=C;LC_TIME=zh_CN.UTF-8;LC_COLLATE=zh_CN.UTF-8;LC_MONETARY=C;LC_MESSAGES=C;LC_PAPER=zh_CN.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=zh_CN.UTF-8;LC_IDENTIFICATION=C
> >>
> >> attached base packages:
> >> [1] stats graphics  grDevices utils datasets  methods   base
> >>
> >> other attached packages:
> >> [1] RGtk2_2.12.11RQDA_0.1-8   igraph_0.5.2-2
> >> [4] gWidgetsRGtk2_0.0-51 gWidgets_0.0-35  RSQLite_0.7-1
> >> [7] DBI_0.2-4
> >>
> >> loaded via a namespace (and not attached):
> >> [1] tools_2.8.0
> >>
> >> --
> >> HUANG Ronggui, Wincent
> >> PhD Candidate
> >> Dept of Public and Social Administration
> >> City University of Hong Kong
> >> Home page: http://asrr.r-forge.r-project.org/rghuang.html
> >>
> >> __
> >> R-help@r-project.org 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.
> >
> >
>
>
>
> --
> HUANG Ronggui, Wincent
> PhD Candidate
> Dept of Public and Social Administration
> City University of Hong Kong
> Home page: http://asrr.r-forge.r-project.org/rghuang.html
>

[[alternative HTML version deleted]]

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


Re: [R] Interface R <--> Processing

2009-05-29 Thread Michael Lawrence
On Fri, May 29, 2009 at 3:47 AM,  wrote:

> Dear Group members
>
>
> I was wondering whether there is any interface to use processing (
> www.processing.org) to visualize R analyses?
>

Nothing direct, to my knowledge.

As far as I know, Processing is a high-level language on top of drawing and
user interface libraries. R is already a nice language for data analysis, so
there have been many efforts to connect R to existing libraries for doing
Processing-like things. Examples include iPlots, rggobi, RGtk2, and there
are several systems currently under development.



>
> If so could somebody point me to relevant ressources?
>
> If not, are there any attempts to build such an interface / package?
>
>
>
> Best Regards,
>
>
> Simon
> --
> Nur bis 31.05.: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate und
> Telefonanschluss nur 17,95 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] GTK Tooltips under Linux

2009-05-29 Thread Michael Lawrence
On Thu, May 28, 2009 at 7:35 PM, Ronggui Huang wrote:

> Dear all,
>
> I want to set tool-tips for a gtkButton. I use the following code
> which works under Windows. However, it doesn't work under Linux. Any
> hints? Thanks.
>

Unfortunately, on platforms besides Windows, the event loop runs via an
input handler connected to X11. If you're waiting for a tooltip to show up,
there's obviously no input, so the event loop is not iterated.

I think I could fix this by creating a separate thread that writes to a file
descriptor connected to an input handler. I'll try to do that.

Michael


>
> library(RGtk2)
> b<-gtkButtonNewWithLabel("OK")
> gtkTooltips()$setTip(b,"Memo for a Button.")
> gw <- gtkWindow(show=F)
> gw$Add(b)
> gw$Show()
>
> > sessionInfo()
> R version 2.8.0 Patched (2008-12-10 r47137)
> i686-pc-linux-gnu
>
> locale:
>
> LC_CTYPE=zh_CN.UTF-8;LC_NUMERIC=C;LC_TIME=zh_CN.UTF-8;LC_COLLATE=zh_CN.UTF-8;LC_MONETARY=C;LC_MESSAGES=C;LC_PAPER=zh_CN.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=zh_CN.UTF-8;LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats graphics  grDevices utils datasets  methods   base
>
> other attached packages:
> [1] RGtk2_2.12.11RQDA_0.1-8   igraph_0.5.2-2
> [4] gWidgetsRGtk2_0.0-51 gWidgets_0.0-35  RSQLite_0.7-1
> [7] DBI_0.2-4
>
> loaded via a namespace (and not attached):
> [1] tools_2.8.0
>
> --
> HUANG Ronggui, Wincent
> PhD Candidate
> Dept of Public and Social Administration
> City University of Hong Kong
> Home page: http://asrr.r-forge.r-project.org/rghuang.html
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] Draw a rectangle on top of an image using RGtk2?

2009-05-25 Thread Michael Lawrence
On Sat, May 23, 2009 at 8:27 AM, Ronggui Huang wrote:

> Thanks, Michael. Just one more follow-up question. Is there other way
> to get the "GdkDrawable" (here da2) without using <<- or other
> assignment operation from within expose_fn? I thought
> da$GetRootWindow() would work, but it does not.
>

You need to be drawing the rectangle within expose_fn, otherwise it won't
show up. There should be no need to access the GdkWindow (da2) of the
drawing area outside of expose_fn.

Michael


> da <- gtkDrawingArea()
> da2 <- NULL
>
> expose_fn <- function(widget,event,...){
> img <- gdkPixbufNewFromFile("/media/wind/Pictures/kaehatu.jpg")$retval
> da2 <<-widget[["window"]]
> gdkDrawPixbuf(da2, gc = NULL, pixbuf=img,
> event[["area"]][["x"]], event[["area"]][["y"]],
> event[["area"]][["x"]], event[["area"]][["y"]],
> event[["area"]][["width"]], event[["area"]][["height"]])
>  return(FALSE)
> }
> gSignalConnect(da,"expose-event",expose_fn)
> w<-gtkWindow(show=F)
> w$SetSizeRequest(400,300)
> w$Add(da)
> w$Show()
>
> dgc <- gdkGCNew(da2)
> gdkGCSetLineAttributes(dgc, line.width=2,
> line.style="solid","round","round")
> gdkDrawRectangle(da2,dgc,FALSE,10,10,100,100)
>
>
> Ronggui
>
> 2009/5/23 Michael Lawrence :
> >
> >
> > On Fri, May 22, 2009 at 11:27 PM, Ronggui Huang  >
> > wrote:
> >>
> >> Dear all,
> >>
> >> I use gtkImageFromFile to display an image. Then I want to do some
> >> gsignal to handle mouse event. I click the mouse and move a another
> >> position and release. I can get the position of the firs click and the
> >> release position,  then I would to draw a rectangle to display the
> >> region I have selected. I need some hints on what functions should I
> >> look for. I tried to google but don't know how.
> >
> > The GtkImage widget is just for showing images. If you want to start
> doing
> > interactive graphics, I'd suggest moving to the more general
> GtkDrawingArea
> > widget and connecting to the expose-event signal. You can then use
> GdkPixbuf
> > for loading and drawing the image onto the drawing area. And then draw a
> > rectangle on top with gdkDrawRectangle().
> >
> > See demos drawingArea and images.
> >
> > Michael
> >
> >>
> >> Thanks.
> >>
> >> --
> >> HUANG Ronggui, Wincent
> >> PhD Candidate
> >> Dept of Public and Social Administration
> >> City University of Hong Kong
> >> Home page: http://asrr.r-forge.r-project.org/rghuang.html
> >>
> >> __
> >> R-help@r-project.org 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.
> >
> >
>
>
>
> --
> HUANG Ronggui, Wincent
> PhD Candidate
> Dept of Public and Social Administration
> City University of Hong Kong
> Home page: http://asrr.r-forge.r-project.org/rghuang.html
>

[[alternative HTML version deleted]]

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


Re: [R] Draw a rectangle on top of an image using RGtk2?

2009-05-23 Thread Michael Lawrence
On Fri, May 22, 2009 at 11:27 PM, Ronggui Huang wrote:

> Dear all,
>
> I use gtkImageFromFile to display an image. Then I want to do some
> gsignal to handle mouse event. I click the mouse and move a another
> position and release. I can get the position of the firs click and the
> release position,  then I would to draw a rectangle to display the
> region I have selected. I need some hints on what functions should I
> look for. I tried to google but don't know how.
>

The GtkImage widget is just for showing images. If you want to start doing
interactive graphics, I'd suggest moving to the more general GtkDrawingArea
widget and connecting to the expose-event signal. You can then use GdkPixbuf
for loading and drawing the image onto the drawing area. And then draw a
rectangle on top with gdkDrawRectangle().

See demos drawingArea and images.

Michael


>
> Thanks.
>
> --
> HUANG Ronggui, Wincent
> PhD Candidate
> Dept of Public and Social Administration
> City University of Hong Kong
> Home page: http://asrr.r-forge.r-project.org/rghuang.html
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] Building GUI for custom R application

2009-04-15 Thread Michael Lawrence
On Tue, Apr 14, 2009 at 1:23 AM, Harsh  wrote:

> HI R users,
> I would appreciate information/examples/suggestions on building GUIs
> for R applications.
> I am currently working on a project that would require the following
> functionalities :
>
> 1) Display a  window to the user. Provide a function to scan local
> drive and choose dataset file.
> 2) Display the column names for the user to choose the dependent
> variable and the independent variables.
> 3) Fit regression and display statistics.
>
> While researching the possibility of creating a GUI which would allow
> for the above mentioned computations, I came across:
>
> 1) rpanel: Simple Interactive Controls for R Functions Using the tcltk
> Package
> Found In: Journal of Statistical Software, January 2007, Volume 17, Issue
> 9.
>
>
> 2) Putting RGtk to Work, James Robison-Cox
> Found In:Proceedings of the 3rd International Workshop on Distributed
> Statistical Computing (DSC 2003),March 20–22, Vienna, Austria ISSN
> 1609-395X
> http://www.ci.tuwien.ac.at/Conferences/DSC-2003/
>
> Item 2 provides an example of creating a regression application with
> slider controls for a parameter in loess function used in the example
> application in that paper.
> For documentation on RGtk the author recommends reading the Gtk
> tutorial and documentation. I seem to have difficulty in making sense
> of the Gtk documentation since most of it is in C and documentation is
> available for use of Gtk with Perl and Python. I am not a
> C/Perl/Python programmer.
>

RGtk2 is completely documented within the R help system, with all code
examples converted to R code. There are also a couple dozen demos. For a
simple GUI like the one above, try gWidgets. The "pmg" package implements a
gWidgets GUI that includes functionality much like what you describe.


>
> Moreover, I am creating a Windows Application and is using RGtk2 the
> only way to create a GUI for an R application?
> Or should I use the the VB approach and create the GUI separately and
> call R scripts where required to do the back-end computation?
>
> Another approach (to make the visualization more rich and dynamic) is
> to use Adobe FLEX front end and communicate with R using the RSOAP
> library. There is very sparse documentation relevant to using RSOAP. I
> have not been able to find examples or tutorials using RSOAP. Any
> information in this regard will be highly appreciated.
>
> The Biocep project provides 'R for cloud computing' but unfortunately
> I have not been able to extract relevant 'juice' from their webpage.
> What i did get is their R workbench, but that has not answered my
> above mentioned queries.
>
> Regards,
>
> Harsh Singhal
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] Sliding window over irregular intervals

2009-03-30 Thread Michael Lawrence
On Mon, Mar 30, 2009 at 6:01 AM, Irene Gallego Romero wrote:

> Dear all,
>
> I have some very big data files that look something like this:
>
> id chr pos ihh1 ihh2 xpehh
> rs5748748 22 15795572 0.0230222 0.0268394 -0.153413
> rs5748755 22 15806401 0.0186084 0.0268672 -0.367296
> rs2385785 22 15807037 0.0198204 0.0186616 0.0602451
> rs1981707 22 15809384 0.0299685 0.0176768 0.527892
> rs1981708 22 15809434 0.0305465 0.0187227 0.489512
> rs11914222 22 15810040 0.0307183 0.0172399 0.577633
> rs4819923 22 15813210 0.02707 0.0159736 0.527491
> rs5994105 22 15813888 0.025202 0.0141296 0.578651
> rs5748760 22 15814084 0.0242894 0.0146486 0.505691
> rs2385786 22 15816846 0.0173057 0.0107816 0.473199
> rs1990483 22 15817310 0.0176641 0.0130525 0.302555
> rs5994110 22 15821524 0.0178411 0.0129001 0.324267
> rs17733785 22 15822154 0.0201797 0.0182093 0.102746
> rs7287116 22 15823131 0.0201993 0.0179028 0.12069
> rs5748765 22 15825502 0.0193195 0.0176513 0.090302
>
> I'm trying to extract the maximum and minimum xpehh (last column) values
> within a sliding window (non overlapping), of width 1 (calculated
> relative to pos (third column)). However, as you can tell from the brief
> excerpt here, although all possible intervals will probably be covered by at
> least one data point, the number of data points will be variable
> (incidentally, if anyone knows of a way to obtain this number, that would be
> lovely), as will the spacing between them. Furthermore, values of chr
> (second column) will range from 1 to 22, and values of pos will be
> overlapping across them; I want to evaluate the window separately for each
> value of chr.
>

The IRanges package from the Bioconductor project attempts to solve problems
like these. For example, to count the number of overlapping intervals at a
given position in the chromosome, you would use the coverage() function. The
RangedData class is designed to store data like yours and rdapply() makes it
easy to perform operations one chromosome at a time.

That said, I don't think it has any easy way to solve your problem of
calculating quantiles. That's a feature that needs to be added to the
package. I could imagine something like (with the development version),
calling disjointBins() to separate the ranges in bins where there is no
overlap, then converting each bin into an Rle, and then using pmin/max on
the Rle objects in series to get your answer.

Anyway, you probably want to check out IRanges.

Michael


>
> I've looked at the help and FAQ on sliding windows, but I'm a relative
> newcomer to R and cannot find a way to do what I need to do. Everything I've
> managed to unearth so far seems geared towards smoother time series. Any
> help on this problem would be vastly appreciated.
>
> Thanks,
> Irene
>
> --
> Irene Gallego Romero
> Leverhulme Centre for Human Evolutionary Studies
> University of Cambridge
> Fitzwilliam St
> Cambridge
> CB2 1QH
> UK
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] Mature SOAP Interface for R

2009-03-30 Thread Michael Lawrence
On Sat, Mar 28, 2009 at 6:08 PM, zubin  wrote:

> Hello, we are writing rich internet user interfaces and like to call R for
> some of the computational needs on the data, as well as some creation of
> image files.  Our objects communicate via the SOAP interface.  We have been
> researching the various packages to expose R as a SOAP service.
>
> No current CRAN SOAP packages however.
>
> Found 3 to date:
>
> RSOAP (http://sourceforge.net/projects/rsoap/)
> SSOAP http://www.omegahat.org/SSOAP/
>
> looks like a commercial version?
> http://random-technologies-llc.com/products/rsoap
>
> Does anyone have experience with these 3 and can recommend the most
> 'mature' R - SOAP interface package?
>

Well, SSOAP is (the last time I checked) just a SOAP client. rsoap (if we're
talking about the same package) is actually a python SOAP server that
communicates to R via rpy.

You might want to check out the RWebServices package in Bioconductor. I
think it uses Java for its SOAP handling.

Michael


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

[[alternative HTML version deleted]]

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


Re: [R] Chromatogram deconvolution and peak matching

2009-02-18 Thread Michael Lawrence
Just to be sure you're aware, there are packages for chromatograpy and mass
spec data in Bioconductor. Like xcms. Don't think any will directly address
your problem, but they might be useful.

Michael

On Tue, Feb 17, 2009 at 5:44 AM, bartjoosen  wrote:

>
> Hi,
>
> I'm trying to match peaks between chromatographic runs.
> I'm able to match peaks when they are chromatographed with the same method,
> but not when there are different methods are used and spectra comes in to
> play.
>
> While searching I found the ALS package which should be usefull for my
> application, but I couldn't figure it out.
>
> I made some dummy chroms with R, which mimic my actual datasets, to play
> with, but after looking at the manuals of ALS, I'm affraid I can't get the
> job done. Can someone put me on the right way?
>
> Here is my code to generate the dummy chroms, which also plots the 2 chroms
> and the spectra of the 3 peaks:
>
> #2D chromatogram generation
> par(mfrow=c(3,1))
> time <- seq(0,20,by=0.05)
> f <- function(x,rt) dnorm((x-rt),mean=0,sd=rt/35)
> c1 <- f(time,6.1)
> c2 <- f(time,5.6)
> c3 <- f(time,15)
> plot(c1+c2+c3~time,type="l",main="chrom1")
>
> #spectrum generation
> spectra <- function(x,a,b,c,d,e) a + b*(x-e) + c*((x-e)^2) + d*((x-e)^3)
> x <- 220:300
> s1 <- spectra(x,(-194.2),2.386,(-0.009617),(1.275e-05),0)
> s2 <- spectra(x,(-1.054e02),1.3,(-5.239e-03),(6.927e-06),-20)
> s3 <- spectra(x,(-194.2),2.386,(-0.009617),(1.275e-05),20)
>
> chrom1.tot <-
> data.frame(time,outer(c1,s1,"*")+outer(c2,s2,"*")+outer(c2,s2,"*"))
> names(chrom.tot)[-1] <- x
>
> #generation of chromatogram 2
> c1 <- f(time,2.1)
> c2 <- f(time,4)
> c3 <- f(time,8)
> plot(c1+c2+c3~time,type="l",main="chrom2")
>
> chrom2.tot <-
> data.frame(time,outer(c1,s1,"*")+outer(c2,s2,"*")+outer(c2,s2,"*"))
> names(chrom.tot)[-1] <- x
>
> plot(s1~x,type="l",main="spectra")
> lines(s2~x,col=2)
> lines(s3~x,col=3)
>
> Thanks for your time
>
> Kind Regards
>
> Bart
> --
> View this message in context:
> http://www.nabble.com/Chromatogram-deconvolution-and-peak-matching-tp22057592p22057592.html
> Sent from the R help mailing list archive at Nabble.com.
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] ggobi install

2009-02-13 Thread Michael Lawrence
On Thu, Feb 12, 2009 at 3:41 PM, Michael Bibo <
michael_b...@health.qld.gov.au> wrote:

> Mark Ungrin  utoronto.ca> writes:
>
> > > * Installing *source* package 'RGtk2' ...
> > > checking for pkg-config... /usr/bin/pkg-config
> > > checking pkg-config is at least version 0.9.0... yes
> > > checking for LIBGLADE... no
> > > configure: WARNING: libglade not found
> > > checking for INTROSPECTION... no
> > > checking for GTK... no
> > > configure: error: GTK version 2.8.0 required
> > > ERROR: configuration failed for package 'RGtk2'
> > > ** Removing '/home/mark/R/i486-pc-linux-gnu-library/2.6/RGtk2'
> > > * Installing *source* package 'rggobi' ...
> > > checking for pkg-config... /usr/bin/pkg-config
> > > checking pkg-config is at least version 0.9.0... yes
> > > checking for GGOBI... configure: error: Package requirements (ggobi >=
> > > 2.1.6) were not met:
> > >
> > > Package gtk+-2.0 was not found in the pkg-config search path.
> > > Perhaps you should add the directory containing `gtk+-2.0.pc'
> > > to the PKG_CONFIG_PATH environment variable
> > > Package 'gtk+-2.0', required by 'libggobi', not found
> > >
> > > Consider adjusting the PKG_CONFIG_PATH environment variable if you
> > > installed software in a non-standard prefix.
> > >
> > > Alternatively, you may set the environment variables GGOBI_CFLAGS
> > > and GGOBI_LIBS to avoid the need to call pkg-config.
> > > See the pkg-config man page for more details.
>
>
> Mark,
>
> The first thing I would look at is whether there are any "*-dev" packages
> in
> synaptic for the libraries etc that are 'missing'.  These -dev packages
> contain
> the header files and are not necessary for running the application, but are
> necessary for installing other apps from source that interact with them.
> This is a surprisingly little-advertised issue with Linux packaging that I
> found
> out about from the R installation manual.
>

Just to be a bit more specific, for building RGtk2 and rggobi you'll need
gtk-dev(el?) and libxml2-devel which should install all the other devel
dependencies. It's kind of strange that the GGobi package installs its
header files (it is implicitly a devel package), but it does not bring in
the devel packages of its dependencies.

But aren't there binary Ubuntu/Debian packages on the repository for RGtk2
and rggobi?


>
> Michael Bibo
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] example of gladeXML - RGtk2

2008-12-08 Thread Michael Lawrence
A good example of using glade with RGtk2 is the rattle package.

See: http://rattle.togaware.com/

On Mon, Dec 8, 2008 at 8:15 AM, Cleber Nogueira Borges
<[EMAIL PROTECTED]>wrote:

> hello all,
>
>
> where I find a example or tutorial of RGtk2 package?
> I would like to know about the gladeXML functions in R.
>
> thanks in advance
>
> Cleber Borges
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] gWidgets install

2008-10-16 Thread Michael Lawrence
On Tue, Oct 14, 2008 at 7:15 PM, john verzani <[EMAIL PROTECTED]> wrote:

> Tim Smith  yahoo.com> writes:
>
> >
> > Thanks Charlie - I just tried it, but still get the same error:
> >
> > ---
> > > install.packages("gWidgets",dependencies=TRUE)
>
> ...
>
> > > library(gWidgets)
> > Error in fun(...) :
> >
> > *** gWidgets requires a toolkit implementation to be
> >  installed, for instance gWidgetsRGtk2, gWidgetstcltk, or
> gWidgetsrJava***
> >
>
>
>
> Try installing gWidgetstcltk. That will allow you to use gWidgets with the
> tcltk
> package. Although the RGtk2 package works better with gWidgets, the tcltk
> one
> will require no extra software to install under windows.
>

Perhaps the gWidgets package should prompt the user to install one of these?



>
> --John
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] Creating GUIs for R

2008-10-13 Thread Michael Lawrence
On Sun, Oct 12, 2008 at 4:50 PM, Dirk Eddelbuettel <[EMAIL PROTECTED]> wrote:

>
> On 12 October 2008 at 12:53, cls59 wrote:
> | On a related note... does anyone know good resources for binding a C++
> | program to the R library?
>
> RCpp, at http://rcpp.r-forge.r-project.org, formerly known as
> RCppTemplate,
> is pretty mature and testing having been around since 2004 or 2005.
> Introductory documentation could be better, feedback welcome.
>
> | Basically, I would like to start with just a plain vanilla R session
> running
> | inside a Qt widget. Any suggestions?
>

Isn't RKWard a Qt-based GUI for R? They probably have some reusable console
code in there.


>
> Deepayan once did just that in a test application. I am not sure if that
> was
> ever made public.
>
> Cheers, Dirk
>
> --
> Three out of two people have difficulties with fractions.
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] Creating GUIs for R

2008-10-08 Thread Michael Lawrence
On Tue, Oct 7, 2008 at 10:32 AM, Wade Wall <[EMAIL PROTECTED]> wrote:

> Sorry that my post wasn't very clear.
>
> What I am wanting to do is learn to build some simple GUIs for a limited
> number of functions. Basically, I am envisioning a screen with check boxes,
> a drop down menu etc. that users could select to run analyses on imported
> data.
>

My guess is you'll get the best usability if you design a GUI specific for
your task, rather than constraining yourself to the model of 1-1 mapping
between R functions and dialogs. In that case, I highly recommend using
gWidgets as your first shot at a GUI in R.


>
> I have worked with VB before, but it has been several years and I am not
> sure how it interfaces with R.
>
>
> On Tue, Oct 7, 2008 at 1:20 PM, Bert Gunter <[EMAIL PROTECTED]>
> wrote:
>
> > Seek and ye shall find ... Check the RGUI's link on the "other" web page
> on
> > CRAN.
> >
> > If you are on Windows, there is some simple built-in GUI functionality.
> > ?winMenuAdd, ?select.list and the links therein will get you started
> there.
> >
> > Cheers,
> > Bert Gunter
> >
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > On
> > Behalf Of Wade Wall
> > Sent: Tuesday, October 07, 2008 9:56 AM
> > To: [EMAIL PROTECTED]
> > Subject: [R] Creating GUIs for R
> >
> > Hi all,
> >
> > I have looked around for help on creating GUIs for R, but haven't found
> > anything.  I would be interested in any advice or webpages that have
> > information on the best language, tutorials etc. for creating simple
> GUIs.
> > Mainly I want to do this as a heuristic exercise.
> >
> > Thanks for any help.
> >
> > Wade Wall
> >
> > [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org 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.
> >
> >
>
>[[alternative HTML version deleted]]
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] crashes while using Rattle (GTK+)

2008-10-03 Thread Michael Lawrence
Just saw this one. This should be fixed in RGtk2 2.12.7 on CRAN.

Thanks,
Michael

On Tue, Sep 30, 2008 at 12:03 AM, Tomislav Puða <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I'm using R 2.7.2 for Windows.I have also installed gtk-dev-2.12.9 and
> rattle 2.3.65. When I work in rattle, I occasionally get these messages :
>
> GLib-WARNING (recurser) **: g_main_context_prepare() called recursively
> from
> within a source's check() or prepare() member. aborting
>
> or
>
> GLib-WARNING (recurser) **: g_main_context_prepare() called recursively
> from
> within a source's check() or prepare() member. aborting
> (Rgui.exe : 3580): GLib-WARNING **: g_main_context_prepare() called
> recursively from within a source's check() or prepare() member.
>
> and then R crashes. I tried to reinstall R, reinstall all packages (i have
> all dependent packages installed), I was looking on GTK+ pages and Google
> but I only found similar post without an answer.
>
> I think that problem lies in GTK. But I don't have any idea how to get the
> things working.
>
> Please help !
>
>[[alternative HTML version deleted]]
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] programming

2008-09-02 Thread Michael Lawrence
Am I missing something or does that list not include Emacs/ESS? It's also
missing TextMate (for the Mac people). There's probably a bunch more stuff
for Eclipse than it mentions.

Michael

On Mon, Sep 1, 2008 at 6:17 PM, Gabor Grothendieck
<[EMAIL PROTECTED]>wrote:

> Check out:
> http://www.sciviews.org/_rgui/projects/Editors.html
>
> On Mon, Sep 1, 2008 at 8:52 PM, Yuan Jian <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I am looking for R editor. does anyone know good editor? which tells you
> > syntax error and it has function to beautify format (insert TAB etc.).
> >
> > Yu
> >
> >
> >
> >
> >[[alternative HTML version deleted]]
> >
> >
> > __
> > R-help@r-project.org 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.
> >
> >
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] Opening a web browser from R?

2008-08-15 Thread Michael Lawrence
browseURL()

On Fri, Aug 15, 2008 at 3:55 AM, <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> I was wondering if there's a way in R to open a web browser (such as
> Internet Explorer, or Firefox or whatever).
> I'm doing some analyses that have associated urls, and it would be nice to
> have the ability to directly open the relevant page from within R.
> I was looking at the help for 'url' and I can see I can probably access the
> information I need and display it in my own way, but can I somehow just open
> the given url with my web browser of choice?
>
> many thanks for any help,
>
> Jose
>
>
> --
> Dr. Jose I. de las Heras  Email: [EMAIL PROTECTED]
> The Wellcome Trust Centre for Cell BiologyPhone: +44 (0)131 6513374
> Institute for Cell & Molecular BiologyFax:   +44 (0)131 6507360
> Swann Building, Mayfield Road
> University of Edinburgh
> Edinburgh EH9 3JR
> UK
>
> --
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] Link to newest R GUI

2008-08-11 Thread Michael Lawrence
On Mon, Aug 11, 2008 at 9:27 AM, <[EMAIL PROTECTED]> wrote:

> I have used Rattle ( R Analytical tool to learn easily )and R
> Commander and found them to be quite good. I don't use the command
> line interface because I find it too time consuming from other
> languages like SAS,SPSS. I am not sure on Vista compatibility though.
>

Rattle should have no problems on Vista, especially with the latest GTK+
binaries from gladewin32.sf.net.

A general comment though: learning the command line of R is probably worth
the time investment, unless you have a very specific task in mind and there
is an existing GUI that supports that task.


>
> The Rattle log file auto generates the code, so it can be of some
> initial help. For advanced stuff, it is best to learn command line.
> Also heres a link to SPSS to R guide  at
> http://RforSASandSPSSusers.com
>
> Regards,
>
> Ajay
> www.decisionstats.com
>
> On 8/11/08, stephen sefick <[EMAIL PROTECTED]> wrote:
> > you've a couple of options- maybe they will fit your needs maybe they
> > won't.  Look at the GUI page on CRAN
> > http://www.sciviews.org/_rgui/
> > you could google this and find out on your own what may or may not
> > suit your needs.  Most everybody on this list uses the command line
> > interface
> >
> > stephen sefick
> >
> > On Mon, Aug 11, 2008 at 11:47 AM, Charles R. Partridge
> > <[EMAIL PROTECTED]> wrote:
> >> Greetings,
> >>
> >>
> >>
> >> Please forward Web links for the most recent R GUI and a list of add-ons
> >> that will run in the graphic interface.  I need either the R GUI for
> (MS)
> >> Windows Vista, or a Web-based GUI that will run longitudinal models with
> >> covariates (e.g., multilevel modeling, latent growth curves, and ARIMA
> >> interrupted time-series).
> >>
> >>
> >>
> >> I believe that R's functions will meet nearly every program evaluator's
> >> needs. However, most consultants in my geographic region have no
> >> programming
> >> background, and instead have used (and have been trained to use)
> >> statistical
> >> programs with GUIs such as SPSS.
> >>
> >>
> >>
> >> Thanks in advance.
> >>
> >>
> >>
> >> Regards,
> >>
> >>
> >>
> >> Charles R. Partridge, Ph.D.
> >>
> >> C.H.I.P. Evaluation Consulting
> >>
> >> Columbus, Ohio
> >>
> >> USA
> >>
> >> [EMAIL PROTECTED]
> >>
> >>
> >>
> >>
> >>[[alternative HTML version deleted]]
> >>
> >> __
> >> R-help@r-project.org 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.
> >>
> >
> >
> >
> > --
> > Let's not spend our time and resources thinking about things that are
> > so little or so large that all they really do for us is puff us up and
> > make us feel like gods. We are mammals, and have not exhausted the
> > annoying little problems of being mammals.
> >
> >   -K. Mullis
> >
> > __
> > R-help@r-project.org 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.
> >
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] error with .dll file and RGtk2

2008-07-24 Thread Michael Lawrence
On Thu, Jul 24, 2008 at 7:39 AM, paulandpen <[EMAIL PROTECTED]>
wrote:

> Hi all,
>
> I am getting the following error message.
>
> Does somebody know what needs to happen here?
>
> I have tried re-installing the RGtk2 package and also downloading a .dll
> file and installing it in the RGtk2 file folder
>
> Error in dyn.load(x, as.logical(local), as.logical(now)) :
>   unable to load shared library
> 'C:/PROGRA~1/R/R-25~1.1/library/RGtk2/libs/RGtk2.dll':
>  LoadLibrary failure:  The specified module could not be found.
>

RGtk2 *should* prompt you to install GTK+ if the loading fails. Did it popup
a menu asking you to install GTK+? Did you click yes? Did you allow it to
set your PATH environment variable? And did you restart R afterwords? (the
next version of RGtk2 should make the last instruction more obvious)

If yes to all those questions, then please check if GTK+ is really in your
PATH.

Michael


> Thanks in advance
>
> Paul
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] playwith package crashes on Mac

2008-07-15 Thread Michael Lawrence
For some reason, cairoDevice has been crashing the Mac for a while. It has
something to do with the rotation of text through Pango. That's all I've
been able to determine. Kind of tough without access to a Mac... but it DID
work once upon a time..

2008/7/15 Felix Andrews <[EMAIL PROTECTED]>:

> Dear Professor Kubovy
>
> I do not have a Mac to test it on, but please try this:
> library(cairoDevice)
> Cairo()
> grid::grid.newpage()
>
> I expect that you will see a similar crash; if so, it would seem to be
> a problem with your GTK+ libraries. I have heard that you need to have
> Apple X11 installed (from MacOS system CDs?) for RGtk2 to work. But I
> am not sure whether that advice is still current.
>
> Hope that helps.
> Felix
>
> On Tue, Jul 15, 2008 at 10:40 PM, Michael Kubovy <[EMAIL PROTECTED]>
> wrote:
> > Dear R-helpers,
> >
> > I tried the playwith packages for the first time, and it crashed R:
> >
> >  > require(playwith)
> > Loading required package: playwith
> > Loading required package: lattice
> > Loading required package: grid
> > Loading required package: gWidgets
> > Loading required package: gWidgetsRGtk2
> > Loading required package: RGtk2
> > Loading required package: cairoDevice
> >
> >  > sessionInfo()
> > R version 2.7.1 (2008-06-23)
> > i386-apple-darwin8.10.1
> >
> > locale:
> > en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
> >
> > attached base packages:
> > [1] grid  stats graphics  grDevices utils datasets
> > methods   base
> >
> > other attached packages:
> > [1] playwith_0.9-3   cairoDevice_2.8  gWidgetsRGtk2_0.0-35
> > RGtk2_2.12.5-3   gWidgets_0.0-28
> > [6] lattice_0.17-10
> >
> > loaded via a namespace (and not attached):
> > [1] gridBase_0.4-3 tools_2.7.1
> >
> > Making links in per-session dir ... done
> >
> >  > rownames(USArrests) <- state.name
> >  > playwith(plot(Assault ~ UrbanPop, data=USArrests,
> > +   xlab="Percent urban population, 1973",
> > +   ylab="Assault arrests (per 100,000), 1973"))
> >
> >  *** caught bus error ***
> > address 0xa8, cause 'non-existent physical address'
> >
> > Traceback:
> >  1: .Call(L_newpage)
> >  2: grid.newpage()
> >  3: playNewPlot(playState)
> >  4: playwith(plot(Assault ~ UrbanPop, data = USArrests, xlab =
> > "Percent urban population, 1973", ylab = "Assault arrests (per
> > 100,000), 1973"))
> >
> > Possible actions:
> > 1: abort (with core dump, if enabled)
> > 2: normal R exit
> > 3: exit R without saving workspace
> > 4: exit R saving workspace
> > Selection:
> > Selection: 3
> >
> >  *** caught segfault ***
> > address 0x611912ca, cause 'memory not mapped'
> >
> > Traceback:
> >  1: .Call(L_newpage)
> >  2: grid.newpage()
> >  3: playNewPlot(playState)
> >  4: playwith(plot(Assault ~ UrbanPop, data = USArrests, xlab =
> > "Percent urban population, 1973", ylab = "Assault arrests (per
> > 100,000), 1973"))
> >
> > Possible actions:
> > 1: abort (with core dump, if enabled)
> > 2: normal R exit
> > 3: exit R without saving workspace
> > 4: exit R saving workspace
> > Selection: 2
> >
> > Mac OS details:
> >   System Version:  Mac OS X 10.5.4 (9E17)
> >   Kernel Version:  Darwin 9.4.0
> >
> >
> >
> > _
> > Professor Michael Kubovy
> > University of Virginia
> > Department of Psychology
> > USPS: P.O.Box 400400Charlottesville, VA 22904-4400
> > Parcels:Room 102Gilmer Hall
> > McCormick RoadCharlottesville, VA 22903
> > Office:B011+1-434-982-4729
> > Lab:B019+1-434-982-4751
> > Fax:+1-434-982-4766
> > WWW:
> > http://www.people.virginia.edu/~mk9y/
> >
> >
> >
> >
> >
> >[[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org 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.
> >
>
>
>
> --
> Felix Andrews / $B0BJ!N)(B
> PhD candidate
> Integrated Catchment Assessment and Management Centre
> The Fenner School of Environment and Society
> The Australian National University (Building 48A), ACT 0200
> Beijing Bag, Locked Bag 40, Kingston ACT 2604
> http://www.neurofractal.org/felix/
> 3358 543D AAC6 22C2 D336 80D9 360B 72DD 3E4C F5D8
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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

Re: [R] Alternative of Cairo

2008-06-27 Thread Michael Lawrence
On Fri, Jun 27, 2008 at 12:05 AM, [EMAIL PROTECTED] <
[EMAIL PROTECTED]> wrote:

> Hi All,
>
> I am a new member to R programming.
>
> Am generating some visuals by using Cairo library. But Cairo is not
> compatible with all compilers


May I ask which compiler you are using? There are other vector graphics
libraries, but they're mostly C++ rather than C...


> (Box plot,histogram and RNA degradation
> plots-I would prefer to use some libraries rather than R native
> functions).Can anyone suggest an alternative for this library.
>
>
> Thanks in Advance
> Gireesh
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] Differential Equations

2008-06-17 Thread Michael Lawrence
On Tue, Jun 17, 2008 at 6:25 PM, David Arnold <[EMAIL PROTECTED]>
wrote:

> All,
>
> I've found odesolve and lsoda.
>
> Any other packages for differential equations?
>

There's Rsundials, which gives you an algebraic ode solver.


>
> Any good tutorials on using R and solving differential and partial
> differential equations?
>
> D.
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] longest common substring

2008-06-17 Thread Michael Lawrence
See: http://www.omegahat.org/Rlibstree/

Binds R to libstree for suffix tree operations.

Libstree is included with the package, so don't worry about building it
separately.

Michael

On Tue, Jun 17, 2008 at 10:28 PM, Daren Tan <[EMAIL PROTECTED]> wrote:

>
> i need to compute the longest common substring of two strings, can R do
> that ?
> _
>
>
>[[alternative HTML version deleted]]
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] Unexpected behaviour in reading genomic coordinate files of R-2.7.0

2008-05-29 Thread Michael Lawrence
This is not really addressing your problem, but I thought you might want to
know that the rtracklayer package in Bioconductor already supports parsing
BED files, as well as GFF and WIG. It's main purpose is to load the tracks
into genome browsers, like UCSC.

Michael

On Wed, May 28, 2008 at 1:11 AM, Margherita <[EMAIL PROTECTED]>
wrote:

> Great R people,
>
> I have noticed a strange behaviour in read.delim() and friends in the R
> 2.7.0 version. I will describe you the problem and also the solution I
> already found, just to be sure it is an expected behaviour and also to tell
> people, who may experience the same difficulty, a way to overcome it.
> And also to see if it is a proper behaviour or maybe a correction is
> needed.
>
> Here is the problem:
> I have some genomic coordinates files (bed files, a standard format, for
> example) containing a column (Strand) in which there is either a "+" or a
> "-".
> In R-2.6.2patched (and every past version I have used) I never had problems
> in reading them in, as for example:
> > a <- read.table("coords.bed", skip=1)
> > disp(a)
> class  data.frame
> dimensions are  38650 6
> first rows:
>   V1V2V3V4 V5 V6
> 1 chr1 100088396 100088446  seq1  0  +
> 2 chr1 100088764 100088814  seq2  0  -
>
> If I do exactly the same command on the same file in R-2.7.0 the result I
> obtain is:
> > a <- read.table("coords.bed", skip=1)
> > disp(a)
> class  data.frame
> dimensions are  38650 6
> first rows:
>   V1V2V3V4 V5 V6
> 1 chr1 100088396 100088446  seq1  0  0
> 2 chr1 100088764 100088814  seq2  0  0
>
> and I completely loose the strand information, they are all zeros! I have
> also tried to put quotes around "+" and "-" in the file before reading it,
> to set in read.table() call stringsAsFactors=FALSE, to set "encoding" to a
> few different alternatives, but the result was always the same: they are all
> transformed in 0.
>
> Then I tried scan() and I saw it was reading the character "+" properly:
> > scan("coords.bed",  skip=1, nlines=1, what="ch")
> Read 6 items
> [1] "chr1" "100088396""100088446.00" "seq1" "0"  [6]
> "+"
> ...my conclusion is that the lone "+" or "-" are not taken as "characters"
> in the data frame creation step, they are taken as "numeric" but, being
> without numbers are all converted to 0.
> Is it correct if this behaviour happens also if they are surrounded by
> quotes?
>
> Anyway, my temporary solution (which works without the need of changing the
> files) is:
> a <- read.table("coords.bed", skip=1, colClasses=c("character", "numeric",
> "numeric", "character", "numeric", "character"))
> > a[1:2,]
>   V1V2V3V4 V5 V6
> 1 chr1 100088396 100088446 seq1  0  +
> 2 chr1 100088764 100088814 seq2  0  -
>
> Another way to avoid loosing strand information was to manually substitute
> an "R" to "-" and an "F" to "+" in the file before reading it in R. But it
> is much more cumbersome since the use of + and - is, for example, a standard
> format in bed files accepted and generated by the Genome Browser and other
> genome sites.
>
> Please let me know what do you think. Ps. I saw this first in the Fedora
> version (rpm automatically updated), but it is reproduced also in the
> Windows version.
>
> Thank you all people for your work and for making R the wonderful tool it
> is!
>
> Cheers,
>
> Margherita
>
> --
> --
>
> ---
> Margherita Mutarelli, PhD Seconda Universita' di Napoli
> Dipartimento di Patologia Generale
> via L. De Crecchio, 7
> 80138 Napoli - Italy
> Tel/Fax. +39.081.5665802
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] IDE

2008-05-25 Thread Michael Lawrence
emacs + ess

On Fri, May 23, 2008 at 8:54 AM, Alexandra Almeida <[EMAIL PROTECTED]>
wrote:

> People,
>
> I'm a ubunto user and I used to write my scipts in "Java Gui for R", but it
> is a very slow tool to run my scripts...
> Do you know some efficient IDE for R?
> Thank!!!
>
> Alexandra Almeida
>
>
> --
> Alexandra R M de Almeida
>
>[[alternative HTML version deleted]]
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] Alternatives to rJava and JRI

2008-05-22 Thread Michael Lawrence
There's SJava, http://www.omegahat.org/RSJava.

On Thu, May 22, 2008 at 12:50 PM, Munir, Danish <[EMAIL PROTECTED]>
wrote:

>
> Has anyone come across any alternatives to rJava and JRI? Are they any
> good? Better perhaps?
>
> Please give your reasons.
>
> Thanks,
> Danish
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> - - - - - -
>
> This message is intended only for the personal and confidential use of the
> designated recipient(s) named above.  If you are not the intended recipient
> of this message you are hereby notified that any review, dissemination,
> distribution or copying of this message is strictly prohibited.  This
> communication is for information purposes only and should not be regarded as
> an offer to sell or as a solicitation of an offer to buy any financial
> product, an official confirmation of any transaction, or as an official
> statement of Lehman Brothers.  Email transmission cannot be guaranteed to be
> secure or error-free.  Therefore, we do not represent that this information
> is complete or accurate and it should not be relied upon as such.  All
> information is subject to change without notice.
>
> 
> IRS Circular 230 Disclosure:
> Please be advised that any discussion of U.S. tax matters contained within
> this communication (including any attachments) is not intended or written to
> be used and cannot be used for the purpose of (i) avoiding U.S. tax related
> penalties or (ii) promoting, marketing or recommending to another party any
> transaction or matter addressed herein.
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] rggobi is crashing R-2.7.0

2008-05-07 Thread Michael Lawrence
On Wed, May 7, 2008 at 11:40 AM, Mark Kimpel <[EMAIL PROTECTED]> wrote:

> Uninstalling and reinstalling ggobi via Synaptic solved the problem, at
> least for the demo data mtcars. Rotation works fine. No crashes on exit.
>
> Thanks for the good advice.
>

I am pretty sure what Paul is referring to is the graphics device stuff.
GGobi does not link against R anyway, so R would not be the problem here.

The reason rebuilding GGobi fixed it, is that your GGobi binary was linked
against an old version of graphviz. The new version broke binary
compatibility, thus you needed to install a GGobi binary built against the
new version.


> Mark
>
> On Wed, May 7, 2008 at 2:12 PM, Paul Johnson <[EMAIL PROTECTED]> wrote:
>
> > On Tue, May 6, 2008 at 12:32 PM, Mark Kimpel <[EMAIL PROTECTED]> wrote:
> > > I am running 64-bit Ubuntu 8.04 and when I invoke rggobi the
> interactive
> > >  graph displays but R crashes. See my sessionInfo() and a short
> example
> > >  below. Ggobi and rggobi installed without complaints. Mark
> > >
> > >  > sessionInfo()
> > >  R version 2.7.0 Patched (2008-05-04 r45620)
> > >  x86_64-unknown-linux-gnu
> > >
> >
> > In the R 2.7 release notes, there is a comment about a change in the
> > GUI libraries and it says that one must recompile everything that
> > relies on R.  If your R 2.7 was an upgrade, not a fresh install, it
> > could explain why this is happening.  If there's some old library or R
> > package sitting around, it could account for this.
> >
> > The part that concerned me about the R release note is that they don't
> > give a very clear guide on how far back in the toolchain we are
> > supposed to go.  Certainly, ggobi has to be rebuilt from scratch.  But
> > are any of the things on which ggobi depends needing recompliation as
> > well.
> >
> > pj
> >
> >
> > --
> > Paul E. Johnson
> > Professor, Political Science
> > 1541 Lilac Lane, Room 504
> > University of Kansas
> >
>
>
>
> --
> Mark W. Kimpel MD ** Neuroinformatics ** Dept. of Psychiatry
> Indiana University School of Medicine
>
> 15032 Hunter Court, Westfield, IN 46074
>
> (317) 490-5129 Work, & Mobile & VoiceMail
> (317) 663-0513 Home (no voice mail please)
>
> **
>
>[[alternative HTML version deleted]]
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] rggobi is crashing R-2.7.0

2008-05-07 Thread Michael Lawrence
On Tue, May 6, 2008 at 11:11 PM, Mark Kimpel <[EMAIL PROTECTED]> wrote:

> Hard as it is for me to imagine, the ggobi windows stay open and
> functional while R (in emacs) has crashed in the background after throwing
> the error messages. As a perhaps naive Linux user, I thought that if a
> parent process crashed any processes it spawned would crash too. I guess not
> in this case.
>

Well running it within Emacs may explain it. We actually aren't spawning a
new GGobi process - just dynamically linking the GGobi library and starting
it that way.



> Ubuntu currently is distributing graphviz 2.16.1
>

Do you have libgvc.so.3 on your system?

Michael


> Thanks,
> Mark
>
>
> On Wed, May 7, 2008 at 12:14 AM, Michael Lawrence <[EMAIL PROTECTED]>
> wrote:
>
> >
> >
> > On Tue, May 6, 2008 at 6:06 PM, Mark Kimpel <[EMAIL PROTECTED]> wrote:
> >
> > > R crashed just after the warnings were issued, but ggobi kept running
> > > (if that makes sense).
> >
> >
> > I am not sure if that makes sense; GGobi should exit when the R process
> > does.
> >
> >  I have Graphviz and Rgraphiz installed and use Rgraphviz regularly
> > > without a problem, so I'm not sure why it didn't load. Mark
> > >
> >
> > Which version of graphviz? I am not sure which version the Ubuntu binary
> > expects, but this may be a binary compatibility issue.
> >
> > That said, I am not sure if the GraphLayout plugin is the reason for R
> > crashing...
> >
> >
> > >
> > >
> > > On Tue, May 6, 2008 at 4:37 PM, Michael Lawrence <[EMAIL PROTECTED]>
> > > wrote:
> > >
> > > >
> > > >
> > > > On Tue, May 6, 2008 at 10:32 AM, Mark Kimpel <[EMAIL PROTECTED]>
> > > > wrote:
> > > >
> > > > > I am running 64-bit Ubuntu 8.04 and when I invoke rggobi the
> > > > > interactive
> > > > > graph displays but R crashes. See my sessionInfo() and a short
> > > > > example
> > > > > below. Ggobi and rggobi installed without complaints. Mark
> > > > >
> > > > > > sessionInfo()
> > > > > R version 2.7.0 Patched (2008-05-04 r45620)
> > > > > x86_64-unknown-linux-gnu
> > > > >
> > > > > locale:
> > > > >
> > > > > LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C
> > > > >
> > > > > attached base packages:
> > > > > [1] stats graphics  grDevices utils datasets  methods
> > > > > base
> > > > >
> > > > > other attached packages:
> > > > > [1] rggobi_2.1.9   RGtk2_2.12.5-3 graph_1.18.0
> > > > >
> > > > > loaded via a namespace (and not attached):
> > > > > [1] cluster_1.11.10 tools_2.7.0
> > > > >
> > > > >
> > > > > > a <- matrix(rnorm(1000), nrow = 10)
> > > > >
> > > > > > g <- ggobi(a)
> > > > >
> > > > > ** (R:25146): CRITICAL **: Error on loading plugin library
> > > > > plugins/GraphLayout/plugin.la: libgvc.so.3: cannot open shared
> > > > > object file:
> > > > > No such file or directory
> > > > >
> > > > > ** (R:25146): CRITICAL **: Error on loading plugin library
> > > > > plugins/GraphLayout/plugin.la: libgvc.so.3: cannot open shared
> > > > > object file:
> > > > > No such file or directory
> > > > >
> > > > > ** (R:25146): CRITICAL **: can't locate required plugin routine
> > > > > addToToolsMenu in GraphLayout
> > > > > >
> > > > >
> > > >
> > > > It's not clear to me - did R crash or did you just receive these
> > > > warnings? These warnings are due to a missing graphviz, so the 
> > > > GraphLayout
> > > > plugin fails to load.
> > > >
> > > >
> > > > >
> > > > > --
> > > > > Mark W. Kimpel MD ** Neuroinformatics ** Dept. of Psychiatry
> > > > > Indiana University School of Medicine
> > > > >
> > > > > 15032 Hunter Court, Westfield, IN 46074
> > > > >
> > > > > (317) 490-5129 Work, 

Re: [R] rggobi is crashing R-2.7.0

2008-05-06 Thread Michael Lawrence
On Tue, May 6, 2008 at 10:32 AM, Mark Kimpel <[EMAIL PROTECTED]> wrote:

> I am running 64-bit Ubuntu 8.04 and when I invoke rggobi the interactive
> graph displays but R crashes. See my sessionInfo() and a short example
> below. Ggobi and rggobi installed without complaints. Mark
>
> > sessionInfo()
> R version 2.7.0 Patched (2008-05-04 r45620)
> x86_64-unknown-linux-gnu
>
> locale:
>
> LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats graphics  grDevices utils datasets  methods   base
>
> other attached packages:
> [1] rggobi_2.1.9   RGtk2_2.12.5-3 graph_1.18.0
>
> loaded via a namespace (and not attached):
> [1] cluster_1.11.10 tools_2.7.0
>
>
> > a <- matrix(rnorm(1000), nrow = 10)
>
> > g <- ggobi(a)
>
> ** (R:25146): CRITICAL **: Error on loading plugin library
> plugins/GraphLayout/plugin.la: libgvc.so.3: cannot open shared object
> file:
> No such file or directory
>
> ** (R:25146): CRITICAL **: Error on loading plugin library
> plugins/GraphLayout/plugin.la: libgvc.so.3: cannot open shared object
> file:
> No such file or directory
>
> ** (R:25146): CRITICAL **: can't locate required plugin routine
> addToToolsMenu in GraphLayout
> >
>

It's not clear to me - did R crash or did you just receive these warnings?
These warnings are due to a missing graphviz, so the GraphLayout plugin
fails to load.


>
> --
> Mark W. Kimpel MD ** Neuroinformatics ** Dept. of Psychiatry
> Indiana University School of Medicine
>
> 15032 Hunter Court, Westfield, IN 46074
>
> (317) 490-5129 Work, & Mobile & VoiceMail
> (317) 663-0513 Home (no voice mail please)
>
> **
>
>[[alternative HTML version deleted]]
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] Annoying bug in package cairoDevice

2008-04-29 Thread Michael Lawrence
Sorry about this. cairoDevice 2.8 (just uploaded to CRAN) should fix this
problem.

On Tue, Apr 29, 2008 at 1:08 PM, Josh Gilbert <[EMAIL PROTECTED]> wrote:

> I sent this to R-Help and the listed maintainer of cairoDevice, I hope
> that was the right thing to do.
>
> For some reason, Cairo_png puts a box around a figure when you call
> plot.new. It looks like box was called with black and a transparent
> background. Example:
> > library(cairoDevice)
> > Cairo_png('cairo.png')
> > plot.new()
> > dev.off()
> null device
>   1
>
> The boarder is narrow, so it's hard to see with a stand-alone image
> viewer. If you paste the png onto a white background it's quite clear.
>
> Admittedly, the default for par("bg") is transparent, par("bty") is "o"
> and par("col") is black. However, this behavior is not consistent with other
> devices (such as png in grDevices even if I set par(bg="white")). Also,
> Cairo_png draws the box even when par(bty="n").
>
> I just tested this on Debian with version 2.6 of cairoDevice. I've also
> observed this behavior on Windows and it's not a new problem.
>
> The only workaround I've found is to call
> > Cairo_png()
> > par(col="white")
> > setHook("plot.new", function() par(col="black"))
> > plot(...)
>
> As far as I'm concerned, this is a serious bug, it's a real problem when
> creating figures for publication. I'd like confirmation that this is, in
> fact, a bug as I haven't seen much documentation for standards for devices.
> I suspect that it's a shallow bug, but I've never seen the code for plot.new
> nor do_Cairo so my suspicion may be more hope than insight.
>
>
> Josh Gilbert
>
> Statistical Researcher
> Broad Institute
> Chemical Biology Program
>

[[alternative HTML version deleted]]

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


Re: [R] R GUI question

2008-03-20 Thread Michael Lawrence
On Wed, Mar 19, 2008 at 12:56 PM, jeffreya <[EMAIL PROTECTED]> wrote:
>
>  Hi.
>
>  I'm looking to create a user-friendly program built around some R methods
>  I've written. The program should be as easy to install and use as possible
>  and will be built around a GUI. This program will be cross-platform; that's
>  crucial.
>
>  I'm familiar with Java and its GUI packages, I've been looking at the JRI
>  package (interfaces R with Java) but I'm a little uneasy about asking my
>  users to go through its installation (necessitates mingw, among other
>  things, in Windows). Though, once installed, it could work very well.
>

rJava/JRI does not require mingw. It's just a matter of installing
Java (which many users have already) and the rJava package.

>  I have a little exposure to Tcl/TK. Though I'm not as big of a fan of this
>  as I am of Java, I could suck it up and use it, but I'm not sure that its
>  installation is a whole lot simpler?
>
>  What, in your experience, is the easiest way to accomplish something like
>  this?
>
>  To recapitulate, my criteria are:
>  1.) Easy installation
>  2.) Ease of use (GUI)
>  3.) Interface with functions written in R
>  4.) Cross-platform
>

I would suggest using the gWidgets package, an abstraction over RGtk2
(best supported by gWidgets but requires user to install the
cross-platform GTK+ library), tcltk and rJava/Swing. All the backends
are cross-platform and support callbacks into R. The user may choose
which backend to use. So if they want a slicker GUI they could install
GTK+ and RGtk2 or they could just use the built-in support for tcl/tk.

>  I'm willing to learn a new language (scripting or otherwise) if necessary.
>

gWidgets would only require you to know R.

>  Thanks so much.
>  --
>  View this message in context: 
> http://www.nabble.com/R-GUI-question-tp16149624p16149624.html
>  Sent from the R help mailing list archive at Nabble.com.
>
>  __
>  R-help@r-project.org 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.
>

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


Re: [R] GUI developement / Matlab

2008-02-29 Thread Michael Lawrence
On Fri, Feb 29, 2008 at 6:45 AM, Antje <[EMAIL PROTECTED]> wrote:

> Hi there,
>
> I was wondering whether there are flexible packages available with which
> you
> can create user interfaces? (I've read about "gWidgets"!?)


gWidgets provides an easy to use API for developing GUIs in R. It's an
abstraction over several actual toolkit bindings (tcl/tk, RGtk2, and
rJava/Swing). The best supported implementation is based on RGtk2. Depending
on the level of control and features you require, you might have to resort
to direct use of RGtk2, which is a complete low-level binding to the GTK+
toolkit.

>
> For example in Matlab you can even create stand alone applications. Is it
> also
> possible for R in the same extend? Of course it should be platform
> independent
> if possible...
>

tcl/tk, GTK+, and Swing are all cross-platform toolkits used for developing
stand-alone applications. Developing your GUI in gWidgets will allow the
user to choose among those three. But for a true stand-alone application
(without running R directly) you'll probably want to develop the application
and its GUI in another language and then delegate to the R library for
certain tasks.


>
> And then I would like to know from people who know R as well as Matlab.
> What
> would you see as advantages and disadvantages comparing both systems (from
> your
> personal needs). I've learned a little bit of R and I like the concept but
> I
> don't know much about Matlab. (I hope this question is not too off topic?)
>
> Thank you!
> Antje
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] RGTK2 and glade on Windows - GUI newbie

2008-02-15 Thread Michael Lawrence
That would be a good idea. I'm finishing up a much more comprehensive guide
that will become available soon.

Thanks for the suggestion,
Michael

2008/2/14 Felix Andrews <[EMAIL PROTECTED]>:

> I just discovered a good introduction to the RGtk2 package:
> RShowDoc("overview2", package="RGtk2")
>
> I have been using RGtk2 for over a year without knowing about that,
> and struggling with the API documentation, so can I suggest that it be
> mentioned somewhere prominent? i.e. put it on the project web-page,
> and make it a vignette so that it appears on the CRAN package page.
>
> Cheers,
> Felix
>
>
> 2008/2/11 Felix Andrews <[EMAIL PROTECTED]>:
> > Yes, a GUI based on GTK+ (with or without Glade) will work on Windows
> XP.
> >
> >  If what you want to do is relatively straightforward (say, without any
> >  fancy formatting, or advanced event handling) then you should consider
> >  gWidgets. Look at the vignette in the gWidgets package.
> >
> >  If you do decide to go with RGtk2 directly rather than gWidgets, look
> >  at demo(package="RGtk2"). If you are using Glade, you might want to
> >  look at the source code for Rattle, which is a GUI built with Glade:
> >  see http://rattle.googlecode.com/
> >  and http://datamining.togaware.com/survivor/Installation_Details.html
> >  (Another example is hydrosanity: http://hydrosanity.googlecode.com/)
> >
> >  By the way, there is a special mailing list for GUI issues:
> >  https://stat.ethz.ch/mailman/listinfo/r-sig-gui
> >
> >  Felix
> >
> >
> >
> >  On Mon, Feb 11, 2008 at 9:52 PM, Anja Kraft
> >  <[EMAIL PROTECTED]> wrote:
> >  > Hallo,
> >  >
> >  >  I'd like to write a GUI (first choice with GTK+).
> >  >  I've surfed through the R- an Omegahat-Pages, because I'd like to
> use
> >  >  RGTK2, GTK 2.10.11 in combination with glade on Windows XP (perhaps
> later
> >  >  Unix, Mac).
> >  >  I've found a lot of different information. Because of the
> information I'm
> >  >  not sure, if this combination is running on Windows XP and I'm
> unsure how
> >  >  it works.
> >  >
> >  >  Is there anyone, who has experience with this combination (if it
> works)
> >  >  and could tell me, where I could find something like a tutorial, how
> this
> >  >  combination is used together and how it works?
> >  >
> >  >  Thank you very much,
> >  >
> >  >  Anja Kraft
> >  >
> >  >  __
> >  >  R-help@r-project.org 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.
> >  >
> >
> >
> >
> >  --
> >  Felix Andrews / $B0BJ!N)(B
> >  PhD candidate
> >  Integrated Catchment Assessment and Management Centre
> >  The Fenner School of Environment and Society
> >  The Australian National University (Building 48A), ACT 0200
> >  Beijing Bag, Locked Bag 40, Kingston ACT 2604
> >  http://www.neurofractal.org/felix/
> >  3358 543D AAC6 22C2 D336  80D9 360B 72DD 3E4C F5D8
> >
>
>
>
> --
> Felix Andrews / $B0BJ!N)(B
> PhD candidate
> Integrated Catchment Assessment and Management Centre
> The Fenner School of Environment and Society
> The Australian National University (Building 48A), ACT 0200
> Beijing Bag, Locked Bag 40, Kingston ACT 2604
> http://www.neurofractal.org/felix/
> 3358 543D AAC6 22C2 D336 80D9 360B 72DD 3E4C F5D8
>

[[alternative HTML version deleted]]

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


Re: [R] gWidgets process management

2008-02-12 Thread Michael Lawrence
On Feb 12, 2008 1:51 PM, Peter McMahan <[EMAIL PROTECTED]> wrote:

> Thanks, that's very helpful. Unfortunately Gtk2 is difficult to get
> running on a Mac, so I've been trying the gWidgetstcktk interface.
> It sounds like the behavior you're describing is exactly what I want,
> so it may just be a difference in the TGtk2 and tcltk event loops?
> In your example, can you think of a way to have a "cancel" button that
> would be able to kill reallySlowFunction() early?
> for the time being, I guess I'll just work on getting the gtk28
> package from macports working...


There are GTK+ binaries available that should work with the RGtk2 CRAN
binary for the Mac.

http://r.research.att.com/gtk2-runtime.dmg


> Thanks,
> Peter
>
> On Feb 12, 2008, at 1:31 PM, John Verzani wrote:
>
> > Dear Peter,
> >
> > I think this issue has more to do with the event loop than gWidgets.
> > I've cc'ed Michael Lawrence, who may be able to shed more light on
> > this. Perhaps gIdleAdd from RGtk2 can work around this, but I didn't
> > get anywhere. My understanding is that the event loop is preventing
> > the console from being interactive, but not GTK events. So for
> > instance, the GUI in the following example is responsive, during the
> > execution, but the command line is not.
> >
> > library(gWidgets)
> > options("guiToolkit"="RGtk2")
> >
> > reallySlowFunction = function(n=20) {
> >  for(i in 1:n) {
> >cat("z")
> >Sys.sleep(1)
> >  }
> >  cat("\n")
> > }
> >
> >
> > w <- gwindow("test")
> > g <- ggroup(cont=w, horizontal=FALSE)
> > b <- gbutton("click me", cont=g,handler = function(h,...)
> > reallySlowFunction())
> > r <- gradio(1:3, cont=g, handler = function(h,...) print(svalue(h
> > $obj)))
> >
> > ## you can click the radio button and get a response, but not the
> > console
> >
> >
> > --John
> >
> >
> > Hello,
> > I'm trying to make a graphical interface for an R function
> > I've written. A common use for the function is to call it with
> > specific parameters, and then watch the output as it evolves.
> > There's not necessarily a logical stopping point, so I usually
> > use ctrl-C when I'm done to stop it.
> > I've made a gWidgets interface to the function that gets some
> > user info and then on a button click calls the function. The
> > gWidgets window, however, seems to be frozen as long as the
> > function is running, and the function output seems to be
> > happening in the "background" in my R session, so ctrl-C (esc
> > on the Mac GUI) does not work to stop it. I have to kill R
> > entirely to stop the process.
> > So after all that setup here is my question:
> > Is there some way to have a gWidgets window interrupt a
> > function that it has called via a widget handler?
> > Thanks,
> > Peter
> >
> > --
> > John Verzani
> > CUNY/CSI Department of Mathematics
> > [EMAIL PROTECTED]
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] Need suggestions about GUI

2008-01-23 Thread Michael Lawrence
On Jan 22, 2008 6:41 AM, ronggui <[EMAIL PROTECTED]> wrote:
> Thanks, John,
> Here is some code to show what I want to do. BTW, it seems there is a
> bug in svalue in gWidgetstcltk for gtext when using the drop=T
> argument.
>
> getsel <-  function(obj, toolkit, ...) {
> ### get the selected text from gtext
> getWidget <- gWidgetstcltk:::getWidget
> if(tclvalue(tktag.ranges(getWidget(obj),"sel")) != "")
> ### notice
> ### gWidgetstcltk's _svalue(drop=T)_ has bug. should add tclvalue to
> the above line.
> {val = tclvalue(tkget(getWidget(obj),"sel.first","sel.last"))}
> else  val =""#tclvalue(tkget(getWidget(obj),"0.0","end"))
> val = unlist(strsplit(val,"\n"))
> return(val)
>   }
>
> get_index <-  function(obj, toolkit, ...) {
> ### get the selected text from gtext, return the index instead of text.
> getWidget <- gWidgetstcltk:::getWidget
> if(tclvalue(tktag.ranges(getWidget(obj),"sel")) != ""){
> val = strsplit(tclvalue(tktag.ranges(getWidget(obj),
> "sel")), " ")[[1]]}
> else  val =c(0,0)
> return(as.numeric(val))
>   }
>
>
> require(gWidgets)
>
> #initial parameters, storing the relavant information
> freecodes <- c("node1","node2")
> n_coding <- 0
> node <- character(1)
> chunk <- character(1)
> begin <- numeric(1)
> end <- numeric(1)
> imported_file <- readLines(file.path(R.home(),"COPYING"))
>
> codepanel <- gpanedgroup(container=gwindow("Code bar"), horizontal = FALSE)
> addcode = gdroplist(freecodes,0,container=codepanel,editable=TRUE)
>
> addcodebutton <- gbutton("Add new
> code",container=codepanel,handler=function(...) {
> if(svalue(addcode)!="")
> addcode[length(addcode)+1]<-svalue(addcode)
> }
> )
> ## allow the user to change the extant codes -- related to "freecodes" 
> parameter
>
> updatecodes <- gbutton("Update
> Codes",container=codepanel,handler=function(...)
> assign("freecodes",addcode[seq_len(length(addcode))],pos=1))
> ## get the items in gdroplist, and push it to variable "freecodes"
>
> coding <- gbutton("  Coding  ",container=codepanel,handler=
> function(...){
> if (svalue(addcode)!="" && sel!=""){
> sel <<- paste(getsel(ed),collapse="\n")
> sel_index <<- get_index(ed)
> n_coding <<- n_coding + 1
> node[n_coding] <<- svalue(addcode)
> chunk[n_coding] <<- sel
> begin[n_coding] <<- sel_index[1]
> end[n_coding] <<- sel_index[2]
> }}
> )
> ## coding: get seleted text from gtext and link it to specific code/node.
>
> ed <- gtext(con=T,width=500) # gtext
> svalue(ed) <- imported_file # push it file to gtext
>
> # steps to using this "toy":
>
> 1, enter new code names into the droplist box, for example node3, then
> click "add new code"
> 2, select specific code, for example node2.
> 3, select text chunk in the gtext, and click coding. repeat step 3 in
> coding process.
> 4, We can see what's been coded by inpecting variable of "node","chunk".
>
> What I don't know how to do:
> 1, When I select specific code, and click some button (for example
> highligh), all the text chunk related to that code will be highlighted
> (through color or font style etc.)

John might correct me, but I don't think that gWidgets supports this
level of markup. You might try using tcltk or RGtk2 directly (eg the
GtkTextView and GtkTextBuffer classes). It would be easy to get the
index of a selection in the buffer. See the function
gtkTextBufferGetSelectionBounds() in RGtk2.

> 2, I would like to arganize the codes like a tree. The code tree and
> reorganized by drag and drop.
> 3, In the coding buttong, how can I avoid using <<- in handler function.
>
>
> 2008/1/22, j verzani <[EMAIL PROTECTED]>:
>
> > ronggui  gmail.com> writes:
> >
> > > Thanks.
> > >
> > > gWidgets is quite good. However, I want to get the selection text chunk as
> > > well as the index, but the index arguments does not work for gtext.
> > >
> > > > obj<-gtext(cont=T)
> > > > svalue(obj,drop=T)
> > > [1] "cde"
> > > > svalue(obj,drop=T,index=T)
> > > [1] "cde"
> > >
> >
> >
> >
> > The svalue method has the index argument for the widgets where you might 
> > want to
> > return the  index or value such with a radio button group or combobox. For
> > gtext, the drop argument when TRUE returns just the text selected by the 
> > mouse,
> > otherwise the entire text buffer is returned.
> >
> > library(gWidgets)
> > options("guiToolkit"="RGtk2")
> > obj = gtext("sadfsad",cont=T)
> > svalue(obj)   ## returns: "sadfsad\n"
> > svalue(obj,drop=TRUE)  ## returns  ""
> > ## now highlight some text
> > svalue(obj,drop=TRUE) ## returns "dfsa"
> >
> > If you want to email me a bit more detail as to what you are trying to do, 
> > I can
> > let you know if gWidgets can work for you.
> >
> > --John
> > >
> >
> > > 2008/1/21, Gabor Grothendieck  gmail.com>:
> > > >
> > > > You can find examples of using tcltk here:
> > > >
> > > > http://www.sciviews.org/_rgui/tcltk/
> > > >
> > > > Also the gwidgets package is a toolkit

Re: [R] Graphics device storable in a variable

2007-11-15 Thread Michael Lawrence
This is possible using the cairoDevice package and RGtk2.

Turning an R graphic into a raw vector of bytes:

library(cairoDevice)
library(RGtk2)

# create a pixmap and tell cairoDevice to draw to it

pixmap <- gdkPixmapNew(w=500, h=500, depth=24)
asCairoDevice(pixmap)

# make a dummy plot

plot(1:10)

# convert the pixmap to a pixbuf

plot_pixbuf <- gdkPixbufGetFromDrawable(NULL, pixmap, pixmap$getColormap(),
0, 0, 0, 0, 500, 500)

# save the pixbuf to a raw vector

buffer <- gdkPixbufSaveToBufferv(plot_pixbuf, "jpeg", character(0),
character(0))$buffer

###

Then you can send buffer to your database, or whatever. Replacing "jpeg"
with "png" will probably produce png output.

Michael

On Nov 15, 2007 3:32 PM, Greg Snow <[EMAIL PROTECTED]> wrote:

> You might try looking at the tkrplot package, it uses win.metafile and
> captures the graphics device into a variable (which is then put into a
> tk lable, but you could probably do something else with it).
>
> --
> Gregory (Greg) L. Snow Ph.D.
> Statistical Data Center
> Intermountain Healthcare
> [EMAIL PROTECTED]
> (801) 408-8111
>
>
>
> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf Of Josh Tolley
> > Sent: Thursday, November 15, 2007 2:08 PM
> > To: r-help@r-project.org
> > Subject: [R] Graphics device storable in a variable
> >
> > I'm using R embedded in PostgreSQL (via PL/R), and would like
> > to use it to create images. It works fine, except that I have
> > to create every image in a file (owned by and only readable
> > by the PostgreSQL server), and then use PostgreSQL to read
> > from that file and return it to the client. It would be much
> > nicer if I could plot images into an R variable (for
> > instance, a matrix), and return that variable through the
> > PostgreSQL client. Leaving aside the details of returning the
> > data to PostgreSQL (which I realize are beyond the scope of
> > this list), I envision R code along the lines of the following:
> >
> > # Create a png device, a handle to which is stored in myDevice
> > > myDevice <- png.variable(height = 1280, width = 1024, bg = "white")
> > # Plot some data into the current device
> > > plot(myX, myY, col="red")
> > # Finalize
> > > dev.off()
> > # Print out the contents of myDevice
> > > myDevice
> >
> > ...and the data would print out just like any other matrix or
> > class or whatever type myDevice actually is.
> >
> > So my question is does such a thing already exist? I know
> > about piximage, but apparently I have to load image data from
> > somewhere for it to work; I can't use plot(), etc. to create
> > the piximage data. GDD would be a nice way to do it, because
> > GD libraries are widely available for use with other
> > languages I might use with PostgreSQL and PL/R (for instance,
> > Perl would talk to PostgreSQL, call a PL/R function to use R
> > to return an image, which Perl would then process further),
> > but GDD requires temporary files as well, as far as I can
> > see. Thanks for any help anyone can offer.
> >
> > -Josh / eggyknap
> >
> > __
> > R-help@r-project.org 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.
> >
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] jEdit for R

2007-10-29 Thread Michael Lawrence
On 10/26/07, John Thaden <[EMAIL PROTECTED]> wrote:
>
> Michael,
>Where can we read you document that includes "various ideas
>going far beyond simply embedding R"?  What about Julian's
>opinion that Tinn-R is more stable and loads more quickly
>than jEdit?  Can that be true in a Windows environment?


Tinn-R probably loads faster, since it doesn't have the overhead of Java. As
far as stability, I haven't used Tinn-R enough to compare. I use jEdit for
my daily work, all day long, for the past 6 years, and I can't remember it
ever crashing on me.

   -John Thaden
>
>On Thu, 25 Oct 2007 07:25:12, Michael Lawrence wrote:
>
>> I think a better idea would be to make a jEdit plugin
>> that embeds an R console component (perhaps the one from
>> JGR, but the last I checked it was not embeddable,
>> unfortunately). Anyway, it would be easy enough to roll your
>> own by extending the existing jEdit Console plugin using JRI.
>> I would have done that ages ago, but I'm still hoping that
>> JGR could be leveraged in some way.
>
>> In my opinion, jEdit has a very clean design (at both the UI
>> and the API level) as do several of the important plugins
>> (ie Console). One can actually run R inside the jEdit console,
>> but it does not echo your commands, which hinders its usability.
>
>> I haven't used Tinn-R much since it is not cross-platform.
>> Also, I prefer to use the same editor for all my work, beyond R,
>> and I'm not sure if Tinn-R would be up to that task (but as
>> I've said I haven't used it much).
>
>> If anyone wants to work with me on providing an R support
>> plugin for jEdit, I'd be open to starting the project. I've
>> already written a document with various ideas, which goes far
>> beyond simply embedding R. The editor-centric mode of using
>> R is obviously very popular and useful, but, at least in my
>> opinion, no editor does a great job at it on all platforms.
>
>Michael
>
>On 10/24/07, Julian Burgos <[EMAIL PROTECTED]> wrote:
>>>
>>> Hi Rob,
>>> I used jEdit, but I'm not sure if there is a 'ctrl-R' option
> available.
>>>   I eventually switched to Tinn-R, which is an editor customized for
> R
>>> (although it can be used for other languages) and does provide the
>>> connection to R you are looking for.  Also (I think) loads faster
> and it
>>> is more stable than jEdit.
>>>
>>> Julian
>>>
>>> threshold wrote:
>>>> Hi,
>>>> I just installed jEdit but have no clue, whether I can run my code
> a'la
>>>> "ctrl-R" directly from jEdit script, or should source it from R
> command
>>>> line, after saving it first in jEdit.
>>>>
>>>> thanks for any help,
>>>> rob
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] jEdit for R

2007-10-25 Thread Michael Lawrence
I think a better idea would be to make a jEdit plugin that embeds an R
console component (perhaps the one from JGR, but the last I checked it was
not embeddable, unfortunately). Anyway, it would be easy enough to roll your
own by extending the existing jEdit Console plugin using JRI. I would have
done that ages ago, but I'm still hoping that JGR could be leveraged in some
way.

In my opinion, jEdit has a very clean design (at both the UI and the API
level) as do several of the important plugins (ie Console). One can actually
run R inside the jEdit console, but it does not echo your commands, which
hinders its usability.

I haven't used Tinn-R much since it is not cross-platform. Also, I prefer to
use the same editor for all my work, beyond R, and I'm not sure if Tinn-R
would be up to that task (but as I've said I haven't used it much).

If anyone wants to work with me on providing an R support plugin for jEdit,
I'd be open to starting the project. I've already written a document with
various ideas, which goes far beyond simply embedding R. The editor-centric
mode of using R is obviously very popular and useful, but, at least in my
opinion, no editor does a great job at it on all platforms.

Michael

On 10/24/07, Julian Burgos <[EMAIL PROTECTED]> wrote:
>
> Hi Rob,
> I used jEdit, but I'm not sure if there is a 'ctrl-R' option available.
>   I eventually switched to Tinn-R, which is an editor customized for R
> (although I can be used for other languages) and does provide the
> connection to R you are looking for.  Also (I think) loads faster and it
> is more stable than jEdit.
>
> Julian
>
> threshold wrote:
> > Hi,
> > I just installed jEdit but have no clue, whether I can run my code a'la
> > "ctrl-R" directly from jEdit script, or should source it from R command
> > line, after saving it first in jEdit.
> >
> > thanks for any help,
> > rob
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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


Re: [R] R CMD build not excluding .svn

2007-10-01 Thread Michael Lawrence
Thanks for the help. I looked into it further and noticed that the src/RGtk2
directory was actually a symlink. The perl find() does not follow symlinks,
as invoked, but tar, as invoked, does. Thus, when the tar/untar effectively
copies the files, there is a mismatch with the exclude paths.

Is there some reason why the exclude paths cannot be calculated on the
untar'd version rather than the original package directory? If this sounds
reasonable, I'll submit a patch.

Thanks,
Michael

On 10/1/07, Prof Brian Ripley <[EMAIL PROTECTED]> wrote:
>
> It does this via an exclude list which it uses to remove files from a
> staged build.  Printing out the exclude list (at ca line 232) should be
> informative. One possibility is simply that there is a permissions issue
> in deleting that directory.
>
> On Sun, 30 Sep 2007, Michael Lawrence wrote:
>
> > Hi,
> >
> > In my package RGtk2, there's a directory called 'src/RGtk2' that
> contains,
> > like all the other directories in the package, a '.svn' directory. It
> seems
> > that R CMD build is somehow missing that one '.svn' in 'src/RGtk2', even
> > though it excludes all the other instances of '.svn'.
> >
> > I've tried putting 'src/RGtk2/.svn' into the .Rbuildignore, but it does
> not
> > have any effect. I've also looked into the R CMD build script, but I
> can't
> > find where this problem might occur (but then again, perl is not exactly
> my
> > thing). Perhaps it has something to do with having a directory with the
> same
> > name as the package under the 'src' directory?
>
> Pretty unlikely.
>
>
> > Thanks for the help,
> > Michael
> >
> >   [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org 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.
> >
>
> --
> Brian D. Ripley,  [EMAIL PROTECTED]
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford, Tel:  +44 1865 272861 (self)
> 1 South Parks Road, +44 1865 272866 (PA)
> Oxford OX1 3TG, UKFax:  +44 1865 272595
>

[[alternative HTML version deleted]]

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


[R] R CMD build not excluding .svn

2007-09-30 Thread Michael Lawrence
Hi,

In my package RGtk2, there's a directory called 'src/RGtk2' that contains,
like all the other directories in the package, a '.svn' directory. It seems
that R CMD build is somehow missing that one '.svn' in 'src/RGtk2', even
though it excludes all the other instances of '.svn'.

I've tried putting 'src/RGtk2/.svn' into the .Rbuildignore, but it does not
have any effect. I've also looked into the R CMD build script, but I can't
find where this problem might occur (but then again, perl is not exactly my
thing). Perhaps it has something to do with having a directory with the same
name as the package under the 'src' directory?

Thanks for the help,
Michael

[[alternative HTML version deleted]]

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


Re: [R] Cairo on windows

2007-09-28 Thread Michael Lawrence
On 9/27/07, Moisan Yves <[EMAIL PROTECTED]> wrote:
>
> > My experience is that cairoDevice is a lot slower than Cairo,
> especially
> on Windows, and about equally flaky.  If you see how many layers are
> involved with Cairo on Windows you will not be surprised.
>
> Actually, I ended up trying to load deviceCairo simply because it was
> the only other package with the string "Cairo" in it besides "Cairo"
> itself ;-).  I suspected some interaction between the two libraries
> (deviceCairo and Cairo) so that's why I tried to load it hoping it would
> solve the flakiness of the CairoWin display.


My guess is the problem is due to an older version of GTK+. Although
cairoDevice only requires GTK+ 2.8.x (which is probably what you have
installed), the Windows binary of cairoDevice on CRAN is probably built
against GTK+ 2.10.x, just like RGtk2.

I've added a feature to cairoDevice and RGtk2 recently that will
automatically try to install the latest binary of GTK+ on Mac and Windows
when loading the library fails.

That said, I'd really like to merge cairoDevice (specifically the
RGtk2-embedding feature) with the Cairo package. Having one less package to
maintain would be nice.

> If all you need is semi-transparency support I suggest you try R 2.6.0
> RC
> which supports it in the windows() device.
>
> Thanx for the tip.
>
> Yves Moisan
>
> __
> R-help@r-project.org 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.
>

[[alternative HTML version deleted]]

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