[R] TM convert Newsgroup to plain text

2007-04-04 Thread Saeed Abu Nimeh
Hi,
Anyone tried to do stemming for emails (mbox format) using the Text
Mining (tm) package in R. According to the documentation the text
document collection has to be converted to text and there is no method
to convert Newsgroup (email) to plain text.
Thanks,
Saeed

__
R-help@stat.math.ethz.ch 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 installing rgdal on Mac OS X

2007-04-04 Thread Prof Brian Ripley
On Wed, 4 Apr 2007, Thomas Adams wrote:

> Please forgive me for posting this here if it is not appropriate (where
> should this question be posed?)?

The R posting guide asked you to ask the maintainer, but as this is a 
MacOS X issue, on the R-sig-mac list.  It's not appropriate for R-help 
because of

'Questions likely to prompt discussion unintelligible to non-programmers 
should go to to R-devel.'  (R posting guide.)

Also R-sig-geo would be appropriate for support questions for this 
package.

> I am attempting to install rgdal (from source, since there is no binary)
> on Mac OS X 10.4.9 on a PowerPC G3 Macintosh. I have R version 2.4.1
> (2006-12-18) installed. Following the install directions suggested at:

You need a later version of the Xcode tools. 
RSiteSearch("-macosx_version_min") got me there on the first hit.

[... error was]

> g++-4.0 -arch ppc -dynamiclib -Wl,-macosx_version_min -Wl,10.3
> -undefined dynamic_lookup -single_module -multiply_defined suppress
> -L/usr/local/lib -o rgdal.so OGR_write.o gdal-bindings.o ogr_geom.o
> ogr_proj.o ogrdrivers.o ogrsource.o projectit.o
> -L/Library/Frameworks/PROJ.framework/Versions/4.5/unix/lib
> -L/Library/Frameworks/GDAL.framework/unix/lib -lgdal -lproj
> -L/Library/Frameworks/R.framework/Resources/lib/ppc -lR -dylib_file
> libRblas.dylib:/Library/Frameworks/R.framework/Resources/lib/ppc/libRblas.dylib
> /usr/bin/libtool: unknown option character `m' in: -macosx_version_min


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

__
R-help@stat.math.ethz.ch 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] changing existing graphs optimally

2007-04-04 Thread projection83

hi there,

right now i am going about things a round about route with graphs in that if
i want to change the scale to log, I have to to a "reset" with add=F, then
program things to be redrawn from scratch - bad coding basically:P

in plot(), the first arguement it needs is data - how do you reference whats
already there, rather than respecifying (or am i supposed to use a different
function?

thanks for any pointers!
-- 
View this message in context: 
http://www.nabble.com/changing-existing-graphs-optimally-tf3529483.html#a9849622
Sent from the R help mailing list archive at Nabble.com.

__
R-help@stat.math.ethz.ch 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] Package for common rater agreement statistics?

2007-04-04 Thread Alan Gibson
Could someone point me to a package that generates common agreement
statistics for classified observations (particularly the F1 measure)?

It seems like there would have to be a package in cran that could
handle this, but I cant seem to find it. The irr package does alot of
interrater reliability statistics, but F1 doesnt appear to be one of
them. ROCR appears to do all of reliability statistics that one could
want, but there appears to be no way to print them out as text; it
only produces graphs.

Thanks,

alan gibson

__
R-help@stat.math.ethz.ch 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] Moving plot labels

2007-04-04 Thread Peter Alspach

Dean

Try:

plot(c(-0.25,18),c(0, max(patient10)),type="n", ylab="SD of POST
estimator", xlab="")
title(xlab='Scans\n(a)', line=3) 

Peter Alspach

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
> Sent: Thursday, 5 April 2007 12:21 p.m.
> To: r-help@stat.math.ethz.ch
> Subject: [R] Moving plot labels
> 
> Hi.
> 
> I'm sure this is a simple problem, yet I can't seem to get 
> simple help for it.
> 
> I am simply trying to move my xlab in plot().
> 
> I am currently using the following commands:
> 
> plot(c(-0.25,18),c(0, max(patient10)),type="n", ylab="SD of 
> POST estimator", xlab="Scans \n (a)")
> 
> But when the plot prints, the xlab is printed over top the 
> xaxis. I tried adjusting mar(), but this just works with the 
> margins outside the plotting area. What is a simple fix? Is 
> there a single command I can add that adjusts the size of the 
> plotting area within the area controlled by mar()?
> 
> Thanks very much.
> 
> Dean
> 
> __
> R-help@stat.math.ethz.ch 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.
> 

__

The contents of this e-mail are privileged and/or confidenti...{{dropped}}

__
R-help@stat.math.ethz.ch 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] Problem installing rgdal on Mac OS X

2007-04-04 Thread Thomas Adams
Please forgive me for posting this here if it is not appropriate (where 
should this question be posed?)…

I am attempting to install rgdal (from source, since there is no binary) 
on Mac OS X 10.4.9 on a PowerPC G3 Macintosh. I have R version 2.4.1 
(2006-12-18) installed. Following the install directions suggested at:

http://www.sal.uiuc.edu/tools/tools-sum/rgeo/rgeo-detail/map-packages-on-cran

The Mac OS X Frameworks packages were obtained from: 
http://www.kyngchaos.com/software/unixport

Using R CMD INSTALL in a term window I have:

R CMD INSTALL rgdal_0.5-6.tar.gz 
--configure-args='--with-gdal-config=/Library/Frameworks/GDAL.framework/Versions/1.4/Programs/gdal-config
 
--with-proj-include=/Library/Frameworks/PROJ.framework/Versions/4.5/Headers 
--with-proj-lib=/Library/Frameworks/PROJ.framework/Versions/4.5/unix/lib'

which produces the following output:

* Installing *source* package 'rgdal' ...
gdal-config: 
/Library/Frameworks/GDAL.framework/Versions/1.4/Programs/gdal-config
checking for gcc... gcc-4.0 -arch ppc -std=gnu99
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc-4.0 -arch ppc -std=gnu99 accepts -g... yes
checking for gcc-4.0 -arch ppc -std=gnu99 option to accept ANSI C... 
none needed
checking how to run the C preprocessor... gcc-4.0 -arch ppc -std=gnu99 -E
checking for egrep... 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 proj_api.h usability... yes
checking proj_api.h presence... yes
checking for proj_api.h... yes
checking for pj_init_plus in -lproj... yes
Package CPP flags: 
-I/Library/Frameworks/PROJ.framework/Versions/4.5/Headers 
-I/Library/Frameworks/GDAL.framework/unix/include
Package LIBS: -L/Library/Frameworks/PROJ.framework/Versions/4.5/unix/lib 
-L/Library/Frameworks/GDAL.framework/unix/lib -lgdal
configure: creating ./config.status
config.status: creating src/Makevars
** libs
** arch - ppc
g++-4.0 -arch ppc -I/Library/Frameworks/R.framework/Resources/include 
-I/Library/Frameworks/R.framework/Resources/include/ppc 
-I/Library/Frameworks/PROJ.framework/Versions/4.5/Headers 
-I/Library/Frameworks/GDAL.framework/unix/include -I/usr/local/include 
-fPIC -g -O2 -c OGR_write.cpp -o OGR_write.o
g++-4.0 -arch ppc -I/Library/Frameworks/R.framework/Resources/include 
-I/Library/Frameworks/R.framework/Resources/include/ppc 
-I/Library/Frameworks/PROJ.framework/Versions/4.5/Headers 
-I/Library/Frameworks/GDAL.framework/unix/include -I/usr/local/include 
-fPIC -g -O2 -c gdal-bindings.cpp -o gdal-bindings.o
g++-4.0 -arch ppc -I/Library/Frameworks/R.framework/Resources/include 
-I/Library/Frameworks/R.framework/Resources/include/ppc 
-I/Library/Frameworks/PROJ.framework/Versions/4.5/Headers 
-I/Library/Frameworks/GDAL.framework/unix/include -I/usr/local/include 
-fPIC -g -O2 -c ogr_geom.cpp -o ogr_geom.o
g++-4.0 -arch ppc -I/Library/Frameworks/R.framework/Resources/include 
-I/Library/Frameworks/R.framework/Resources/include/ppc 
-I/Library/Frameworks/PROJ.framework/Versions/4.5/Headers 
-I/Library/Frameworks/GDAL.framework/unix/include -I/usr/local/include 
-fPIC -g -O2 -c ogr_proj.cpp -o ogr_proj.o
g++-4.0 -arch ppc -I/Library/Frameworks/R.framework/Resources/include 
-I/Library/Frameworks/R.framework/Resources/include/ppc 
-I/Library/Frameworks/PROJ.framework/Versions/4.5/Headers 
-I/Library/Frameworks/GDAL.framework/unix/include -I/usr/local/include 
-fPIC -g -O2 -c ogrdrivers.cpp -o ogrdrivers.o
g++-4.0 -arch ppc -I/Library/Frameworks/R.framework/Resources/include 
-I/Library/Frameworks/R.framework/Resources/include/ppc 
-I/Library/Frameworks/PROJ.framework/Versions/4.5/Headers 
-I/Library/Frameworks/GDAL.framework/unix/include -I/usr/local/include 
-fPIC -g -O2 -c ogrsource.cpp -o ogrsource.o
g++-4.0 -arch ppc -I/Library/Frameworks/R.framework/Resources/include 
-I/Library/Frameworks/R.framework/Resources/include/ppc 
-I/Library/Frameworks/PROJ.framework/Versions/4.5/Headers 
-I/Library/Frameworks/GDAL.framework/unix/include -I/usr/local/include 
-fPIC -g -O2 -c projectit.cpp -o projectit.o
g++-4.0 -arch ppc -dynamiclib -Wl,-macosx_version_min -Wl,10.3 
-undefined dynamic_lookup -single_module -multiply_defined suppress 
-L/usr/local/lib -o rgdal.so OGR_write.o gdal-bindings.o ogr_geom.o 
ogr_proj.o ogrdrivers.o ogrsource.o projectit.o 
-L/Library/Frameworks/PROJ.framework/Versions/4.5/unix/lib 
-L/Library/Frameworks/GDAL.framework/unix/lib -lgdal -lproj 
-L/Library/Frameworks/R.framework/Resources/lib/ppc -lR -dylib_file 
libRblas.dylib:/Library/Framewo

Re: [R] Newbie: Simple loops: complex troubles

2007-04-04 Thread projection83

This helped a lot. Thank you so much - im now able to get some basic stuff
moving around in R!


Petr Klasterecky wrote:
> 
> Not sure whether this is exactly and everything you want, but at least 
> it may give you some ideas how to proceed. You do not need loops at all:
> 
> Let's try a simplified example with 3 samples, each of length 10 (just 
> for printing purposes):
> 
> m <- c(1,2,3)
> v <- c(1,4,9)
> n <- 10
> means <- rep(m,each=n)
> vars <- rep(v,each=n)
> means
>   [1] 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3
> vars
>   [1] 1 1 1 1 1 1 1 1 1 1 4 4 4 4 4 4 4 4 4 4 9 9 9 9 9 9 9 9 9 9
> 
> numbers <- matrix(rnorm(length(means), mean=means, sd=sqrt(vars)), 
> nrow=n, byrow=F)
> numbers
>  [,1]   [,2]  [,3]
>   [1,]  0.9721407  0.4510903 -2.880967
>   [2,] -0.4834124 -2.7958993 -1.368037
>   [3,]  1.6871736 -0.6717009 -3.268698
>   [4,]  0.9738312  3.1919293  3.982135
>   [5,]  0.8032162  1.0397078  7.227974
>   [6,] -0.1606657  2.6339503  5.873210
>   [7,]  0.5786295 -0.3589869  4.194425
>   [8,]  0.9909184  2.0622899  6.432129
>   [9,]  3.1687842  1.9765014  3.788201
> [10,]  1.4814704  3.3024049  4.194628
> 
> colnames(numbers) <- paste('Ux',1:length(m),sep='')
> numbers
>   Ux1Ux2   Ux3
>   [1,]  0.9721407  0.4510903 -2.880967
>   [2,] -0.4834124 -2.7958993 -1.368037
>   [3,]  1.6871736 -0.6717009 -3.268698
>   [4,]  0.9738312  3.1919293  3.982135
>   [5,]  0.8032162  1.0397078  7.227974
>   [6,] -0.1606657  2.6339503  5.873210
>   [7,]  0.5786295 -0.3589869  4.194425
>   [8,]  0.9909184  2.0622899  6.432129
>   [9,]  3.1687842  1.9765014  3.788201
> [10,]  1.4814704  3.3024049  4.194628
> 
> Now your random vectors are in columns of 'numbers' and you can work 
> with them using indexing.
> 
> Petr
> 
> projection83 napsal(a):
>> I am used to java (well, i dont remember it really well, but anyway)
>> 
>> I have having a really difficult time making simple loops to work. I got
>> the
>> following to work:
>> 
>>  ##
>>  ##Creates objects Ux1, Ux2, Ux2 etc. that  all contain n numbers in a
>> random distribution
>>  ##
>>  m<-c(m1,m2,m3,m4,m5,m6,m7,m8,m9,m10)#these are defined as numbers
>> (means)
>>  v<-c(v1,v2,v3,v4,v5,v6,v7,v8,v9,v10)#these are defined as numbers
>> (variances)  
>> n<-50
>>  for(k in 1:g)
>>  {
>>  assign( paste("Ux", k, sep=""), rnorm( n  , 
>> assign(paste("m",1,sep=""),m[k])   ,   assign(paste("m",1,sep=""),v[k]) 
>> )  
>> )
>>  }
>> 
>> 
>> The above seems like a lot of work for such a simple feat, no?
>> 
>> Also, I CANNot get the following to work in a loop manor:
>> 
>> Ux1i<-as.integer(Ux1)
>>  Ux2i<-as.integer(Ux2)
>>  Ux3i<-as.integer(Ux3)
>> 
>> or
>> 
>>  Sx1<-sort(Ux1i)
>>  Sx2<-sort(Ux2i)
>>  Sx3<-sort(Ux3i)
>> 
>> Maybe I am just not using matrixes enough? but even that seems quite a
>> lot
>> more complex than calling x<-matrix() then grabbing values by
>> x[j][k]...(java style if i remember correctly). the matrix help in R
>> dosnt
>> make much sense to me. And also i am not sure why numeric() dosnt make
>> you
>> define length before you use it, yet matrix() does.  Is there some other
>> funciton that i should be using to make length not an issue?
>> 
>> 
>> All in all, I dont know if i am going about this loop stuff a rely
>> round
>> about way - Any help would make me much less loopy:Pthanks 
>> 
>> 
>> 
> 
> -- 
> Petr Klasterecky
> Dept. of Probability and Statistics
> Charles University in Prague
> Czech Republic
> 
> __
> R-help@stat.math.ethz.ch 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 this message in context: 
http://www.nabble.com/Newbie%3A-Simple-loops%3A-complex-troubles-tf3523751.html#a9848704
Sent from the R help mailing list archive at Nabble.com.

__
R-help@stat.math.ethz.ch 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] rcmdr help

2007-04-04 Thread John Fox
Dear Daniel,

I'm not a Debian user, but your description of what you did makes me wonder
whether (1) you ever loaded the Rcmdr package, and (2) whether you installed
its dependencies. After starting up R, you can load (and start) the R
commander via the command library(Rcmdr). Prior to that, you should be able
to install the Rcmdr package along with its dependencies from within R via
the command install.packages("Rcmdr", dependencies=TRUE).

Finally, if you haven't already done so, you'd probably save yourself some
time and trouble by reading the "Introduction to R" manual that ships with
R.

I hope this helps,
 John


John Fox
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4
905-525-9140x23604
http://socserv.mcmaster.ca/jfox 
 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Fodor
> Sent: Wednesday, April 04, 2007 3:24 PM
> To: r-help@stat.math.ethz.ch
> Subject: [R] rcmdr help
> 
> Dear All,
> 
> I use Debian etch and downloaded R from its repo. Although it 
> is running I would like to make the first steps using rcmdr. 
> I went through on wikis and howtos, installed rcmdr but it is 
> not running. Apparently it is properly installed, there is an 
> Rcmdr library in /usr/lib/R/site-library but I cannot start 
> it neither from command line nor by clicking on applications 
> -> debian 
> -> apps -> math -> GNU R. Clicking on it starts R without 
> GUI. Tcl 8.4 
> -> was
> already installed and there are no broken packages. I would 
> appreciate any kind of help in starting R with gui. Please, 
> excuse me if it is a trivial question, I am newbie to R.
> 
> Best wishes
> 
> Daniel
> 
> __
> R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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] Moving plot labels

2007-04-04 Thread dvrecko
Hi.

I'm sure this is a simple problem, yet I can't seem to get simple help for
it.

I am simply trying to move my xlab in plot().

I am currently using the following commands:

plot(c(-0.25,18),c(0, max(patient10)),type="n", ylab="SD of POST estimator",
xlab="Scans \n (a)")

But when the plot prints, the xlab is printed over top the xaxis. I tried
adjusting mar(), but this just works with the margins outside the plotting
area. What is a simple fix? Is there a single command I can add that adjusts
the size of the plotting area within the area controlled by mar()?

Thanks very much.

Dean

__
R-help@stat.math.ethz.ch 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] how to image.plot a XY grid file into a lat-lon map

2007-04-04 Thread Linda Smith
Hi All,

I have a netcdf gridded file with LCC projection. I can easily use
image.plot to visualize it. However, as the axises are in X,Y, not Lat and
Lon, I could not add state or country maps onto it (or lat lon information).
I do have a grid2d file that describes the lat and lon for each (X,Y) grid,
but the lat and lon are not regularly spaced, so I could not use image.plot.


Does anyone know how to plot this type of gridded data so that country or
state borders can be easily added? Thanks a lot!

Linda

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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 behavior when creating a list of functions

2007-04-04 Thread Thomas Lumley
On Wed, 4 Apr 2007, Matthew Suderman wrote:

> I wanted to create a list of functions whose output differs depending 
> the value of a variable when the function was created.  Generally this 
> did not work.  Each function was exactly the same, as in the simple 
> example below:
>
> get_data_function <- function(v) {
>  function() {
>print(v)
>  }
> }
> data_functions <- sapply(1:10,function(v) get_data_function(v))
> (data_functions[[1]])() # prints 10!
>
> However, if I insert a statement in get_data_function to print argument 
> v, then I get the different functions that I wanted:
>
> get_data_function <- function(v) {
>  print(v)
>   function() {
> print(v)
>   }
> }
> data_functions <- sapply(1:10,function(v) get_data_function(v))
> (data_functions[[1]])() # prints 1, as expected!
>
> I have two questions about this:
> * Is this a bug in R?

No, it's lazy evaluation at work.

> * Is there a more direct way to get the effect of printing v?

The function force() is designed for this -- it doesn't do anything 
special that any other evaluation wouldn't do, but it makes clear that all 
you are doing is forcing evaluation.

-thomas

__
R-help@stat.math.ethz.ch 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 behavior when creating a list of functions

2007-04-04 Thread jim holtman
'v' was not evaluated when you defined the function; this is 'lazy'
evaluation in R; try

get_data_function <- function(v) {
v   # cause 'v' to be evaluated
function() {
   print(v)  # now it is defined when the function is
}
}
data_functions <- sapply(1:10,function(v) get_data_function(v))
(data_functions[[1]])()


On 4/4/07, Matthew Suderman <[EMAIL PROTECTED]> wrote:
>
> I wanted to create a list of functions whose output differs depending the
> value of a variable when the function was created.  Generally this did not
> work.  Each function was exactly the same, as in the simple example below:
>
> get_data_function <- function(v) {
> function() {
>print(v)
> }
> }
> data_functions <- sapply(1:10,function(v) get_data_function(v))
> (data_functions[[1]])() # prints 10!
>
> However, if I insert a statement in get_data_function to print argument v,
> then I get the different functions that I wanted:
>
> get_data_function <- function(v) {
> print(v)
>   function() {
> print(v)
>   }
> }
> data_functions <- sapply(1:10,function(v) get_data_function(v))
> (data_functions[[1]])() # prints 1, as expected!
>
> I have two questions about this:
> * Is this a bug in R?
> * Is there a more direct way to get the effect of printing v?
>
> Matt
>
>
>
> -
> Don't get soaked.  Take a quick peek at the forecast
>
>[[alternative HTML version deleted]]
>
> __
> R-help@stat.math.ethz.ch 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.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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] transfer function models

2007-04-04 Thread Natalia

Dear Sam,

I´ve found your posting on  
https://stat.ethz.ch/pipermail/r-help/2005-January/063966.html
about transfer funtion in SAS. I´m writing my diploma thesis in Germany  
right now and can´t find any good documentation which would explain how  
dynamic regression is realized in SAS.Do you happen to know what numerator  
and denominator factors refer to in the original formula and why these  
have seasonal order? I also wonder if I should determine ARIMA parameters  
first and then dynamic regressors or vice versa. I never had these modells  
in a class and I study business administration, so it is not that easy for  
me to find a solution even though I´m alsready looking for a while and  
meanwhile I get pretty desperate about my whole work:( Any answer from you  
I´ll appreciate greatly. If there is any way for a business student to  
calculate the trasfer function in R where can one find some examples?

Thanks ahead.

Best regards,
Nata
--

__
R-help@stat.math.ethz.ch 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] unexpected behavior when creating a list of functions

2007-04-04 Thread Matthew Suderman
I wanted to create a list of functions whose output differs depending the value 
of a variable when the function was created.  Generally this did not work.  
Each function was exactly the same, as in the simple example below:

get_data_function <- function(v) {
  function() {
print(v)
  }
}
data_functions <- sapply(1:10,function(v) get_data_function(v))
(data_functions[[1]])() # prints 10!

However, if I insert a statement in get_data_function to print argument v, then 
I get the different functions that I wanted:

get_data_function <- function(v) {
  print(v)
   function() {
 print(v)
   }
 }
 data_functions <- sapply(1:10,function(v) get_data_function(v))
 (data_functions[[1]])() # prints 1, as expected!
 
I have two questions about this:
* Is this a bug in R?  
* Is there a more direct way to get the effect of printing v?

Matt


 
-
Don't get soaked.  Take a quick peek at the forecast 

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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] REPLACE and REMOVE fns

2007-04-04 Thread jim holtman
Does this do it?

> x <- readLines("/temp/Giambi_03_post.txt")
> x.in  <- c("S", "D", "T", "HR", "O", "K", "E", "FL")
> x.out <- c( 1,   1,   1,   1,0,   0,   0,   0)
> # map the characters.  Assume that missing will be deleted
> x <- x.out[match(x, x.in)]
> x <- x[!is.na(x)]
>
> x
 [1] 0 0 0 0 1 0 0 1 0 0 0 0 0 1 1 0 0 0 0 1 0 1 0 0 0 1 0 0 0 0 1 1 0 0 0 0
0 1 1 0 0 0 1 0 0 0 1 0 0 0
[51] 1 0 0 0 1 1 0 0



On 4/4/07, Tina Robles <[EMAIL PROTECTED]> wrote:
>
> See attached...sorry
>
> On 4/4/07, Uwe Ligges <[EMAIL PROTECTED]> wrote:
> >
> >
> > Tina Robles wrote:
> > > I want to use the replace function on "R_Jeter_04_post" (see attached)
> > > so that S=1, D=1, T=1, HR=1, O=0, K=0, E=0, FC=0, and W,IW,and HP are
> > > removed, so that i have a simple list of 1's and 0's.
> >
> >
> > There are just 0's and 1's in your attachment ...
> >
> > Uwe Ligges
> >
> >
> >
> > > I understand that I need to use the command "replace(x,list,values)"
> > > and "rm()" but I'm having trouble using them. (syntax errors and
> > > whatnot)
> > >
> > > Any help would be appreciated.
> > >
> > >
> > >
> 
> > >
> > > __
> > > R-help@stat.math.ethz.ch 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.
> >
>
>
> --
> Tina Robles
> [EMAIL PROTECTED]
> 305-710-5839
>
> __
> R-help@stat.math.ethz.ch 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.
>
>
>


-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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] rcmdr help

2007-04-04 Thread Daniel Fodor
Dear All,

I use Debian etch and downloaded R from its repo. Although it is running I 
would like to make the first steps using rcmdr. I went through on wikis and 
howtos, installed rcmdr but it is not running. Apparently it is properly 
installed, there is an Rcmdr library in /usr/lib/R/site-library but I cannot 
start it neither from command line nor by clicking on applications -> debian 
-> apps -> math -> GNU R. Clicking on it starts R without GUI. Tcl 8.4 was 
already installed and there are no broken packages. I would appreciate any 
kind of help in starting R with gui. Please, excuse me if it is a trivial 
question, I am newbie to R.

Best wishes

Daniel

__
R-help@stat.math.ethz.ch 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] Power analysis and mixed model

2007-04-04 Thread Dave Atkins

Like Harold, I have also used simulation-based methods for power analyses, 
which 
I discuss (briefly) in the following article (with R code in an appendix):

Atkins, D. C. (2005).  Using multilevel models to analyze marital and family 
treatment data: Basic and advanced issues.  Journal of Family Psychology, 19, 
98-110.

However, depending on the nature of your design, it could be far easier to use 
Steve Raudenbush's Optimal Design software with menus and GUI, downloadable at:

http://sitemaker.umich.edu/group-based/optimal_design_software

cheers, Dave
-- 
Dave Atkins, PhD
[EMAIL PROTECTED]


From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Julien
Sent: Wednesday, April 04, 2007 10:40 AM
To: r-help at stat.math.ethz.ch
Subject: [R] Power analysis and mixed model

Hi

Is there any way to compute power analysis for a mixed model ?

Julien



Julien Martin

Candidat au Doctorat

Laboratoire de Marco festa-Bianchet

Universiti de Sherbrooke

Sherbrooke, Quibec

J1K 2R1 Canada

819 821 8000 poste 62059

__
R-help@stat.math.ethz.ch 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] compile errors with rgl-0.70.570 on FreeBSD

2007-04-04 Thread Rainer Hurling
Thank you for your work on rgl.

Reading in another thread about your new (inofficial) version of rgl 
(see below) I tried it with R version 2.5.0 alpha (2007-03-31 r40986) 
under FreeBSD 7.0-CURRENT. Unfortunately I got the following error:

---
#R CMD INSTALL rgl_0.70.570.tar.gz
* Installing to library '/usr/local/lib/R/library'
* Installing *source* package 'rgl' ...
checking for libpng-config... yes
configure: using libpng-config
configure: using libpng dynamic linkage
checking for X... libraries /usr/X11R6/lib, headers /usr/X11R6/include
checking GL/gl.h usability... no
checking GL/gl.h presence... no
checking for GL/gl.h... no
checking GL/glu.h usability... no
checking GL/glu.h presence... no
checking for GL/glu.h... no
configure: error: missing required header GL/gl.h
ERROR: configuration failed for package 'rgl'
** Removing '/usr/local/lib/R/library/rgl'
** Restoring previous '/usr/local/lib/R/library/rgl'
---

This version is not able to find any GL files on my system.

I did not have any problems compiling rgl_0.70.564.tar.gz.

If I can test anything please let me know.

Rainer



 > You can get one slightly more current than the most current release from
 > my web page, .  It has
 > the following changes, which may impact you:
 >
 > v0.70.570
 >- changes to configure script from Laszlo Kajan and Brian Ripley:
 > should
 >  now be much more portable
 >- removed deprecated OSX font setting calls
 >- texture properties are now returned by material3d()
 >- allowed normals and texture coordinates to be specified in
 > triangles and quads
 >- normals may be specified in qmesh objects, but (at present)
 > subdivide removes them
 >- material3d() now preserves the values of unspecified parameters (as
 > documented,
 >  but not previously functioning)
 >- clear3d() can now reset material properties to the defaults, and
 >  open3d() does this.
 >- minor fix for gcc 4.3 compatibility
 >
 > Duncan Murdoch

__
R-help@stat.math.ethz.ch 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] rgl.postscript generating pdf: floating xlab, font size, transparency

2007-04-04 Thread Duncan Murdoch
On 4/4/2007 1:17 PM, Kim Milferstedt wrote:
> Hello,
> 
> I very much enjoy rgl! But when converting the screen output to pdf 
> using rgl.postscript I have encountered three problems:
> 
> (1) I don't seem to have control over font sizes and point sizes (of 
> added points) in the pdf output. I tried cex from "plot" but that 
> does not have an effect. Initially I got some plots where fonts and 
> especially points were far too small. But now I cannot reproduce this 
> any more and fonts and axis are way too thick. How do you control 
> font size, point size etc in the pdf output of rgl.postscript?

At the moment you don't, or you recompile from source with different 
choices.  This is on the todo list.

> (2) I could not figure out if it is possible to prevent the 
> expressions entered for xlab, ylab and zlab to float around in the 
> plot. I would like them aligned with the labeled axis if that's 
> possible. Can I do that with rgl?

I don't quite understand what you want (if you want them to be aligned 
with something that can move, don't they have to float around?), but at 
present text support is quite limited.  As part of the same effort as 
above this will eventually change for the better.

> (3) I would also like to add a transparent sphere to some plots. I 
> did this by adding the next two lines to a plot. However, by adding 
> rgl.material(), also my next plots have the new updated properties I 
> only intended for the sphere. How can I re-set the rgl.material to 
> their defaults or how can I assign properties only for one object?
> 
> rgl.material(alpha  = 0.2 )
>  spheres3d(0,0,0,1, col= "yellow")

The general rules are:

rgl.* functions may make long lasting changes to material properties 
(but most of them over-ride those, so you don't notice).

*3d functions preserve material properties.

The interaction of these two rules mean it's usually a bad idea to mix 
the two kinds of calls.  You can do what you want with

spheres3d(0,0,0,1, col= "yellow", alpha = 0.2)

and the alpha change will only last for the duration of the call.
> 
> I am working under Win XP with R 2.4.1 and the most current version of rgl.

You can get one slightly more current than the most current release from 
my web page, .  It has 
the following changes, which may impact you:

v0.70.570
   - changes to configure script from Laszlo Kajan and Brian Ripley: 
should
 now be much more portable
   - removed deprecated OSX font setting calls
   - texture properties are now returned by material3d()
   - allowed normals and texture coordinates to be specified in 
triangles and quads
   - normals may be specified in qmesh objects, but (at present) 
subdivide removes them
   - material3d() now preserves the values of unspecified parameters (as 
documented,
 but not previously functioning)
   - clear3d() can now reset material properties to the defaults, and
 open3d() does this.
   - minor fix for gcc 4.3 compatibility

Duncan Murdoch
> 
> Thanks,
> 
> Kim
> 
> ## Generating data-set
> X <- c(1:6)
> endpoint <- 4
> interval <- 1
> data.length <- 1200
> data.rep <- 10
> 
> R <- rep(seq(1,endpoint, by =interval),rep((data.length/3)/endpoint,endpoint))
> Q <- cbind(matrix(sample(X,data.length , replace = T), ncol = 3, byrow = T),R)
> 
> ## plotting using rgl
> symbol.col   <-  c("blue", "orange", "gold", "indianred")
> plot.lim  <- c(1, 6)
> plot3d( 0,
>  0,
>  0,
>  xlim = plot.lim,
>  ylim = plot.lim,
>  zlim = plot.lim,
>  type = "n",
>  xlab = "X-Axis",
>  ylab = "Y-Axis",
>  zlab = "Z-Axis",
>  )
> for (l in 1:endpoint)
>  {
>  points3d(   Q[,1][Q[,4] == l],
>  Q[,2][Q[,4] == l],
>  Q[,3][Q[,4] == l],
>  col = symbol.col[l],
>  size = 6)
>  }
> 
> rgl.postscript("D:/Kim/070402/test4.pdf", fmt="pdf" )
> 
> __
> 
> Kim Milferstedt
> University of Illinois at Urbana-Champaign
> Department of Civil and Environmental Engineering
> 4125 Newmark Civil Engineering Laboratory
> 205 North Mathews Avenue MC-250
> Urbana, IL 61801
> USA
> phone: (001) 217 333-9663
> fax: (001) 217 333-6968
> email: [EMAIL PROTECTED]
> http://cee.uiuc.edu/research/morgenroth
> 
> __
> R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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] Annotate a levelplot (using abline) - Difficulty with trellis.

2007-04-04 Thread Dan Bolser
On 04/04/07, Sundar Dorai-Raj <[EMAIL PROTECTED]> wrote:
>
>
> Dan Bolser said the following on 4/4/2007 7:52 AM:
> > My question was thus;
> >
> > Given
> >
> >   library(lattice)
> >   my.m <- matrix(seq(1,100,1),nrow=10)
> >   levelplot(my.m)
> >
> >
> > How can I add a diagonal line onto the resulting 'color square'?
> >
> > The answer I found was to hack the 'panel.levelplot' function. Here is the
> > diff between the old (panel.levplot) and the new (my.panel.levplot)
> > functions;
> >
> > ***
> > *** 72,77 
> > --- 82,89 
> > shrinky[2], fullZrange), default.units = "native",
> >   gp = gpar(fill = col.regions[zcol], lwd = 1e-05,
> > col = "transparent", alpha = alpha.regions))
> > + ## Added by Dan
> > + panel.abline(0,1,col="white")
> >   if (contour) {
> > if (is.logical(labels) && !labels)
> >   labels <- NULL
> >
> >
> > And then use...
> >
> >   library(lattice)
> >   my.m <- matrix(seq(1,100,1),nrow=10)
> >   levelplot(my.m, panel=my.panel.levelplot)
> >
> >
> > I accidentally started to talk to Charilaos Skiadas 'off-list', so thanks to
> > him for help.
> >
> > Dan.
> >
> >   [[alternative HTML version deleted]]
> >
> > __
> > R-help@stat.math.ethz.ch 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.
>
>
> Hi, Dan,
>
> This can be more easily done using the following:
>
> library(lattice)
> my.m <- matrix(seq(1, 100, 1), nrow = 10)
> my.panel.levelplot <- function(...) {
>panel.levelplot(...)
>panel.abline(0, 1, col = "white")
> }
> levelplot(my.m, panel = my.panel.levelplot)

Now why didn't that work until you suggested it?! ;-)

Thanks (everyone) again :-)





>
>
> HTH,
>
> --sundar
>

__
R-help@stat.math.ethz.ch 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 and bash script problem

2007-04-04 Thread Xavier Thibert
Hi,
   I have a problem with R package and bash.

   I have the package scatterplot3d installed and
working.

   I'm using bash as the command line interpretor.

   When I open R interactively I can load
scatterplot3d without problem and use it.

   When I create an R script it also works and execute
it interactively in bash it works
[EMAIL PROTECTED] DIR.3thTry_1]$ cat test.R
library(scatterplot3d)
[EMAIL PROTECTED] DIR.3thTry_1]$ R --no-save < test.R
...
> library(scatterplot3d)
>


   When I create a bash script that do the same thing
it doesn't work anymore
[EMAIL PROTECTED] DIR.3thTry_1]$ cat overviewInter.sh
#!/bin/bash
R --no-save < test.R
./overviewInter.sh
...
> library(scatterplot3d)
Error in library(scatterplot3d) : there is no package
called 'scatterplot3d'
Execution halted


More info on my setup:
Linux Fedora Core 4
AMD64 dual core
R version 2.4.1 (2006-12-18)
GNU bash, version 3.00.16(1)-release
(x86_64-redhat-linux-gnu)

Someone can help me?

Thanks

__
R-help@stat.math.ethz.ch 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] transition matrices

2007-04-04 Thread Ranjan Maitra
On Wed, 4 Apr 2007 07:46:37 -0500 Ranjan Maitra <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> It appears that you are trying to separate the states in the transition 
> matrix such that you have recurrent classes all next to each other. 

Sorry, I meant non-communicating classes. Btw, thinking about this some more, I 
think you can do this in a quick and dirty way: convert your transition 
probability matrix into 0 and 1 which is 0 if the entry is (+)ve. Then, make 
this into a distance matrix (using as.dist()), use hclust and single linkage 
and cut the tree at 1(?) to get the equivalence classes. The ordering of the 
tpm after this is easy. 

HTH,
Ranjan

> Here is an idea off the top of my head: make equivalence classes from your 
> statespace and then use that to create a block diagonal matrix. I did a 
> search on equivalence classes on RSiteSearch and came up with 17 articles> 
> You can take a look and see if any of these are useful.
> 
> http://search.r-project.org/cgi-bin/namazu.cgi?query=equivalence+classes&max=20&result=normal&sort=score&idxname=Rhelp02a&idxname=functions&idxname=docs
> 
> HTH,
> Ranjan
> 
> 
> On Wed, 04 Apr 2007 16:34:44 +1000 Richard Rowe <[EMAIL PROTECTED]> wrote:
> 
> > I am working with transition matrices of sequences of animal 
> > behaviours.  What I would like to do is parse the original matrices, 
> > adjusting row/column order so that the matrix has its main values in blocks 
> > surrounding the diagonal.  This would cause behaviours involved in 
> > functional groupings (e.g. grooming, resting, foraging etc) to appear as 
> > blocks.
> > This can be done manually by applying subjective 'prior knowledge' of 
> > sequences, however I would like to have an algorithmic/objective method to 
> > generate at least a first cut ...
> > Any suggestions or hints (even just thoughts) would be much appreciated,
> > 
> > Richard Rowe
> > 
> > Dr Richard Rowe
> > Zoology & Tropical Ecology
> > School of Tropical Biology
> > James Cook University
> > Townsville 4811
> > AUSTRALIA
> > 
> > ph +61 7 47 81 4851
> > fax +61 7 47 25 1570
> > JCU has CRICOS Provider Code 00117J
> > 
> > __
> > R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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] (sans objet)

2007-04-04 Thread Douglas Bates
On 4/4/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hello,
>
> Is there any function "argmax" in R ?
>
> For example, if I have the vector x=c(1,4,15,7,6), max(x)=15.
> But I need a function f such that f(x)=3, 3 being the number where 15 is.

which.max

__
R-help@stat.math.ethz.ch 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] Finding a single unique item in duplicated vectors

2007-04-04 Thread John Kane
Arrgh! I knew it going to be was blindingly obvious
once someone showed it to me.  I had even looked at
diff() at one point but never found setdiff.  ?sets
did not seem to find anything. 

Thanks very much.

--- "Charles C. Berry" <[EMAIL PROTECTED]> wrote:

> On Wed, 4 Apr 2007, John Kane wrote:
> 
> > I have a very simple problem and am completely
> missing
> > the solution.
> > I have two character variables (character ID's
> from
> > two datasets) Data set 'b'
> > is data set 'a' with one more subject added.
> > How do I find out which is the added subject?
> 
> 
>   setdiff( b, a ) ??
> 
> >
> > I have tried duplicated and unique without much
> > success.  I can find all the
> > duplicated ID's but how do I extract the new
> "unique"
> > one?
> > Example:
> > a  <-  as.character(Cs(b,d,c,a))
> > b  <- as.character( Cs(a,b,c,d,e))
> > h  <- c(a,b) ; h
> > h[duplicated(h)]
> >
> > I just want to extract that "e"!
> >
> > I had thought that
> > h[!duplicated(h)]
> > might work but it simply returns all the unique
> values
> > whereas
> > I simply want to simply find the odd man out.
> >
> > I thought of using sorting the vectors & using a
> cbind
> > but the id's are assigned
> > more or less randomly so that didn't work.
> >
> > Thanks
> >
> > __
> > R-help@stat.math.ethz.ch 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.
> >
> 
> Charles C. Berry(858)
> 534-2098
>   Dept of
> Family/Preventive Medicine
> E mailto:[EMAIL PROTECTED] UC San Diego
> http://biostat.ucsd.edu/~cberry/ La Jolla,
> San Diego 92093-0901
> 
> 
>

__
R-help@stat.math.ethz.ch 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] rgl.postscript generating pdf: floating xlab, font size, transparency

2007-04-04 Thread Kim Milferstedt
Hello,

I very much enjoy rgl! But when converting the screen output to pdf 
using rgl.postscript I have encountered three problems:

(1) I don't seem to have control over font sizes and point sizes (of 
added points) in the pdf output. I tried cex from "plot" but that 
does not have an effect. Initially I got some plots where fonts and 
especially points were far too small. But now I cannot reproduce this 
any more and fonts and axis are way too thick. How do you control 
font size, point size etc in the pdf output of rgl.postscript?
(2) I could not figure out if it is possible to prevent the 
expressions entered for xlab, ylab and zlab to float around in the 
plot. I would like them aligned with the labeled axis if that's 
possible. Can I do that with rgl?
(3) I would also like to add a transparent sphere to some plots. I 
did this by adding the next two lines to a plot. However, by adding 
rgl.material(), also my next plots have the new updated properties I 
only intended for the sphere. How can I re-set the rgl.material to 
their defaults or how can I assign properties only for one object?

rgl.material(alpha  = 0.2 )
 spheres3d(0,0,0,1, col= "yellow")

I am working under Win XP with R 2.4.1 and the most current version of rgl.

Thanks,

Kim

## Generating data-set
X <- c(1:6)
endpoint <- 4
interval <- 1
data.length <- 1200
data.rep <- 10

R <- rep(seq(1,endpoint, by =interval),rep((data.length/3)/endpoint,endpoint))
Q <- cbind(matrix(sample(X,data.length , replace = T), ncol = 3, byrow = T),R)

## plotting using rgl
symbol.col   <-  c("blue", "orange", "gold", "indianred")
plot.lim  <- c(1, 6)
plot3d( 0,
 0,
 0,
 xlim = plot.lim,
 ylim = plot.lim,
 zlim = plot.lim,
 type = "n",
 xlab = "X-Axis",
 ylab = "Y-Axis",
 zlab = "Z-Axis",
 )
for (l in 1:endpoint)
 {
 points3d(   Q[,1][Q[,4] == l],
 Q[,2][Q[,4] == l],
 Q[,3][Q[,4] == l],
 col = symbol.col[l],
 size = 6)
 }

rgl.postscript("D:/Kim/070402/test4.pdf", fmt="pdf" )

__

Kim Milferstedt
University of Illinois at Urbana-Champaign
Department of Civil and Environmental Engineering
4125 Newmark Civil Engineering Laboratory
205 North Mathews Avenue MC-250
Urbana, IL 61801
USA
phone: (001) 217 333-9663
fax: (001) 217 333-6968
email: [EMAIL PROTECTED]
http://cee.uiuc.edu/research/morgenroth

__
R-help@stat.math.ethz.ch 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] Finding a single unique item in duplicated vectors

2007-04-04 Thread John Kane

--- John Kane <[EMAIL PROTECTED]> wrote:

> I have a very simple problem and am completely
> missing
> the solution.
> I have two character variables (character ID's from
> two datasets) Data set 'b'
> is data set 'a' with one more subject added.
> How do I find out which is the added subject?
> 
> I have tried duplicated and unique without much
> success.  I can find all the
> duplicated ID's but how do I extract the new
> "unique"
> one?

Amended examaple ( I forgot I had Hmic loaded and was
using it.)
a  <-  as.character(c("b","d","c","a"))
b  <- as.character( Cs("a","b,"c","d","e"))
h  <- c(a,b) ; h
h[duplicated(h)]


> I just want to extract that "e"! 
> 
> I had thought that
> h[!duplicated(h)]
> might work but it simply returns all the unique
> values
> whereas
> I simply want to simply find the odd man out.
> 
> I thought of using sorting the vectors & using a
> cbind
> but the id's are assigned
> more or less randomly so that didn't work.
>  
>  Thanks
> 
> __
> R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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] Finding a single unique item in duplicated vectors

2007-04-04 Thread Charles C. Berry
On Wed, 4 Apr 2007, John Kane wrote:

> I have a very simple problem and am completely missing
> the solution.
> I have two character variables (character ID's from
> two datasets) Data set 'b'
> is data set 'a' with one more subject added.
> How do I find out which is the added subject?


setdiff( b, a ) ??

>
> I have tried duplicated and unique without much
> success.  I can find all the
> duplicated ID's but how do I extract the new "unique"
> one?
> Example:
> a  <-  as.character(Cs(b,d,c,a))
> b  <- as.character( Cs(a,b,c,d,e))
> h  <- c(a,b) ; h
> h[duplicated(h)]
>
> I just want to extract that "e"!
>
> I had thought that
> h[!duplicated(h)]
> might work but it simply returns all the unique values
> whereas
> I simply want to simply find the odd man out.
>
> I thought of using sorting the vectors & using a cbind
> but the id's are assigned
> more or less randomly so that didn't work.
>
> Thanks
>
> __
> R-help@stat.math.ethz.ch 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.
>

Charles C. Berry(858) 534-2098
  Dept of Family/Preventive Medicine
E mailto:[EMAIL PROTECTED]   UC San Diego
http://biostat.ucsd.edu/~cberry/ La Jolla, San Diego 92093-0901

__
R-help@stat.math.ethz.ch 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] Cannot install iWidgetsRGtk

2007-04-04 Thread Paul Smith
On 4/4/07, Michael Lawrence <[EMAIL PROTECTED]> wrote:
> iWidgetsRGtk is an obsolete package. Instead, install gWidgetsRGtk from
> CRAN. That's "g" not "i".

Thanks, Michael. That is solved now.

Paul


> On 4/4/07, Paul Smith <[EMAIL PROTECTED]> wrote:
> >
> > Dear All
> >
> > I am trying to install iWidgetsRGtk (on a Linux machine), but getting
> > the following error:
> >
> > >
> install.packages("iWidgetsRGtk",repos="http://www.math.csi.cuny.edu/pmg
> ")
> > Warning in download.packages(unique(pkgs), destdir = tmpd, available =
> > available,  :
> >  no package 'iWidgetsRGtk' at the repositories
> > >
> >
> > Any ideas?
> >
> > Thanks in advance,
> >
> > Paul
> >
> > __
> > R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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] Finding a single unique item in duplicated vectors

2007-04-04 Thread John Kane
I have a very simple problem and am completely missing
the solution.
I have two character variables (character ID's from
two datasets) Data set 'b'
is data set 'a' with one more subject added.
How do I find out which is the added subject?

I have tried duplicated and unique without much
success.  I can find all the
duplicated ID's but how do I extract the new "unique"
one?
Example:
a  <-  as.character(Cs(b,d,c,a))
b  <- as.character( Cs(a,b,c,d,e))
h  <- c(a,b) ; h
h[duplicated(h)]

I just want to extract that "e"! 

I had thought that
h[!duplicated(h)]
might work but it simply returns all the unique values
whereas
I simply want to simply find the odd man out.

I thought of using sorting the vectors & using a cbind
but the id's are assigned
more or less randomly so that didn't work.
 
 Thanks

__
R-help@stat.math.ethz.ch 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] Cannot install iWidgetsRGtk

2007-04-04 Thread Michael Lawrence
Hi,

iWidgetsRGtk is an obsolete package. Instead, install gWidgetsRGtk from
CRAN. That's "g" not "i".

Michael

On 4/4/07, Paul Smith <[EMAIL PROTECTED]> wrote:
>
> Dear All
>
> I am trying to install iWidgetsRGtk (on a Linux machine), but getting
> the following error:
>
> > install.packages("iWidgetsRGtk",repos="http://www.math.csi.cuny.edu/pmg
> ")
> Warning in download.packages(unique(pkgs), destdir = tmpd, available =
> available,  :
>  no package 'iWidgetsRGtk' at the repositories
> >
>
> Any ideas?
>
> Thanks in advance,
>
> Paul
>
> __
> R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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] gpclib library

2007-04-04 Thread Prof Brian Ripley
It's a _package_ that you are looking for (there is something else called 
a gpclib library, to do with GNU Pascal).

You haven't told us your OS or R version, so we don't know what file you 
are looking for.  But try another mirror if one appears not to work (and 
using a US mirror with an email address in Italy seems odd).

On Wed, 4 Apr 2007, Leonardo Lami wrote:

> Hi all,
> I'm tring to download the gpclib library but I don't find it in the old
> repository
>
> install.packages(c("gpclib"), dependencies=TRUE,
> repos="http://cran.cnr.berkeley.edu/";)
> Avviso in install.packages(c("gpclib"), dependencies = TRUE, repos =
> "http://cran.cnr.berkeley.edu/";) :
> argument 'lib' is missing: using /usr/local/lib/R/site-library

That's not what that message says: presumably you got some more output.

>
>
> May be my old library have some problem:
>
> library(gpclib)
> Errore in loadNamespace(package, c(which.lib.loc, lib.loc), keep.source
> = keep.source) :
>in 'gpclib', metodi da esportare specificati, ma nessuno
> definito: show, get.bbox, plot, intersect, union, setdiff, [,
> append.poly, scale.poly, area.poly, get.pts, coerce
> Errore: caricamento pacchetto/namespace fallito per 'gpclib'
>
> Someone knows where I can find the library
>
> Thank you
> Leonardo
>
> __
> R-help@stat.math.ethz.ch 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

__
R-help@stat.math.ethz.ch 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] selection of character

2007-04-04 Thread Julien Barnier
Another way, with regexps :

gsub(".*_", "", x)

HTH,

-- 
Julien

__
R-help@stat.math.ethz.ch 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] (sans objet)

2007-04-04 Thread croero
Hello,
 
Is there any function "argmax" in R ?
 
For example, if I have the vector x=c(1,4,15,7,6), max(x)=15.
But I need a function f such that f(x)=3, 3 being the number where 15 is.
 
Thank you very much.
 
_

ues clics pour retrouver tout ce qui vous intéresse au même endroit.

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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] Cannot install iWidgetsRGtk

2007-04-04 Thread Paul Smith
Dear All

I am trying to install iWidgetsRGtk (on a Linux machine), but getting
the following error:

> install.packages("iWidgetsRGtk",repos="http://www.math.csi.cuny.edu/pmg";)
Warning in download.packages(unique(pkgs), destdir = tmpd, available =
available,  :
 no package 'iWidgetsRGtk' at the repositories
>

Any ideas?

Thanks in advance,

Paul

__
R-help@stat.math.ethz.ch 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] transition matrices

2007-04-04 Thread Christos Hatzis
I think what you are looking for is also called seriation or ordination,
i.e. find the "best" enumeration order of a set of objects.

Take a look at the following link for more information and on criteria for
defining "best"

http://www.lirmm.fr/~caraux/PermutMatrix/EN/Seriation.htm

The link is for a windows application (PermutMatrix) that can perform
seriation on distance matrices used in hierarchical clustering, but might be
useful in your context as well.

-Christos

Christos Hatzis, Ph.D.
Nuvera Biosciences, Inc.
400 West Cummings Park
Suite 5350
Woburn, MA 01801
Tel: 781-938-3830
www.nuverabio.com
 
  

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Richard Rowe
> Sent: Wednesday, April 04, 2007 2:35 AM
> To: r-help@stat.math.ethz.ch
> Subject: [R] transition matrices
> 
> I am working with transition matrices of sequences of animal 
> behaviours.  What I would like to do is parse the original 
> matrices, adjusting row/column order so that the matrix has 
> its main values in blocks surrounding the diagonal.  This 
> would cause behaviours involved in functional groupings (e.g. 
> grooming, resting, foraging etc) to appear as blocks.
> This can be done manually by applying subjective 'prior 
> knowledge' of sequences, however I would like to have an 
> algorithmic/objective method to generate at least a first cut ...
> Any suggestions or hints (even just thoughts) would be much 
> appreciated,
> 
> Richard Rowe
> 
> Dr Richard Rowe
> Zoology & Tropical Ecology
> School of Tropical Biology
> James Cook University
> Townsville 4811
> AUSTRALIA
> 
> ph +61 7 47 81 4851
> fax +61 7 47 25 1570
> JCU has CRICOS Provider Code 00117J
> 
> __
> R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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] gpclib library

2007-04-04 Thread Leonardo Lami
Hi all,
I'm tring to download the gpclib library but I don't find it in the old
repository

install.packages(c("gpclib"), dependencies=TRUE,
repos="http://cran.cnr.berkeley.edu/";)
Avviso in install.packages(c("gpclib"), dependencies = TRUE, repos =
"http://cran.cnr.berkeley.edu/";) :
 argument 'lib' is missing: using /usr/local/lib/R/site-library


May be my old library have some problem:

library(gpclib)
Errore in loadNamespace(package, c(which.lib.loc, lib.loc), keep.source
= keep.source) :
in 'gpclib', metodi da esportare specificati, ma nessuno
definito: show, get.bbox, plot, intersect, union, setdiff, [,
append.poly, scale.poly, area.poly, get.pts, coerce
Errore: caricamento pacchetto/namespace fallito per 'gpclib'

Someone knows where I can find the library

Thank you
Leonardo

__
R-help@stat.math.ethz.ch 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] transition matrices

2007-04-04 Thread hadley wickham
Hi Richard,

You might want to have a look at Bertin's reorderable matrices, which
seem to be solving a similar problem.  Googling for bertin reorderable
matrix gives a few automatic implementations.

Hadley

On 4/4/07, Richard Rowe <[EMAIL PROTECTED]> wrote:
> I am working with transition matrices of sequences of animal
> behaviours.  What I would like to do is parse the original matrices,
> adjusting row/column order so that the matrix has its main values in blocks
> surrounding the diagonal.  This would cause behaviours involved in
> functional groupings (e.g. grooming, resting, foraging etc) to appear as
> blocks.
> This can be done manually by applying subjective 'prior knowledge' of
> sequences, however I would like to have an algorithmic/objective method to
> generate at least a first cut ...
> Any suggestions or hints (even just thoughts) would be much appreciated,
>
> Richard Rowe
>
> Dr Richard Rowe
> Zoology & Tropical Ecology
> School of Tropical Biology
> James Cook University
> Townsville 4811
> AUSTRALIA
>
> ph +61 7 47 81 4851
> fax +61 7 47 25 1570
> JCU has CRICOS Provider Code 00117J
>
> __
> R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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] argmax

2007-04-04 Thread Elio Mineo
which.max(x)

Il giorno mer, 04/04/2007 alle 15.13 +, [EMAIL PROTECTED] ha
scritto:
> Hello,
>  
> Is there any function that returns the argmax of a vector ?
>  
> For example I have the vector x=(1,4,15,6,7)
>  
> max(x)=15
>  
> I want a function f such that f(x)=3 because this is where max(x) is.
>  
> Thank your very much.
>  
> P.S. : I know it is a basic question but I have not figured it out by myself.
> _
> 
> ues clics pour retrouver tout ce qui vous intresse au mme endroit.
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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] pattern search

2007-04-04 Thread Julien Barnier
Hi,

> I'm looking for an easy possibility for pattern search. I have got a
> string and a special pattern. I would like to know if the pattern
> appears in the string, if yes where does it appear (position) and the
> number of appearance.  
> 
> Example:
> 
> Text = c("If the sun shines, no clouds should be seen in the sky!")
> SearchPattern = c("the")
> NumberOfAppearance = 0
> NumberOfLetters = 0
> 
> --> NumberOfAppearance should be 2 in the end

I think you are looking for the gregexpr function.

R> Text = c("If the sun shines, no clouds should be seen in the sky!")
R> gregexpr("the", Text)
[[1]]
[1]  4 48
attr(,"match.length")
[1] 3 3

> How can I get the string length (=number of letters stored in Text)?

Maybe the nchar funtion ?

R> nchar(Text)
[1] 55

HTH,

-- 
Julien

__
R-help@stat.math.ethz.ch 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] pattern search

2007-04-04 Thread Benilton Carvalho
how about:

length(gregexpr("the", Text)[[1]])

?

b

On Apr 4, 2007, at 10:49 AM, Schmitt, Corinna wrote:

> Dear R-experts,
>
> I'm looking for an easy possibility for pattern search. I have got a
> string and a special pattern. I would like to know if the pattern
> appears in the string, if yes where does it appear (position) and the
> number of appearance.
>
> Example:
>
> Text = c("If the sun shines, no clouds should be seen in the sky!")
> SearchPattern = c("the")
> NumberOfAppearance = 0
> NumberOfLetters = 0
>
> --> NumberOfAppearance should be 2 in the end
>
> How can I get the string length (=number of letters stored in Text)?
>
> Has anyone a good idea?
>
> Thanks, Corinna
>
> __
> R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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] Power analysis and mixed model

2007-04-04 Thread Jean G. Orelien


-Original Message-
From: Jean G. Orelien [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 04, 2007 11:22 AM
To: 'Julien'
Subject: RE: [R] Power analysis and mixed model



Julien,

You could write your Linear Mixed Model as a General Linear Multivariate
Model (GLMM) and use the power software develooped by Muller, Lavange, Ramey
and Ramey (JASA, 1992).  

The program is written is SAS IML. If you can't find it by "googling it",
let me know.

Jean Orelien
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Julien
Sent: Wednesday, April 04, 2007 10:40 AM
To: r-help@stat.math.ethz.ch
Subject: [R] Power analysis and mixed model

Hi 

Is there any way to compute power analysis for a mixed model ?

Julien

 

Julien Martin

Candidat au Doctorat

Laboratoire de Marco festa-Bianchet

Universiti de Sherbrooke

Sherbrooke, Quibec

J1K 2R1 Canada

819 821 8000 poste 62059

 


-- 



12:48
 

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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] argmax

2007-04-04 Thread Dimitris Rizopoulos
check ?which.max(), e.g.,

x <- c(1,4,15,6,7)
which.max(x)


Best,
Dimitris


Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
 http://www.student.kuleuven.be/~m0390867/dimitris.htm


- Original Message - 
From: <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, April 04, 2007 5:13 PM
Subject: [R] argmax


Hello,

Is there any function that returns the argmax of a vector ?

For example I have the vector x=(1,4,15,6,7)

max(x)=15

I want a function f such that f(x)=3 because this is where max(x) is.

Thank your very much.

P.S. : I know it is a basic question but I have not figured it out by 
myself.
_

ues clics pour retrouver tout ce qui vous intéresse au même endroit.

[[alternative HTML version deleted]]







> __
> R-help@stat.math.ethz.ch 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.
> 


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

__
R-help@stat.math.ethz.ch 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] argmax

2007-04-04 Thread Doran, Harold
x <- c(1,4,15,6,7)
which(x==max(x)) 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> [EMAIL PROTECTED]
> Sent: Wednesday, April 04, 2007 11:14 AM
> To: r-help@stat.math.ethz.ch
> Subject: [R] argmax
> 
> Hello,
>  
> Is there any function that returns the argmax of a vector ?
>  
> For example I have the vector x=(1,4,15,6,7)
>  
> max(x)=15
>  
> I want a function f such that f(x)=3 because this is where max(x) is.
>  
> Thank your very much.
>  
> P.S. : I know it is a basic question but I have not figured 
> it out by myself.
> _
> 
> ues clics pour retrouver tout ce qui vous intéresse au même endroit.
> 
>   [[alternative HTML version deleted]]
> 
>

__
R-help@stat.math.ethz.ch 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] gnomeGUI under KDE

2007-04-04 Thread Michael Lawrence
On 4/3/07, Luis Lopez Oliveros <[EMAIL PROTECTED]> wrote:
>
> Dear all,
>
> Recently, I installed the KDE desktop under my Linux system, but Included
> also the Gnome desktop (actually, I installed everything that comes in the
> openSUSE cd).
>
> My question about R is the following. I would like to run some kind of
> console under Linux.


If you really need a GUI (for most needs the text console works well), I
might recommend the "pmg" package. It is a GTK2-based GUI for R and probably
has more features than the Gnome GUI.

I was reading and first I found out that there is a
> GUI under gnome, just by typing the command line R -g gnome; however, to
> do this I need first to install the package gnomeGUI. Will this package
> still work under KDE. So far I have been able to run all GNOME
> applications under KDE, but I don't know about this one.
>
> Kindly regards,
>
> Luis LO
>
> __
> R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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] Annotate a levelplot (using abline) - Difficulty with trellis.

2007-04-04 Thread Sundar Dorai-Raj


Dan Bolser said the following on 4/4/2007 7:52 AM:
> My question was thus;
> 
> Given
> 
>   library(lattice)
>   my.m <- matrix(seq(1,100,1),nrow=10)
>   levelplot(my.m)
> 
> 
> How can I add a diagonal line onto the resulting 'color square'?
> 
> The answer I found was to hack the 'panel.levelplot' function. Here is the
> diff between the old (panel.levplot) and the new (my.panel.levplot)
> functions;
> 
> ***
> *** 72,77 
> --- 82,89 
> shrinky[2], fullZrange), default.units = "native",
>   gp = gpar(fill = col.regions[zcol], lwd = 1e-05,
> col = "transparent", alpha = alpha.regions))
> + ## Added by Dan
> + panel.abline(0,1,col="white")
>   if (contour) {
> if (is.logical(labels) && !labels)
>   labels <- NULL
> 
> 
> And then use...
> 
>   library(lattice)
>   my.m <- matrix(seq(1,100,1),nrow=10)
>   levelplot(my.m, panel=my.panel.levelplot)
> 
> 
> I accidentally started to talk to Charilaos Skiadas 'off-list', so thanks to
> him for help.
> 
> Dan.
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-help@stat.math.ethz.ch 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.


Hi, Dan,

This can be more easily done using the following:

library(lattice)
my.m <- matrix(seq(1, 100, 1), nrow = 10)
my.panel.levelplot <- function(...) {
   panel.levelplot(...)
   panel.abline(0, 1, col = "white")
}
levelplot(my.m, panel = my.panel.levelplot)


HTH,

--sundar

__
R-help@stat.math.ethz.ch 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] argmax

2007-04-04 Thread croero
Hello,
 
Is there any function that returns the argmax of a vector ?
 
For example I have the vector x=(1,4,15,6,7)
 
max(x)=15
 
I want a function f such that f(x)=3 because this is where max(x) is.
 
Thank your very much.
 
P.S. : I know it is a basic question but I have not figured it out by myself.
_

ues clics pour retrouver tout ce qui vous intéresse au même endroit.

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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] Power analysis and mixed model

2007-04-04 Thread Doran, Harold
One option is to use lmer in a monte carlo simulation. I just did this last 
week. Check out the article published in the American Statistician and can be 
found at http://maven.smith.edu/~nhorton/R/r.pdf.

The article is not about power per se, but is about R as a toolbox for 
mathematical statistics. But, it has a section illustrating how to do power 
calculations via simulation using the nlme package in R, which is the function 
for multilevel models. 

I simulate data for clustered designs differently than the authors and I also 
use lmer2() in the lme4 package and not nlme as it is much, much faster.

We needed to know how many clusters to have to obtain sufficient power. I ran 
power calculations for a decently complex model with cluster sizes of 10 to 200 
in increments of 10 (i.e., 10, 20, ..., 200) with 1000 iterations at each 
cluster size. This is a total of 20,000 iterations (20 * 1000) and took about 
1.5 hours on my desktop machine. 

There are power calculators, like Optim, but simulation gives you much more 
flexibility and the option to estimate power in situations where formulae do 
not exist.

Harold

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Julien
> Sent: Wednesday, April 04, 2007 10:40 AM
> To: r-help@stat.math.ethz.ch
> Subject: [R] Power analysis and mixed model
> 
> Hi 
> 
> Is there any way to compute power analysis for a mixed model ?
> 
> Julien
> 
>  
> 
> Julien Martin
> 
> Candidat au Doctorat
> 
> Laboratoire de Marco festa-Bianchet
> 
> Université de Sherbrooke
> 
> Sherbrooke, Québec
> 
> J1K 2R1 Canada
> 
> 819 821 8000 poste 62059
> 
>  
> 
> 
> -- 
> 
> Checked by AVG Free Edition.
> 
> 12:48
>  
> 
>   [[alternative HTML version deleted]]
> 
>

__
R-help@stat.math.ethz.ch 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] Annotate a levelplot (using abline) - Difficulty with trellis.

2007-04-04 Thread Dan Bolser
My question was thus;

Given

  library(lattice)
  my.m <- matrix(seq(1,100,1),nrow=10)
  levelplot(my.m)


How can I add a diagonal line onto the resulting 'color square'?

The answer I found was to hack the 'panel.levelplot' function. Here is the
diff between the old (panel.levplot) and the new (my.panel.levplot)
functions;

***
*** 72,77 
--- 82,89 
shrinky[2], fullZrange), default.units = "native",
  gp = gpar(fill = col.regions[zcol], lwd = 1e-05,
col = "transparent", alpha = alpha.regions))
+ ## Added by Dan
+ panel.abline(0,1,col="white")
  if (contour) {
if (is.logical(labels) && !labels)
  labels <- NULL


And then use...

  library(lattice)
  my.m <- matrix(seq(1,100,1),nrow=10)
  levelplot(my.m, panel=my.panel.levelplot)


I accidentally started to talk to Charilaos Skiadas 'off-list', so thanks to
him for help.

Dan.

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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] pattern search

2007-04-04 Thread Schmitt, Corinna
Dear R-experts,

I'm looking for an easy possibility for pattern search. I have got a
string and a special pattern. I would like to know if the pattern
appears in the string, if yes where does it appear (position) and the
number of appearance.  

Example:

Text = c("If the sun shines, no clouds should be seen in the sky!")
SearchPattern = c("the")
NumberOfAppearance = 0
NumberOfLetters = 0

--> NumberOfAppearance should be 2 in the end

How can I get the string length (=number of letters stored in Text)?

Has anyone a good idea?

Thanks, Corinna

__
R-help@stat.math.ethz.ch 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] Power analysis and mixed model

2007-04-04 Thread Julien
Hi 

Is there any way to compute power analysis for a mixed model ?

Julien

 

Julien Martin

Candidat au Doctorat

Laboratoire de Marco festa-Bianchet

Université de Sherbrooke

Sherbrooke, Québec

J1K 2R1 Canada

819 821 8000 poste 62059

 


-- 

Checked by AVG Free Edition.

12:48
 

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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] Problems loading package GeoXp

2007-04-04 Thread Carlos Guerra
Dear useR's,
I wanted to load the package GeoXP in my computer but I couldn't because 
this warning message appeared:

 > require(GeoXp)
Carregando pacotes exigidos: GeoXp
Carregando pacotes exigidos: tcltk
Loading Tcl/Tk interface ... Erro em fun(...) : couldn't connect to 
display ":0"
Além disso: Warning message:
pacote 'GeoXp' foi compilado na versão do R 2.4.1
Erro: .onLoad falhou em 'loadNamespace' para 'tcltk'
Erro: pacote 'tcltk' não pôde ser carregado

Can this package only be used under Windows??


-- 
Carlos GUERRA

Gabinete de Sistemas de Informacao Geografica
Escola Superior Agraria de Ponte de Lima
Mosteiro de Refoios do Lima
4990-706 Ponte de Lima

Tlm: +351 91 2407109
Tlf: +351 258 909779

Reclaim your Inbox...!!!
http://www.mozilla.org/products/thunderbird/

__
R-help@stat.math.ethz.ch 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] selection of character

2007-04-04 Thread Dimitris Rizopoulos
one way is the following:

x <- c("10_1", "1_1", "11_1", "2_1", "3_1", "4_1",
"5_1", "6_1", "7_1", "8_1")
#
sapply(strsplit(x, "_"), "[", 2)


I hope it helps.

Best,
Dimitris


Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
 http://www.student.kuleuven.be/~m0390867/dimitris.htm


- Original Message - 
From: "Leonardo Lami" <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, April 04, 2007 4:11 PM
Subject: [R] selection of character


> Hi all,
>
> I have a simple question:
> I have a character vector like this
>
> [1] "10_1" "1_1"  "11_1" "2_1"  "3_1"  "4_1"  "5_1"  "6_1"  "7_1" 
> "8_1"
> [11] "9_1"  "1_3"  "2_3"  "3_3"  "4_3"  "1_4"  "2_4"  "3_4"  "4_4" 
> "5_4"
> [21] "6_4"  "7_4"  "1_5"  "2_5"  "10_6" "11_6" "12_6" "1_6"  "2_6" 
> "3_6"
> [31] "4_6"  "5_6"  "6_6"  "7_6"  "8_6"  "9_6"  "1_7"  "1_8"  "2_8" 
> "3_8"
> [41] "10_9" "1_9"  "2_9"  "3_9"  "4_9"  "5_9"  "6_9"  "7_9"  "8_9" 
> "9_9"
> [43]  "1_10" "2_10"
>
> and I'd like to have a vector with only the value after the under 
> scor,
> like this:
>
> [1] "1" "1"  "1" "1"  "1"  "1"  "1"  "1"  "1"  "1"
> [11] "1"  "3"  "3"  "3"  "3"  "4"  "4"  "4"  "4"  "4"
> [21] "4"  "4"  "5"  "5"  "6" "6" "6" "6"  "6"  "6"
> [31] "6"  "6"  "6"  "6"  "6"  "6"  "7"  "8"  "8"  "8"
> [41] "9" "9"  "9"  "9"  "9"  "9"  "9"  "9"  "9"  "9"
> [43]  "10" "10"
>
> Is there a simple function to do this?
>
> Thank you for your help
> All the best
>
> Leonardo
>
> __
> R-help@stat.math.ethz.ch 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.
> 


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

__
R-help@stat.math.ethz.ch 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] selection of character

2007-04-04 Thread Leonardo Lami
Hi all,

I have a simple question:
I have a character vector like this

 [1] "10_1" "1_1"  "11_1" "2_1"  "3_1"  "4_1"  "5_1"  "6_1"  "7_1"  "8_1"
[11] "9_1"  "1_3"  "2_3"  "3_3"  "4_3"  "1_4"  "2_4"  "3_4"  "4_4"  "5_4"
[21] "6_4"  "7_4"  "1_5"  "2_5"  "10_6" "11_6" "12_6" "1_6"  "2_6"  "3_6"
[31] "4_6"  "5_6"  "6_6"  "7_6"  "8_6"  "9_6"  "1_7"  "1_8"  "2_8"  "3_8"
[41] "10_9" "1_9"  "2_9"  "3_9"  "4_9"  "5_9"  "6_9"  "7_9"  "8_9"  "9_9"
[43]  "1_10" "2_10"

and I'd like to have a vector with only the value after the under scor,
like this:

 [1] "1" "1"  "1" "1"  "1"  "1"  "1"  "1"  "1"  "1"
[11] "1"  "3"  "3"  "3"  "3"  "4"  "4"  "4"  "4"  "4"
[21] "4"  "4"  "5"  "5"  "6" "6" "6" "6"  "6"  "6"
[31] "6"  "6"  "6"  "6"  "6"  "6"  "7"  "8"  "8"  "8"
[41] "9" "9"  "9"  "9"  "9"  "9"  "9"  "9"  "9"  "9"
[43]  "10" "10"

Is there a simple function to do this?

Thank you for your help
All the best

Leonardo

__
R-help@stat.math.ethz.ch 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] REPLACE and REMOVE fns

2007-04-04 Thread Tina Robles

See attached...sorry

On 4/4/07, Uwe Ligges <[EMAIL PROTECTED]> wrote:



Tina Robles wrote:
> I want to use the replace function on "R_Jeter_04_post" (see attached)
> so that S=1, D=1, T=1, HR=1, O=0, K=0, E=0, FC=0, and W,IW,and HP are
> removed, so that i have a simple list of 1's and 0's.


There are just 0's and 1's in your attachment ...

Uwe Ligges



> I understand that I need to use the command "replace(x,list,values)"
> and "rm()" but I'm having trouble using them. (syntax errors and
> whatnot)
>
> Any help would be appreciated.
>
>
> 
>
> __
> R-help@stat.math.ethz.ch 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.




--
Tina Robles
[EMAIL PROTECTED]
305-710-5839
O
K
O
K
S
O
K
S
K
O
O
O
W
O
D
W
D
K
O
O
W
K
W
S
O
S
FC
K
O
O
S
O
O
W
O
K
S
W
HR
O
K
K
K
K
HR
HR
O
O
K
S
O
W
HP
O
O
D
O
W
K
W
W
O
S
O
O
K
S
HR
W
O
O




































































































































































































































































































































































































































































































































































































































































































__
R-help@stat.math.ethz.ch 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] GAM/GLM parameters

2007-04-04 Thread james155

I think this might be a very basic question, but is there a simple way to
characterise the relationships that a gam or lm model have identified? I am
trying the create species distribution models based on climate, and want to
know whether, for example, higher temperatures (one of the predictor
variables) leads to a higher probability of species presence (dependent
variable). Also, how can you quantify the relative contribution of each
predictor variable to the final model?

Many thanks,

 James
-- 
View this message in context: 
http://www.nabble.com/GAM-GLM-parameters-tf3525876.html#a9837219
Sent from the R help mailing list archive at Nabble.com.

__
R-help@stat.math.ethz.ch 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] the numimum number of fixed factors lme package can dealwith

2007-04-04 Thread Doran, Harold
As Doug noted yesterday, you may have a limit on the memory needed to
create the model matrix for the fixed effects. But, aside from that,
based on what I see below, it appears you have manually created a model
matrix yourself. If that's true, you don't need to do that. You can
create a single column and create a factor. R will then create a model
matrix for you. Of course, this won't help with the memory issue,
though.

We have no idea how much memory you have allocated to R, did you try
increasing this as described in the FAQs? 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Douglas Bates
> Sent: Wednesday, April 04, 2007 8:54 AM
> To: Fang, Yongxiang
> Cc: R-help
> Subject: Re: [R] the numimum number of fixed factors lme 
> package can dealwith
> 
> On 4/3/07, Fang, Yongxiang <[EMAIL PROTECTED]> wrote:
> > Dear Douglas,
> >
> > Thanks for your help.
> > the error message is:
> > 'Error in eval(expr, envir, enclos) : Object "dx.200" not found';
> >
> > In fact, dx is the design matrix and now in a data frame: dframe I 
> > have checked if dx.200 in dframe. dframe$dx.200 does exist 
> and in correct form.
> >
> > In addition, when the number of columns of dx is smaller 
> than 200, the lme runs no prolem.
> >
> > Cheers
> >
> > Yongxiang
> 
> Without a *reproducible* example we cannot be of any assistance.
> 
> > -Original Message-
> > From: [EMAIL PROTECTED] on behalf of Douglas Bates
> > Sent: Tue 4/3/2007 5:57 PM
> > To: Fang, Yongxiang
> > Cc: r-help@stat.math.ethz.ch
> > Subject: Re: [R] the numimum number of fixed factors lme 
> package can 
> > deal with
> >
> > On 4/3/07, Fang, Yongxiang <[EMAIL PROTECTED]> wrote:
> >
> > > In my study, mixed effects model is required and the 
> number of fixed 
> > > effects is very large. When lme package is employed, a 
> model error 
> > > is displayed once the number of fixed  factors in the formula 
> > > reaches 200. Is this the maximum number of fixed factors 
> can be handled by lme package?
> > > If not, what is possible reason of the error message?
> >
> > What error message?  You didn't tell use what you did and what 
> > happened.  Please read and follow the instructions in the posting 
> > guide - otherwise we will only be able to guess at what the problem 
> > may be.
> >
> > There is no specific limit of 200 fixed factors (perhaps 
> you mean 200 
> > columns in the model matrix for the fixed effects?) in lme. 
>  However 
> > there will be limits on the amount of memory available to store the 
> > model matrices and associated structures needed to fit the model.
> >
> > The first thing I would suggest is determining why you want 
> to fit a 
> > model with 200 (or possibly more if you really meant 200 fixed
> > factors) fixed effects.  It is rare to want to examine such a large 
> > number of coefficients.  Frequently the number of 
> coefficients gets to 
> > this order because you have a factor with a large number of 
> levels, in 
> > which case why not model such a factor with random effects?
> >
> > You could also try using the lmer function from the lme4 package 
> > instead of lme to fit a linear mixed model.  It is generally more 
> > efficient than lme in both time and storage.
> >
> > However, before we can help you much you will need to be much more 
> > specific in your question and provide us with the recommended 
> > background information.
> >
> >
> 
> __
> R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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] the numimum number of fixed factors lme package can deal with

2007-04-04 Thread Douglas Bates
On 4/3/07, Fang, Yongxiang <[EMAIL PROTECTED]> wrote:
> Dear Douglas,
>
> Thanks for your help.
> the error message is:
> 'Error in eval(expr, envir, enclos) : Object "dx.200" not found';
>
> In fact, dx is the design matrix and now in a data frame: dframe
> I have checked if dx.200 in dframe. dframe$dx.200 does exist and in correct 
> form.
>
> In addition, when the number of columns of dx is smaller than 200, the lme 
> runs no prolem.
>
> Cheers
>
> Yongxiang

Without a *reproducible* example we cannot be of any assistance.

> -Original Message-
> From: [EMAIL PROTECTED] on behalf of Douglas Bates
> Sent: Tue 4/3/2007 5:57 PM
> To: Fang, Yongxiang
> Cc: r-help@stat.math.ethz.ch
> Subject: Re: [R] the numimum number of fixed factors lme package can deal with
>
> On 4/3/07, Fang, Yongxiang <[EMAIL PROTECTED]> wrote:
>
> > In my study, mixed effects model is required and the number of fixed
> > effects is very large. When lme package is employed, a model error is
> > displayed once the number of fixed  factors in the formula reaches 200. Is
> > this the maximum number of fixed factors can be handled by lme package?
> > If not, what is possible reason of the error message?
>
> What error message?  You didn't tell use what you did and what
> happened.  Please read and follow the instructions in the posting
> guide - otherwise we will only be able to guess at what the problem
> may be.
>
> There is no specific limit of 200 fixed factors (perhaps you mean 200
> columns in the model matrix for the fixed effects?) in lme.  However
> there will be limits on the amount of memory available to store the
> model matrices and associated structures needed to fit the model.
>
> The first thing I would suggest is determining why you want to fit a
> model with 200 (or possibly more if you really meant 200 fixed
> factors) fixed effects.  It is rare to want to examine such a large
> number of coefficients.  Frequently the number of coefficients gets to
> this order because you have a factor with a large number of levels, in
> which case why not model such a factor with random effects?
>
> You could also try using the lmer function from the lme4 package
> instead of lme to fit a linear mixed model.  It is generally more
> efficient than lme in both time and storage.
>
> However, before we can help you much you will need to be much more
> specific in your question and provide us with the recommended
> background information.
>
>

__
R-help@stat.math.ethz.ch 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] transition matrices

2007-04-04 Thread Ranjan Maitra
Hi,

It appears that you are trying to separate the states in the transition matrix 
such that you have recurrent classes all next to each other. 

Here is an idea off the top of my head: make equivalence classes from your 
statespace and then use that to create a block diagonal matrix. I did a search 
on equivalence classes on RSiteSearch and came up with 17 articles> You can 
take a look and see if any of these are useful.

http://search.r-project.org/cgi-bin/namazu.cgi?query=equivalence+classes&max=20&result=normal&sort=score&idxname=Rhelp02a&idxname=functions&idxname=docs

HTH,
Ranjan


On Wed, 04 Apr 2007 16:34:44 +1000 Richard Rowe <[EMAIL PROTECTED]> wrote:

> I am working with transition matrices of sequences of animal 
> behaviours.  What I would like to do is parse the original matrices, 
> adjusting row/column order so that the matrix has its main values in blocks 
> surrounding the diagonal.  This would cause behaviours involved in 
> functional groupings (e.g. grooming, resting, foraging etc) to appear as 
> blocks.
> This can be done manually by applying subjective 'prior knowledge' of 
> sequences, however I would like to have an algorithmic/objective method to 
> generate at least a first cut ...
> Any suggestions or hints (even just thoughts) would be much appreciated,
> 
> Richard Rowe
> 
> Dr Richard Rowe
> Zoology & Tropical Ecology
> School of Tropical Biology
> James Cook University
> Townsville 4811
> AUSTRALIA
> 
> ph +61 7 47 81 4851
> fax +61 7 47 25 1570
> JCU has CRICOS Provider Code 00117J
> 
> __
> R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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] Info on SPATSTAT window and maps

2007-04-04 Thread Ranjan Maitra
And what does this have to do with the lead thread subject line "Transition 
Matrices"?

I guess the only way we can start enforcing thread discipline is to stop 
responding to threads that  hijack others?

Any thoughts?

Ranjan



On Wed, 4 Apr 2007 11:31:33 +0200 "Giuseppe Brundu" <[EMAIL PROTECTED]> wrote:

> I wonder if there is any tutorial explaining, step by step, how to convert a 
> (georeferenced) map boundary (from esri shape-file) into a Spatstat window, 
> for performing the analysis of marked point patterns surveyed inside that 
> map. Any help on the subject will be really appreciated.
> 
> Giuseppe Brundu
> 
> (University of Sassari, Italy)
> 
> __
> R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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] Reading user input

2007-04-04 Thread Charilaos Skiadas
I think the problem the OP may be having is that the code will not  
work if you put it in a document window in R and then tell R to  
"source the document". At least not with R.app in MacOSX. This is  
what happened when I did it:

 > source("/tmp/Rtmp0TQfA6/file10d63af1")
enter the number of groups: unlink("/tmp/Rtmp0TQfA6/file10d63af1")

Then the value of ANSWER is:

 > ANSWER
[1] "unlink(\"/tmp/Rtmp0TQfA6/file10d63af1\")"
 >

If instead you select the lines and select the "Execute" option, then  
it does the right thing. (These options appear under the Edit menu in  
R.app, don't know about other platforms).

On Apr 4, 2007, at 7:36 AM, jim holtman wrote:

> That is exactly what the code does.

Haris Skiadas
Department of Mathematics and Computer Science
Hanover College

__
R-help@stat.math.ethz.ch 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] Annotate a levelplot (using abline) - Difficulty with trellis.

2007-04-04 Thread Charilaos Skiadas
On Apr 4, 2007, at 7:19 AM, Dan Bolser wrote:

> Hi,
>
> I am generating a beautiful plot with the 'levelplot' function over my
> square matrix of data. In order to help visualise the data I would
> like to draw a diagonal line on the matrix. Because the plot is
> actually a trellis object, I am having difficulty working out how to
> do this. I have been reading around, but I don't see any easy solution
> to the problem. (Most of the docs I have found are not of the type
> 'how to do it' but more like 'how to grok it'). After spending 1+ hour
> reading and trying various things I figure its time to ask some people
> who know ;-)
>
> So far I have the following (which almost works!)...
>
> levelplot(
> our.data,
> plot.xy = (abline(0,1,col="white"))
> )

1) Please always provide a reproducible example.
2) Normal drawing commands, like abline, can't be used in trellis  
graphics, and vice versa.
3) Look into ?panel.functions, in particular panel.abline. My  
understanding is that this is how you customize a graph, providing  
your own panel function which calls other panel functions or direct  
grid drawing commands.

Hope this helps.

> However the coordinate system / plot area being used are clearly not
> those of the square matrix. I guess I should point out that the axes
> of 'our.data' (the row and column names of the square matrix) are
> ordered categories of the form;
>
> seq(2,9,0.5)
>
>
> Thanks for any help !
>
> Dan.

Haris Skiadas
Department of Mathematics and Computer Science
Hanover College

__
R-help@stat.math.ethz.ch 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] to findout maximized log likelihoods by using rlarg.fit (for several r order statistics)

2007-04-04 Thread rupos sujon
Dear R helpers,

I need to find out maximized log likelihoods,
parameters estimates and standard errors (in
parentheses) of r largest-order statistics model, with
different values of r by using the function rlarg.fit.
I want to specify required number of order statistics
to the model. I attached my data file with this
mail.please help me.

Ruposh
 



--- [EMAIL PROTECTED] wrote:

> Send R-help mailing list submissions to
>   r-help@stat.math.ethz.ch
> 
> To subscribe or unsubscribe via the World Wide Web,
> visit
>   https://stat.ethz.ch/mailman/listinfo/r-help
> or, via email, send a message with subject or body
> 'help' to
>   [EMAIL PROTECTED]
> 
> You can reach the person managing the list at
>   [EMAIL PROTECTED]
> 
> When replying, please edit your Subject line so it
> is more specific
> than "Re: Contents of R-help digest..."
> 
> 
> Today's Topics:
> 
>1. Re: bivariate interpolation (Adelchi Azzalini)
>2. Coding for contrasts in unbalanced designs
> (Guillaume Brutel)
>3. Re: substitute values (Mark Wardle)
>4. Odp:  converting a list to a data.frame (Petr
> PIKAL)
>5. Re: substitute values (Sergio Della Franca)
>6. the numimum number of fixed factors lme
> package can deal with
>   (Fang, Yongxiang)
>7. Re: converting a list to a data.frame (Mark
> Wardle)
>8. Re: Referencing function name from within
> function
>   ([EMAIL PROTECTED])
>9. Re: Referencing function name from within
> function (jim holtman)
>   10. Re: converting a list to a data.frame
> (Dimitris Rizopoulos)
>   11. help: protein class prediction in
> bioinformatics (Bing Xiong)
>   12. controling omitted category in factor()
> ([EMAIL PROTECTED])
>   13. approx with ties = 'ordered' (Vadim
> Ogranovich)
>   14. Re: Referencing function name from within
> function
>   (Prof Brian Ripley)
>   15. Re: converting a list to a data.frame (Stephen
> Tucker)
>   16. confine a dataframe with a polygon (temiz)
>   17. Re: controling omitted category in factor()
> (Prof Brian Ripley)
>   18. Re: Calculating DIC from MCMC output (Duncan
> Murdoch)
>   19. Coding for contrasts in unbalanced designs
> (Guillaume Brutel)
>   20. Re: Coding for contrasts in unbalanced designs
> (Peter Dalgaard)
>   21. two-way anova nested fix effects issues
> (Hufkens Koen)
>   22. Coding for contrasts in unbalanced designs
> (Guillaume Brutel)
>   23. Re: Referencing function name from within
> function
>   (Alberto Monteiro)
>   24. Strange labels on plot with dates (Henrik
> Andersson)
>   25. Re: Referencing function name from within
> function (Mark Wardle)
>   26. Re: Strange labels on plot with dates (Gabor
> Grothendieck)
>   27. Re: Strange labels on plot with dates (Henrik
> Andersson)
>   28. Re: Strange labels on plot with dates (Prof
> Brian Ripley)
>   29. Re: strange fisher.test result (Thomas Lumley)
>   30. which points within an ellipsoid? Sorting data
> in 3d
>   (Kim Milferstedt)
>   31. Re: confine a dataframe with a polygon (Roger
> Bivand)
>   32. Re: Generate a serie of new vars that
> correlate with existing
>   var (Greg Snow)
>   33. Re: which points within an ellipsoid? Sorting
> data in 3d
>   (Greg Snow)
>   34. Re: strange fisher.test result (Peter
> Dalgaard)
>   35. Re: Referencing function name from within
> function
>   ([EMAIL PROTECTED])
>   36. treenet (HelponR)
>   37. Re: Testing additive nonparametric model
> (Donal O'Neill)
>   38. Re: the numimum number of fixed factors lme
> package can deal
>   with (Douglas Bates)
>   39. Re: lmer, CHOLMOD warning: matrix not positive
> definite
>   (Douglas Bates)
>   40. Re: Coding for contrasts in unbalanced designs
> (Peter Dalgaard)
>   41. Testing random effect in logistic mixed model
> (Julien)
>   42. Re: treenet (Weiwei Shi)
>   43.  problems with residuals of an arima model
> (Katharina Vedovelli)
>   44. Re: lmer, CHOLMOD warning: matrix not positive
> definite
>   (Seyed Reza Jafarzadeh)
>   45. Re: Generate a serie of new vars that
> correlate with existing
>   var (Nguyen Dinh Nguyen)
>   46. Optimization and simulation (Jin Huang)
>   47. REPLACE and REMOVE fns (Tina Robles)
>   48. Re: (Newbie)Basic Basic global vs. local
> variables (projection83)
>   49. Re: Reading user input (projection83)
>   50. Newbie: Simple loops: complex troubles
> (projection83)
>   51. gnomeGUI under KDE (Luis Lopez Oliveros)
>   52. Re: HPDinterval problem (Seyed Reza
> Jafarzadeh)
>   53. Re: converting a list to a data.frame (Patrick
> Connolly)
>   54. time zone problems (Marc Fischer)
>   55. Re: Reading user input (Petr Klasterecky)
>   56. Re: Newbie: Simple loops: complex troubles
> (Petr Klasterecky)
>   57. Re: gnomeGUI under KDE (Prof Brian Ripley)
>   58. Re: confine a dataframe with a polygon (temiz)
>   59. Re: HPDinterval problem (Seyed Reza
> Jafarzadeh)
>   60. transition matrices (Richard Rowe)
>   61. Re: REPLACE and REMOVE fns (Uwe Ligges)
>   62. Re: time zone problems 

Re: [R] Newbie: Simple loops: complex troubles

2007-04-04 Thread jim holtman
One of the things about R that you have to learn is vector operations.  You
try to avoid loops and also 'generating' variables -- this is where a list
comes in very handy.  To relate to Java, it is similar to 'struct'.  Here is
a program that does what you want to do;  it uses lists and vectorized
operations.

# generate some test data
m <- seq(5, 30, length=10)  # means
v <- m / 4  # variance
n <- 50   # samples
# use list for the data
ans <- lapply(seq_along(m), function(x) rnorm(n, m[x], v[x]))
# convert to integer
ansInt <- lapply(ans, as.integer)
# sort
ansSort <- lapply(ansInt, sort)
# show the results
ansSort



On 4/3/07, projection83 <[EMAIL PROTECTED]> wrote:
>
>
> I am used to java (well, i dont remember it really well, but anyway)
>
> I have having a really difficult time making simple loops to work. I got
> the
> following to work:
>
> ##
>##Creates objects Ux1, Ux2, Ux2 etc. that  all contain n numbers in
> a
> random distribution
>##
>m<-c(m1,m2,m3,m4,m5,m6,m7,m8,m9,m10)#these are defined as numbers
> (means)
>v<-c(v1,v2,v3,v4,v5,v6,v7,v8,v9,v10)#these are defined as numbers
> (variances)
>n<-50
>for(k in 1:g)
>{
>assign( paste("Ux", k, sep=""), rnorm( n  ,
> assign(paste("m",1,sep=""),m[k])   ,   assign(paste("m",1,sep=""),v[k])  )
> )
>}
>
>
> The above seems like a lot of work for such a simple feat, no?
>
> Also, I CANNot get the following to work in a loop manor:
>
>Ux1i<-as.integer(Ux1)
>Ux2i<-as.integer(Ux2)
>Ux3i<-as.integer(Ux3)
>
> or
>
>Sx1<-sort(Ux1i)
>Sx2<-sort(Ux2i)
>Sx3<-sort(Ux3i)
>
> Maybe I am just not using matrixes enough? but even that seems quite a lot
> more complex than calling x<-matrix() then grabbing values by
> x[j][k]...(java style if i remember correctly). the matrix help in R dosnt
> make much sense to me. And also i am not sure why numeric() dosnt make you
> define length before you use it, yet matrix() does.  Is there some other
> funciton that i should be using to make length not an issue?
>
>
> All in all, I dont know if i am going about this loop stuff a rely
> round
> about way - Any help would make me much less loopy:Pthanks
>
>
>
> --
> View this message in context:
> http://www.nabble.com/Newbie%3A-Simple-loops%3A-complex-troubles-tf3523751.html#a9830574
> Sent from the R help mailing list archive at Nabble.com.
>
> __
> R-help@stat.math.ethz.ch 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.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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] Reading user input

2007-04-04 Thread jim holtman
That is exactly what the code does.

On 4/3/07, projection83 <[EMAIL PROTECTED]> wrote:
>
>
> I dont know if thats what i want (its not working like i want).  I would
> like
> to have R pause, wait for a user input of a number, then store that number
> as a variable to use in the next calculation it does...
> Or should the below do that?
>
>
> jim holtman wrote:
> >
> > what you want is:
> >
> > defineSamples<- function()
> >{
> >  readline("enter the number of groups: ")
> >}
> >
> > ANSWER <- defineSamples()
> >
> >
> >
> > On 4/1/07, projection83 <[EMAIL PROTECTED]> wrote:
> >>
> >>
> >> Hi there, this is a very easy question, i just cant seem to find a
> >> straight
> >> answer- i need this one thing, then i can finish my project for this
> >> term.
> >>
> >> I am making an interactive application with R where I get the user to
> >> input
> >> numbers that the program then uses in the analysis.  I have figured out
> a
> >> lot of stuff, yet this is somehow hard to find the answer to:
> >> #--
> >> defineSamples<- function()
> >>{
> >>  ANSWER<-numeric()
> >>  ANSWER<-readline("enter the number of groups: ")
> >>}
> >>
> >> runit()
> >>
> >> ANSWER # this does not hold the value the user inputs
> >> #-
> >>
> >> If I then see what ANSWER is storing it says "numeric(0)", how do I get
> >> this
> >> to store whatever number the user inputs (and am i going to have to
> >> convert
> >> from a string to a number???
> >>
> >> THANKs for any help!
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Reading-user-input-tf3503016.html#a9783275
> >> Sent from the R help mailing list archive at Nabble.com.
> >>
> >> __
> >> R-help@stat.math.ethz.ch 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.
> >>
> >
> >
> >
> > --
> > Jim Holtman
> > Cincinnati, OH
> > +1 513 646 9390
> >
> > What is the problem you are trying to solve?
> >
> >   [[alternative HTML version deleted]]
> >
> > __
> > R-help@stat.math.ethz.ch 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 this message in context:
> http://www.nabble.com/Reading-user-input-tf3503016.html#a9830512
> Sent from the R help mailing list archive at Nabble.com.
>
> __
> R-help@stat.math.ethz.ch 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.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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 mtrace (malloc debugging) help

2007-04-04 Thread Prof Brian Ripley
On Wed, 4 Apr 2007, $|-|@r@|) wrote:

> Hi all,
>
> I am using "mtrace" malloc debugging utility to trace memory leaks in my
> application.
>
> I followed following steps:
>
> 1. Added mtrace() function in the beginning of my main function.
> 2. exported the MALLOC_TRACE environment variable.
>$ export MALLOC_TRACE=memory.log
> 3. Run the program
> 4. trace the program for memory leaks.
>$ mtrace  $MALLOC_TRACE
>
> But In 3rd step above, my system is hanging.
>
> Could anybody please help me to come out of this problem.
>
> If anybody have another solution for finding out memory leaks, then it is
> always welcome.

Most of us use valgrind, including on R itself.  It does much more.

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

__
R-help@stat.math.ethz.ch 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] Info on SPATSTAT window and maps

2007-04-04 Thread Roger Bivand
On Wed, 4 Apr 2007, Giuseppe Brundu wrote:

> I wonder if there is any tutorial explaining, step by step, how to convert a 
> (georeferenced) map boundary (from esri shape-file) into a Spatstat window, 
> for performing the analysis of marked point patterns surveyed inside that 
> map. Any help on the subject will be really appreciated.

Doing RSiteSearch("shapefile owin") shows that this is possible. The 
current route is:

library(spatstat)
library(maptools)
your_sp <- readShapePoly("your.shp")
your_sp1 <- as(your_sp, "SpatialPolygons")
your_owin <- as(your_sp1, "owin")
plot(your_owin)
pp <- runifpoint(500, your_owin) 

but you may need extra steps, for example to merge polygons or to remove
small polygon artefacts. Other functions in maptools would let you create
a ppp object from a SpatialPointsDataFrame, if you need that too.

You might also consider looking at the R-sig-Geo list for questions of 
this kind.

> 
> Giuseppe Brundu
> 
> (University of Sassari, Italy)
> 
> __
> R-help@stat.math.ethz.ch 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.
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: [EMAIL PROTECTED]

__
R-help@stat.math.ethz.ch 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] Annotate a levelplot (using abline) - Difficulty with trellis.

2007-04-04 Thread Dan Bolser
Hi,

I am generating a beautiful plot with the 'levelplot' function over my
square matrix of data. In order to help visualise the data I would
like to draw a diagonal line on the matrix. Because the plot is
actually a trellis object, I am having difficulty working out how to
do this. I have been reading around, but I don't see any easy solution
to the problem. (Most of the docs I have found are not of the type
'how to do it' but more like 'how to grok it'). After spending 1+ hour
reading and trying various things I figure its time to ask some people
who know ;-)

So far I have the following (which almost works!)...

levelplot(
our.data,
plot.xy = (abline(0,1,col="white"))
)

However the coordinate system / plot area being used are clearly not
those of the square matrix. I guess I should point out that the axes
of 'our.data' (the row and column names of the square matrix) are
ordered categories of the form;

seq(2,9,0.5)


Thanks for any help !

Dan.

__
R-help@stat.math.ethz.ch 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] Info on SPATSTAT window and maps

2007-04-04 Thread Giuseppe Brundu
I wonder if there is any tutorial explaining, step by step, how to convert a 
(georeferenced) map boundary (from esri shape-file) into a Spatstat window, 
for performing the analysis of marked point patterns surveyed inside that 
map. Any help on the subject will be really appreciated.

Giuseppe Brundu

(University of Sassari, Italy)

__
R-help@stat.math.ethz.ch 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] gnomeGUI under KDE

2007-04-04 Thread R Gott
I use the Kate editor (FC6, KDE, R 2.4.1) whihc allows me to pipe
commands to a console window with a key binding.  Works well.

Richard

On Wed, 2007-04-04 at 00:19 -0400, Luis Lopez Oliveros wrote:
> Dear all,
> 
> Recently, I installed the KDE desktop under my Linux system, but Included
> also the Gnome desktop (actually, I installed everything that comes in the
> openSUSE cd).
> 
> My question about R is the following. I would like to run some kind of
> console under Linux. I was reading and first I found out that there is a
> GUI under gnome, just by typing the command line R -g gnome; however, to
> do this I need first to install the package gnomeGUI. Will this package
> still work under KDE. So far I have been able to run all GNOME
> applications under KDE, but I don't know about this one.
> 
> Kindly regards,
> 
> Luis LO
> 
> __
> R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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 with R library

2007-04-04 Thread Uwe Ligges


bisous wrote:
> When I installed RSRuby (Ruby interface to the R programming language), an
> error occured : cannot find the R library. I defined Rlibrary : R\library in
> PATH on Windows but it didn't work with the same error. RSRuby ask R to
> permit the option 'shared library' but when I install R, it didn't ask me
> for this option. I want to ask you how to share le library in R? And when I
> can find the library ? I didn't find none file .dll for library needed.


It means R.dll which is a shared library and lives in R\bin which is the 
folder you need to specify in your PATH variable.

Uwe Ligges

__
R-help@stat.math.ethz.ch 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] Silhouette width using K-means

2007-04-04 Thread RK
Hello,
I am doing clustering and I want to know how can i find  Silhouette width
using K-means. Just like PAM (code below).
(2) Secondly, I have mixed data all sort of variables numeric, categorical,
nominals so I first change to all nominal to binary and
normlise the data before any clustering. Is there any other elegant way of
doing this?
(3) another question how to normlise and change to binary (filters) in R?

Thank you in Advance.

ravi

Examples(PAM)

## Use the silhouette widths for assessing the best number of clusters,
## following a one-dimensional example from Christian Hennig :
##
x <- c(rnorm(50), rnorm(50,mean=5), rnorm(30,mean=15))
asw <- numeric(20)
## Note that "k=1" won't work!
for (k in 2:20)
  asw[k] <- pam(x, k) $ silinfo $ avg.width
k.best <- which.max(asw)
cat("silhouette-optimal number of clusters:", k.best, "\n")

plot(1:20, asw, type= "h", main = "pam() clustering assessment",
 xlab= "k  (# clusters)", ylab = "average silhouette width")
axis(1, k.best, paste("best",k.best,sep="\n"), col = "red", col.axis =
"red")

~~

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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] Need mtrace (malloc debugging) help

2007-04-04 Thread $|-|@r@|)
Hi all,

I am using "mtrace" malloc debugging utility to trace memory leaks in my
application.

I followed following steps:

1. Added mtrace() function in the beginning of my main function.
2. exported the MALLOC_TRACE environment variable.
$ export MALLOC_TRACE=memory.log
3. Run the program
4. trace the program for memory leaks.
$ mtrace  $MALLOC_TRACE

But In 3rd step above, my system is hanging.

Could anybody please help me to come out of this problem.

If anybody have another solution for finding out memory leaks, then it is
always welcome.


Thanks & Regards,

Sharad.

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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] Problem with R library

2007-04-04 Thread bisous

When I installed RSRuby (Ruby interface to the R programming language), an
error occured : cannot find the R library. I defined Rlibrary : R\library in
PATH on Windows but it didn't work with the same error. RSRuby ask R to
permit the option 'shared library' but when I install R, it didn't ask me
for this option. I want to ask you how to share le library in R? And when I
can find the library ? I didn't find none file .dll for library needed.
-- 
View this message in context: 
http://www.nabble.com/Problem-with-R-library-tf3524571.html#a9833176
Sent from the R help mailing list archive at Nabble.com.

__
R-help@stat.math.ethz.ch 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] Testing additive nonparametric model

2007-04-04 Thread Simon Wood
I'd use mgcv::gam to fit a 2D smooth, rather than loess, and then do an 
*approximate* likelihood ratio/ F test. For example

library(mgcv)
## fake some data
set.seed(0)
n<-400;sig2<-4
x0 <- runif(n, 0, 1);x2 <- runif(n, 0, 1)
f <- 2 * sin(pi * x0)
f <- f + 0.2 * x2^11 * (10 * (1 - x2))^6 + 10 * (10 * x2)^3 * (1 - x2)^10
e <- rnorm(n, 0, sqrt(abs(sig2)))
y <- f + e
## now fit models and compare... 
b0 <- gam(y~s(x0)+s(x2)) ### fit additive model
b1 <- gam(y~te(x0,x2,k=10)) ### fit interaction model
anova(b0,b1,test="F")

The above uses a scale invariant tensor product smooth as the bivariate 
smooth. To get something more like loess, you could rescale your predictors 
into the unit square, say, and then use something like `y~s(x0,x2,k=100)' but 
in that case you sacrifice proper nesting of the models.

There's more information in e.g. section 5.2 of my book (see ?gam for ref.)

Another alternative would be to use Chong Gu's `gss' package which is set up 
to do `smoothing spline anova' modelling: this is quite a natural way to 
address your problem 

best,
Simon

On Tuesday 03 April 2007 09:36, Donal O'Neill wrote:
> I have estimated a multiple nonparametric regression using the loess
> command in R. I have also estimated an additive version of the model using
> the gam function. Is there a way of using the output of these two models to
> test the restrictions imposed by the additive model?
>
> __
> R-help@stat.math.ethz.ch 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.

-- 
> Simon Wood, Mathematical Sciences, University of Bath, Bath, BA2 7AY UK
> +44 1225 386603  www.maths.bath.ac.uk/~sw283

__
R-help@stat.math.ethz.ch 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] time zone problems

2007-04-04 Thread Stephen Tucker
Hi Marc,

This R Help Desk article was very helpful for me:

http://cran.r-project.org/doc/Rnews/Rnews_2004-1.pdf
Gabor Grothendieck and Thomas Petzoldt

And Gabor noted subsequent changes in behavior of POSIXt classes since the
aforementioned R News publication:

(1) http://tolstoy.newcastle.edu.au/R/e2/help/07/04/13626.html
(2) http://tolstoy.newcastle.edu.au/R/e2/help/07/04/13632.html

Basically, strptime() converts your character object to an POSIXlt object,
which may have a tzone attribute but it is ignored by everything- so you have
to convert it to POSIXct by as.POSIXct(format(myDateTimeObject),"GMT"). But
plot() will still try to make your figures according to system time ("").

Here are two possible solutions (if all of your work is in GMT):

1.
Sys.putenv(TZ = "GMT")
## your work
## (shouldn't have to use tzone.err)
Sys.putenv(TZ = "") 

2.
Use 'chron' objects as suggested in the R newsletter. This object class does
not include any time-zone information, so simplifies things.

Best regards,

ST


--- Marc Fischer <[EMAIL PROTECTED]> wrote:

> Folks,
> 
> I'm having  trouble with how datetime objects with time zones are set 
> and plotted.   This may be the result of my running R (2.4.0) on a 
> Windoze XP box.  Perhaps not.  Here are two example problems I need 
> advise on if you have time:
> 
> 1)  I collect data with dates (often as a fractional day of year) in 
> UTC.  Using strptime to create date time objects appears to force the 
> data into the local time zone (including daylight time) of my 
> machine.  Setting the tz="UTC" or "GMT" inside strptime seems to be 
> ignored.  I made the following cumbersome work around:
> 
> foo$date=strptime((paste(yr,DOY), 0, 0), format="%Y %j %H %M",tz="") + 0
>
tzone.err=as.numeric(as.POSIXct(format(Sys.time(),tz="GMT"))-as.POSIXct(format(Sys.time(),tz="")))*3600
> foo$date=foo$date-tzone.err
> attributes(foo$date)$tzone="GMT"
> 
> Am I missing something obvious or is this a problem with Windoze?
> 
> 2) Once I have the data in GMT, I try to plot it using the standard 
> plot command but it converts the data back to local time before 
> making the plot.  Now the work around is:
> 
> plot(foo$date+tzone.err,foo$var, xlab="Date(GMT)")
> 
>   Very frustrating... I've read the help pages but can't find answers 
> to these issues.  Any help?
> 
> Best regards,
> 
> Marc
> 
> __
> R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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] REPLACE and REMOVE fns

2007-04-04 Thread Uwe Ligges


Tina Robles wrote:
> I want to use the replace function on "R_Jeter_04_post" (see attached)
> so that S=1, D=1, T=1, HR=1, O=0, K=0, E=0, FC=0, and W,IW,and HP are
> removed, so that i have a simple list of 1's and 0's.


There are just 0's and 1's in your attachment ...

Uwe Ligges



> I understand that I need to use the command "replace(x,list,values)"
> and "rm()" but I'm having trouble using them. (syntax errors and
> whatnot)
> 
> Any help would be appreciated.
> 
> 
> 
> 
> __
> R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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] transition matrices

2007-04-04 Thread Richard Rowe
I am working with transition matrices of sequences of animal 
behaviours.  What I would like to do is parse the original matrices, 
adjusting row/column order so that the matrix has its main values in blocks 
surrounding the diagonal.  This would cause behaviours involved in 
functional groupings (e.g. grooming, resting, foraging etc) to appear as 
blocks.
This can be done manually by applying subjective 'prior knowledge' of 
sequences, however I would like to have an algorithmic/objective method to 
generate at least a first cut ...
Any suggestions or hints (even just thoughts) would be much appreciated,

Richard Rowe

Dr Richard Rowe
Zoology & Tropical Ecology
School of Tropical Biology
James Cook University
Townsville 4811
AUSTRALIA

ph +61 7 47 81 4851
fax +61 7 47 25 1570
JCU has CRICOS Provider Code 00117J

__
R-help@stat.math.ethz.ch 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] HPDinterval problem

2007-04-04 Thread Seyed Reza Jafarzadeh
Hi,

Sorry for multiple postings. Please consider the following reproducible example:


> grp1 <- rep(1:24, times = 24, each = 1)
> grp2 <- rep(1:12, times = 2, each = 24)
> set.seed(1)
> out <- as.integer(abs(rnorm(576))*10)
> x1 <- out [25:552]
> x2 <- out [49:576]
> mydf <- data.frame(cbind(out[1:528], x1, x2, grp1[49:576], grp2[49:576]))
> names(mydf) <- c("out", "x1", "x2", "grp1", "grp2")

> me1 <- lmer(out ~ x1 + x2 + (x1 | grp1) + (x2 | grp2), data = mydf, family = 
> quasipoisson)

> me1
Generalized linear mixed model fit using Laplace
Formula: out ~ x1 + x2 + (x1 | grp1) + (x2 | grp2)
   Data: mydf
 Family: quasipoisson(log link)
  AIC  BIC logLik deviance
 2559 2598  -1271 2541
Random effects:
 Groups   NameVariance  Std.Dev. Corr
 grp1 (Intercept) 0.3250162 0.570102
  x1  0.0021856 0.046750 -0.813
 grp2 (Intercept) 0.3183619 0.564236
  x2  0.0038276 0.061868 -0.940
 Residual 4.3279637 2.080376
number of obs: 528, groups: grp1, 24; grp2, 12

Fixed effects:
 Estimate Std. Error t value
(Intercept)  2.036473   0.212687   9.575
x1  -0.001159   0.011234  -0.103
x2  -0.006830   0.018860  -0.362

Correlation of Fixed Effects:
   (Intr) x1
x1 -0.487
x2 -0.751  0.007

> HPDinterval(mcmcsamp(me1, 2))
 lowerupper
(Intercept)2.036472792  2.036472792
x1-0.001158922 -0.001158922
x2-0.006830165 -0.006830165
log(grp1.(In))-3.254548062 -2.052213965
log(grp1.x1)  -8.351051505 -7.149742494
atanh(gr1.(I).x1) -1.630982865 -0.783008788
log(grp2.(In))-3.312492769 -1.509030356
log(grp2.x2)  -7.739344906 -5.926156515
atanh(gr2.(I).x2) -2.564511232 -1.291401604
attr(,"Probability")
[1] 0.95


Thanks,
Reza



On 4/3/07, Seyed Reza Jafarzadeh <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am providing more examples where HPDinterval failed. It seems to be
> working OK for (generalized linear mixed) models without crossed
> random-effects (m1.17, m1.18, m1.19, m1.20, m1.21, m1.22, and m1.24
> below).
>
> Thank you,
> Reza
>
>
> > m1.1 <- lmer(o ~ pv1o + pv2o + pv1toa + pv2toa + sesblf + (1 | prov) + (1 | 
> > pm), data = mydata[1:1392, ], family = quasipoisson)
> > HPDinterval(mcmcsamp(m1.1, n = 1))
>   lowerupper
> (Intercept)-0.207561922 -0.207561922
> pv1o0.056574609  0.056574609
> pv2o0.023042057  0.023042057
> pv1toa  0.026497315  0.026497315
> pv2toa -0.001074887 -0.001074887
> sesblf2 0.307805373  0.307805373
> sesblf3 0.067866694  0.067866694
> sesblf4 0.232652035  0.232652035
> log(prov.(In)) -1.948540913 -0.815550437
> log(pm.(In))   -4.609549269 -3.008113214
> attr(,"Probability")
> [1] 0.95
>
>
> > m1.3 <- lmer(o ~ pv1o + pv2o + pv1toa + pv2toa + sesblf + (pv1toa | prov) + 
> > (1 | pm), data = mydata[1:1392, ], family = quasipoisson)
> > HPDinterval(mcmcsamp(m1.3, n = 1))
>lower upper
> (Intercept)-0.3854582560 -0.3854582560
> pv1o0.0545945359  0.0545945359
> pv2o0.0266911717  0.0266911717
> pv1toa  0.0369314516  0.0369314516
> pv2toa -0.0008906397 -0.0008906397
> sesblf2 0.3326814534  0.3326814534
> sesblf3 0.1012759194  0.1012759194
> sesblf4 0.1968001587  0.1968001587
> log(prov.(In)) -1.2423994216 -0.0463231047
> log(prov.pv1t) -8.5013756480 -7.3008649434
> atanh(prv.(I).pv1) -1.3266358579 -0.4613822430
> log(pm.(In))   -4.5813293741 -2.9416249086
> attr(,"Probability")
> [1] 0.95
>
>
> > m1.5 <- lmer(o ~ pv1o + pv2o + pv1toa + pv2toa + sesblf + (1 | prov) + 
> > (pv1toa | pm), data = mydata[1:1392, ], family = quasipoisson)
> > HPDinterval(mcmcsamp(m1.5, n = 1))
>  lowerupper
> (Intercept)   -0.298634101 -0.298634101
> pv1o   0.056017516  0.056017516
> pv2o   0.021658991  0.021658991
> pv1toa 0.028086682  0.028086682
> pv2toa 0.003447681  0.003447681
> sesblf20.413727463  0.413727463
> sesblf30.046766676  0.046766676
> sesblf40.255977008  0.255977008
> log(prov.(In))-1.875689638 -0.751072995
> log(pm.(In))  -3.556592560 -1.722182602
> log(pm.pv1t)  -9.709527247 -7.885488338
> atanh(pm.(I).pv1) -1.901663364 -0.616765080
> attr(,"Probability")
> [1] 0.95
>
>
> > m1.7 <- lmer(o ~ pv1o + pv2o + pv1toa + pv2toa + sesblf + (pv1toa | prov) + 
> > (pv1o | pm), data = mydata[1:1392, ], family = quasipoisson)
> > HPDinterval(mcmcsamp(m1.7, n = 1))
>   lowerupper
> (Intercept)-0.389923132 -0.389923132
> pv1o0.063098026  0.063098026
> pv2o0.034944761  0.034944761
> pv1toa  0.032622126  0.032622126
> pv2toa  0.003154919  0.003154919
> sesblf2 0.300371141