[R] basic question

2003-02-04 Thread Archaux Frederic
Dear R users,

Up to now, I only used precompiled packages. As I am working on vegetation
ecology, I would be interested in using a package not stored by CRAN called
labdsv_0.9-1.tar.gz and developped by Dave Roberts at the National Center
for Ecological Analysis and Synthesis (unfortunately I did not find any
corresponding .zip file).

Although I tried to follow the proposed guidelines  to install such a file
in R, I did not succeed. I installed the library tools, the Perl and the
MinGW softwares, but I feel all this stuff is useless in my case (my
knowledge in informatic in so poor that I am reduced to intuitions!)

I know this is probably one of the most FAQ, but I did not find the answer
to my problem on the R-CRAN web site. Thank you in advance!

Have a good day. 

Frédéric Archaux (PhD, Engineer)

Biodiversity and Forest Management Team
CEMAGREF
Domaine des Barres
F-45290 Nogent-sur-Vernisson
FRANCE


[[alternate HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



Re: [R] basic question

2003-02-04 Thread Ko-Kang Kevin Wang
Hi,

From your description I am guessing you're using Windows.

What you may need is to compile this package from source.  It is explained
in one of the R manuals (I can't remember which one though).

You can also look at my R Guide for Windows Users at
http://www.stat.auckland.ac.nz/~kwan022/rinfo.php (Section 5).

I'm not sure the exact contents in the labdsv_0.9-1.tar.gz , but in general
you can first unpack it with, e.g.:
   tar zxvf labdsv_0.9-1.tar.gz
 then you may need:
   Rcmd labdsv_0.9-1

Hope this helps,

Kevin


Ko-Kang Kevin Wang
Master of Science (MSc) Student
Department of Statistics
University of Auckland
New Zealand
www.stat.auckland.ac.nz/~kwan022

- Original Message -
From: Archaux Frederic [EMAIL PROTECTED]
To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
Sent: Tuesday, February 04, 2003 9:46 PM
Subject: [R] basic question


Dear R users,

Up to now, I only used precompiled packages. As I am working on vegetation
ecology, I would be interested in using a package not stored by CRAN called
labdsv_0.9-1.tar.gz and developped by Dave Roberts at the National Center
for Ecological Analysis and Synthesis (unfortunately I did not find any
corresponding .zip file).

Although I tried to follow the proposed guidelines  to install such a file
in R, I did not succeed. I installed the library tools, the Perl and the
MinGW softwares, but I feel all this stuff is useless in my case (my
knowledge in informatic in so poor that I am reduced to intuitions!)

I know this is probably one of the most FAQ, but I did not find the answer
to my problem on the R-CRAN web site. Thank you in advance!

Have a good day.

Frédéric Archaux (PhD, Engineer)

Biodiversity and Forest Management Team
CEMAGREF
Domaine des Barres
F-45290 Nogent-sur-Vernisson
FRANCE


[[alternate HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



Re: [R] basic question

2003-02-04 Thread Jari Oksanen
On Tue, 2003-02-04 at 10:46, Archaux Frederic wrote:

 Up to now, I only used precompiled packages. As I am working on vegetation
 ecology, I would be interested in using a package not stored by CRAN called
 labdsv_0.9-1.tar.gz and developped by Dave Roberts at the National Center
 for Ecological Analysis and Synthesis (unfortunately I did not find any
 corresponding .zip file).
 
 Although I tried to follow the proposed guidelines  to install such a file
 in R, I did not succeed. I installed the library tools, the Perl and the
 MinGW softwares, but I feel all this stuff is useless in my case (my
 knowledge in informatic in so poor that I am reduced to intuitions!)
 
 I know this is probably one of the most FAQ, but I did not find the answer
 to my problem on the R-CRAN web site. Thank you in advance!

Frédéric, 

Dave Roberts is not yet quite finished up with his package -- it is
labelled as a zero version for a reason. He wrote to me that it won't
compile in Windows yet, for an unknown reason. He said that he got to
edit the FORTRAN files to compile them in Windows (they work in Linux).
However, he had still some other problems and so you got to dyn.load the
resulting dll into R, which, but in Dave's words That concept is
completely foreign to windows people of course, so it's pretty much
useless. 

It may be that you have to wait until Dave Roberts lectures on these
methods again, since then he may have to finish up the package.

cheers, jari oksanen
-- 
Jari Oksanen -- Dept Biology, Univ Oulu, 90014 Oulu, Finland
Ph. +358 8 5531526, cell +358 40 5136529, fax +358 8 5531061
email [EMAIL PROTECTED], homepage http://cc.oulu.fi/~jarioksa/

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



Re: [R] basic question

2003-02-04 Thread ripley
On Tue, 4 Feb 2003, Ko-Kang Kevin Wang wrote:

 From your description I am guessing you're using Windows.
 
 What you may need is to compile this package from source.  It is explained
 in one of the R manuals (I can't remember which one though).

The file README.packages in the Windows distribution, if on Windows.

 You can also look at my R Guide for Windows Users at
 http://www.stat.auckland.ac.nz/~kwan022/rinfo.php (Section 5).
 
 I'm not sure the exact contents in the labdsv_0.9-1.tar.gz , but in general
 you can first unpack it with, e.g.:
tar zxvf labdsv_0.9-1.tar.gz
  then you may need:
Rcmd labdsv_0.9-1

Rcmd INSTALL labdsv_0.9-1.tar.gz

is all that is needed.

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

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



Re: [R] [Out off-topic] SJava under Windows

2003-02-04 Thread Heinz Grimm
Philippe,

I didn't use JDK 1.4 (and R1.6.2) yet, but may be I can help
you anyway:

- Did you add the directory that holds the jvm.dll to
  your PATH?

- If you take a look to the source of .JavaInit() ($R_HOME/
  library/SJava/R/SJava), there is a line:
pathSeparator - ifelse(version$os == Win32, ;, :) 
  this should be:
pathSeparator - ifelse(version$os == mingw32, ;, :)
  All versions of R that I know of, return mingw32 for version$os.

Best regards,
Heinz Grimm
begin:vcard 
n:Grimm;Heinz
tel;fax:+41 61 9715 072
tel;work:+41 61 9751 109
x-mozilla-html:FALSE
url:www.rcc.ch
org:RCC Ltd.;IT
version:2.1
email;internet:[EMAIL PROTECTED]
title:Dipl.Ing.(FH)
adr;quoted-printable:;;Zelgliweg 1=0D=0A;Itingen;BL;CH-4452;Switzerland
fn:Heinz Grimm
end:vcard


This e-mail transmission contains confidential or legally privileged
information that is intended for the addressee(s) only. You are hereby
notified that any disclosure, copying, distribution or use of the
contents of this e-mail is strictly prohibited if you are not the
intended recipient. Please inform the sender and delete the message from
your system if you have received this e-mail transmission in error.
Thank you.



[R] test for two samples

2003-02-04 Thread Rado Bonk
Hi R-users,

My question is more methodological one, rather than technical.

I have to samples representing residuals based on two measurements 
techniques (resid1,resid2; n=69). I need to compare two samples, to 
reject one technique (the worse one), and to keep the one which gave 
lower residuals (better one). What to look for? What should I analyse? 
Means, variance, std. deviations?

Based on preliminary EDA:

mean_resid1  mean_resid2	#I would reject resid2 technique
stdev_resid1  stdev_resid2	#I would reject resid1 technique
var_resid1  var_resid2		#I would reject resid1 technique

Based on means I would reject resid2 technique, but based on analyses of 
stdev. and variance I would reject resid1 technique.

How to deal with that problem? What is proper statist. atrribute to look 
for? Should I use t.test()?

Best regards,

Rado Bonk

--
Radoslav Bonk M.S.
Dept. of Physical Geography and Geoecology
Faculty of Sciences, Comenius University
Mlynska Dolina 842 15, Bratislava, SLOVAKIA
tel: +421 905 968 127 e-mail: [EMAIL PROTECTED]

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] downloaf.file

2003-02-04 Thread Adelchi Azzalini

Dear List-members,

to download a file from the net, the function download.file(..)
does the job.  However, before embarking on the download, I would
like to find out how large the file is.  Is there a way to know it?

Most easily, this question has been asked before, but I am new to 
the list.

Regards, with thanks in advance,

Adelchi Azzalini


Adelchi Azzalini  [EMAIL PROTECTED]
Dipart.Scienze Statistiche, Università di Padova, Italia
http://azzalini.stat.unipd.it/

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



Re: [R] downloaf.file

2003-02-04 Thread ripley
Essentially no.  Most servers will give you the length if you start the 
download, and then R prints it out, but it may be unknown.  As in
 update.packages()
trying URL `http://cran.r-project.org/src/contrib/PACKAGES'
Content type `text/plain; charset=iso-8859-1' length 95407 bytes
opened URL
.. .. .. .. ..
.. .. .. .. ...
downloaded 93Kb

and you can (probably) interrupt during those dots.

On Tue, 4 Feb 2003, Adelchi Azzalini wrote:

 to download a file from the net, the function download.file(..)
 does the job.  However, before embarking on the download, I would
 like to find out how large the file is.  Is there a way to know it?
 
 Most easily, this question has been asked before, but I am new to 
 the list.

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

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



RE: [R] [Out off-topic] SJava under Windows

2003-02-04 Thread Philippe Grosjean
For those who are interested, I posted a Windows compiled version of SJava
0.64 that works with R 1.6.2 and JDK 1.4 on ftp.sciviews.org, under
/Download/Rwindows/.


Thanks Simon, Heinz and Brian for helping me getting this running version.
When compiling SJava 0.64 under Windows (R 1.6.2, JDK 1.4.0-02, Win XP),
line 286 of $R_HOME/library/SJava/R/SJava has to be changed from:

   pathSeparator - ifelse(version$os == Win32, ;, :)

to

   pathSeparator - ifelse(.Platform$OS.type == windows, ;, :)

in order to work in R 1.6.2. Of course, the path to jvm.dll must also be
added to the path environment variable. With my installation, it is:

c:\progra~1\Java\j2re1.4.0_02\bin\Client


Best regards,

Philippe Grosjean

...](({?...?}))...
 ) ) ) ) )
( ( ( ( (   Dr. Philippe Grosjean
 ) ) ) ) )
( ( ( ( (   LOV, UMR 7093
 ) ) ) ) )  Station Zoologique
( ( ( ( (   Observatoire Oceanologique
 ) ) ) ) )  BP 28
( ( ( ( (   06234 Villefranche sur mer cedex
 ) ) ) ) )  France
( ( ( ( (
 ) ) ) ) )  tel: +33.4.93.76.38.16, fax: +33.4.93.76.38.34
( ( ( ( (
 ) ) ) ) )  e-mail: [EMAIL PROTECTED]
( ( ( ( (   SciViews project coordinator (http://www.sciviews.org)
 ) ) ) ) )
...

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



[R] Background color of plot

2003-02-04 Thread Patricia Maforte dos Santos

I'm using the parameters mfrow and mfg to display some graphics(plots)
at the same time. Although, because of the parameter mfg, the parameter
bg don´t change the background color.

What can I do to solve this?


Here is the code I'm using...

...
 i - 1
 for(j in 1:4){
 for(k in 1:2){
 limiares - tabLimiar(arrayMetricas[,i])
 op - par(mfrow=c(4,2),pty=s)
 par(mfg=c(j,k))
 
plot(limiares,main=a[i],ylab=frequencia,xlab=limiares,bg=white,col=green,col.main=seagreen,type=b)
 box(which=figure,lty=solid,col=white)
 par(op)
 i - i+1
 if(i == ncol(arrayMetricas))
break
 }
 }
...


Patricia.

--
Patrícia Maforte dos Santos
Centro de Informatica
Universidade Federal de Pernambuco
Recife/PE - Brasil
--

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



Re: [R] downloaf.file

2003-02-04 Thread Barry Rowlingson


to download a file from the net, the function download.file(..)
does the job.  However, before embarking on the download, I would
like to find out how large the file is.  Is there a way to know it?



 You can send web servers a 'HEAD' request, which can give you some 
basic information about the download. I cant see a way to get this from 
the current R functions, so here's a little routine to leverage the 
'lynx' web browser:


head.download -
  function (url)
{
  if (system(lynx -help  /dev/null) == 0) {
method - lynx
  }
  else {
stop(No lynx found)
  }
  if (method == lynx) {
heads - system(paste(lynx -head -dump ', url,', sep = 
),intern=T)
  }

# turn name: value lines into named list. prob vectorisable

  ret - list(status=heads[1])
  for(l in 2:length(heads)){
col - regexpr(:,heads[l])
if(col-1){
  name - substr(heads[l],1,(col-1))
  value - substr(heads[l],(col+1),nchar(heads[l]))
  ret[[name]] - value
}else{
  ret - c(ret,heads[l])
}
  }
  ret
}

 this borrows bits from download.file(), but it does depend on you 
having lynx installed. The return value is a list with names 
corresponding to the header titles and values being the values. It looks 
for a : as the title: value separator, and anything that doesnt have a : 
is just added verbatim unnamed.

 For example, how big is the R logo on the home page?

 head.download(http://www.r-project.org/Rlogo.jpg;)$Content-Length
[1]  8793

 That's bytes. Yes I know its character! I dont think web servers are 
under any obligation to provide accurate Content-length values. Many 
dynamic web servers have pages that change length every time. This will 
also not for for ftp:// URLs or local file:// URLs (or gopher:// URLs?).

 Perhaps HEAD-getting functionality can be put in the next release of 
R? It would probably have a better name: value - named list routine 
than the one I just hacked up in two minutes above. Oops. Shame.

Baz

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] downloaf.file

2003-02-04 Thread Thomas Lumley
On Tue, 4 Feb 2003, Barry Rowlingson wrote:

   That's bytes. Yes I know its character! I dont think web servers are
 under any obligation to provide accurate Content-length values. Many
 dynamic web servers have pages that change length every time. This will
 also not for for ftp:// URLs or local file:// URLs (or gopher:// URLs?).


The HTTP protocol says that a content length SHOULD be provided and MUST
be accurate if it is provided.

-thomas

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



[R] SORTING Arrays by index value

2003-02-04 Thread Mark G Orr
Hello, I'm somewhat new to R.  I've searched the archive for the last year
and tried to consult the manual pages for the following problem, but did
not find an answer.

I want to sort an array by the index values.  Here is the array

acc.gp.bl.wtmn
Gp17   Gp4
1  0.5703125 0.6406250
10 0.7812500 0.7109375
11 0.8046875 0.7343750
12 0.8359375 0.7890625
13 0.8515625 0.7109375
14 0.8281250 0.7343750
15 0.8671875 0.7812500
16 0.8125000 0.7578125
17 0.7734375 0.750
18 0.800 0.780
19 0.870 0.730
2  0.8046875 0.7265625
20 0.830 0.740
21 0.750 0.800
22 0.770 0.760
23 0.820 0.780
24 0.760 0.740
25 0.810 0.800
3  0.7578125 0.7812500
4  0.8203125 0.7890625
5  0.7890625 0.7421875
6  0.7265625 0.7812500
7  0.8125000 0.7421875
8  0.8515625 0.7265625
9  0.8203125 0.6953125

My question is:  How do I sort by the first index (the values are 1:25)
without losing the associated values per index value for the two
columns(Gp17 and Gp4).  I want ascending order (1:25) of the index values.

Thank you in advance.

-Mark Orr



Postdoctoral Fellow
Psychology Dept.
Carnegie Mellon Univ.
Pittsburgh, PA 15213

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



Re: [R] downloaf.file

2003-02-04 Thread ripley
On Tue, 4 Feb 2003, Thomas Lumley wrote:

 On Tue, 4 Feb 2003, Barry Rowlingson wrote:
 
That's bytes. Yes I know its character! I dont think web servers are
  under any obligation to provide accurate Content-length values. Many
  dynamic web servers have pages that change length every time. This will
  also not for for ftp:// URLs or local file:// URLs (or gopher:// URLs?).
 
 
 The HTTP protocol says that a content length SHOULD be provided and MUST
 be accurate if it is provided.

Most proxies of my acquaintance will report unknown unless they are asked
to actually get the file or have it already cached.  Further, the IE 
internals used under Windows with --internet2 usually seems to get the 
wrong length (far too short) when talking to a proxy.

Why is this of interest: there are lots of internet download tools 
available apart from R?

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

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



Re: [R] SORTING Arrays by index value

2003-02-04 Thread ripley
acc.gp.bl.wtmn[sort.list(row.names(acc.gp.bl.wtmn)), ]

I am not clear how you missed order/sort.list, which have examples like 
this.  It's referenced off ?sort.  Indeed, sort() can be used too.

On Tue, 4 Feb 2003, Mark G Orr wrote:

 Hello, I'm somewhat new to R.  I've searched the archive for the last year
 and tried to consult the manual pages for the following problem, but did
 not find an answer.
 
 I want to sort an array by the index values.  Here is the array
 
 acc.gp.bl.wtmn
 Gp17   Gp4
 1  0.5703125 0.6406250
 10 0.7812500 0.7109375
 11 0.8046875 0.7343750
 12 0.8359375 0.7890625
 13 0.8515625 0.7109375
 14 0.8281250 0.7343750
 15 0.8671875 0.7812500
 16 0.8125000 0.7578125
 17 0.7734375 0.750
 18 0.800 0.780
 19 0.870 0.730
 2  0.8046875 0.7265625
 20 0.830 0.740
 21 0.750 0.800
 22 0.770 0.760
 23 0.820 0.780
 24 0.760 0.740
 25 0.810 0.800
 3  0.7578125 0.7812500
 4  0.8203125 0.7890625
 5  0.7890625 0.7421875
 6  0.7265625 0.7812500
 7  0.8125000 0.7421875
 8  0.8515625 0.7265625
 9  0.8203125 0.6953125
 
 My question is:  How do I sort by the first index (the values are 1:25)
 without losing the associated values per index value for the two
 columns(Gp17 and Gp4).  I want ascending order (1:25) of the index values.

I think the `first column' is the row names.

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

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



Re: [R] test for two samples

2003-02-04 Thread kjetil brinchmann halvorsen
On 4 Feb 2003 at 15:27, Rado Bonk wrote:

You should really give more details, i.e. which model
did you fit? If it is a linear model with intercept, the residuals
theoretically have sum zero, and for a non-linear model the
sum should be close to zero. Comparing means of residuals
doesn't seem to make much sense.

Kjetil Halvorsen

 Hi R-users,
 
 My question is more methodological one, rather than technical.
 
 I have to samples representing residuals based on two measurements 
 techniques (resid1,resid2; n=69). I need to compare two samples, to 
 reject one technique (the worse one), and to keep the one which gave 
 lower residuals (better one). What to look for? What should I analyse? 
 Means, variance, std. deviations?
 
 Based on preliminary EDA:
 
 mean_resid1  mean_resid2 #I would reject resid2 technique
 stdev_resid1  stdev_resid2   #I would reject resid1 technique
 var_resid1  var_resid2   #I would reject resid1 technique
 
 Based on means I would reject resid2 technique, but based on analyses of 
 stdev. and variance I would reject resid1 technique.
 
 How to deal with that problem? What is proper statist. atrribute to look 
 for? Should I use t.test()?
 
 Best regards,
 
 Rado Bonk
 
 -- 
 Radoslav Bonk M.S.
 Dept. of Physical Geography and Geoecology
 Faculty of Sciences, Comenius University
 Mlynska Dolina 842 15, Bratislava, SLOVAKIA
 tel: +421 905 968 127 e-mail: [EMAIL PROTECTED]
 
 __
 [EMAIL PROTECTED] mailing list
 http://www.stat.math.ethz.ch/mailman/listinfo/r-help

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



Re: [R] SORTING Arrays by index value

2003-02-04 Thread Thomas Lumley
On Tue, 4 Feb 2003, Mark G Orr wrote:

 My question is:  How do I sort by the first index (the values are 1:25)
 without losing the associated values per index value for the two
 columns(Gp17 and Gp4).  I want ascending order (1:25) of the index values.


order()

-thomas

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



Re: [R] SORTING Arrays by index value

2003-02-04 Thread Jonathan Baron
On 02/04/03 11:46, Mark G Orr wrote:
Hello, I'm somewhat new to R.  I've searched the archive for the last year
and tried to consult the manual pages for the following problem, but did
not find an answer.

I want to sort an array by the index values.  Here is the array

Looks like a matrix (which is, I guess, a type of array).

To sort by the first column, try

acc.gp.bl.wtmn[order(acc.gp.bl.wtmn[,1],]

acc.gp.bl.wtmn
Gp17   Gp4
1  0.5703125 0.6406250
10 0.7812500 0.7109375
11 0.8046875 0.7343750
12 0.8359375 0.7890625
13 0.8515625 0.7109375
14 0.8281250 0.7343750
15 0.8671875 0.7812500
16 0.8125000 0.7578125
17 0.7734375 0.750
18 0.800 0.780
19 0.870 0.730
2  0.8046875 0.7265625
20 0.830 0.740
21 0.750 0.800
22 0.770 0.760
23 0.820 0.780
24 0.760 0.740
25 0.810 0.800
3  0.7578125 0.7812500
4  0.8203125 0.7890625
5  0.7890625 0.7421875
6  0.7265625 0.7812500
7  0.8125000 0.7421875
8  0.8515625 0.7265625
9  0.8203125 0.6953125

My question is:  How do I sort by the first index (the values are 1:25)
without losing the associated values per index value for the two
columns(Gp17 and Gp4).  I want ascending order (1:25) of the index values.

Thank you in advance.

-Mark Orr



Postdoctoral Fellow
Psychology Dept.
Carnegie Mellon Univ.
Pittsburgh, PA 15213

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help

-- 
Jonathan Baron, Professor of Psychology, University of Pennsylvania
R page:   http://finzi.psych.upenn.edu/

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



Re: [R] SORTING Arrays by index value

2003-02-04 Thread Tony Plate
This should do it:

 acc.gp.bl.wtmn[order(as.numeric(row.names(acc.gp.bl.wtmn))),]

(This is not completely straightforward because in a dataframe, row names 
are almost always stored as character vectors, which means that you need to 
convert the row names to numeric values before calling order())

-- Tony Plate

At Tuesday 11:46 AM 2/4/2003 -0500, Mark G Orr wrote:
Hello, I'm somewhat new to R.  I've searched the archive for the last year
and tried to consult the manual pages for the following problem, but did
not find an answer.

I want to sort an array by the index values.  Here is the array

acc.gp.bl.wtmn
Gp17   Gp4
1  0.5703125 0.6406250
10 0.7812500 0.7109375
11 0.8046875 0.7343750
12 0.8359375 0.7890625
13 0.8515625 0.7109375
14 0.8281250 0.7343750
15 0.8671875 0.7812500
16 0.8125000 0.7578125
17 0.7734375 0.750
18 0.800 0.780
19 0.870 0.730
2  0.8046875 0.7265625
20 0.830 0.740
21 0.750 0.800
22 0.770 0.760
23 0.820 0.780
24 0.760 0.740
25 0.810 0.800
3  0.7578125 0.7812500
4  0.8203125 0.7890625
5  0.7890625 0.7421875
6  0.7265625 0.7812500
7  0.8125000 0.7421875
8  0.8515625 0.7265625
9  0.8203125 0.6953125

My question is:  How do I sort by the first index (the values are 1:25)
without losing the associated values per index value for the two
columns(Gp17 and Gp4).  I want ascending order (1:25) of the index values.

Thank you in advance.

-Mark Orr



Postdoctoral Fellow
Psychology Dept.
Carnegie Mellon Univ.
Pittsburgh, PA 15213

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help


__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



[R] forecast

2003-02-04 Thread Luis Silva
Dear helpers

I have a 55 observations of a time series that I want to make 
predictions 17 steps ahead. I read that it is possible to use 
neural networks to do that. How can I do that with R?

Luis
--
Kit SAPO.ADSL.PT Apenas 50 €.
Adira já em http://www.sapo.pt/kitadsl

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



[R] UltraEdit syntax highlighting

2003-02-04 Thread Jason Fisher
Hello everyone...

I was curious if anyone had an UltraEdit (syntax highlighting) wordfile for 
R.  The UltraEdit webpage previously made available an R wordfile on their 
webpage, however, it is no longer posted.

Thanks in advance...

Jason

***
Jason C. Fisher
UCLA Graduate Student
Civil  Environmental Engineering Dept.
5731 Boelter Hall
Box 951593
Los Angeles, CA 90095-1593
Phone Number: (310) 825-2292
Email: [EMAIL PROTECTED]
***

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] testing slope

2003-02-04 Thread Ronaldo Reis Jr.
Hi all,

I try to test a linear slope using offset.

I have:

 m2 - glm(Y~X*V)
 summary(m2)

Call:
glm(formula = Y ~ X * V)

Deviance Residuals: 
 Min1QMedian3Q   Max  
-2.01688  -0.56028   0.05224   0.53213   3.60216  

Coefficients:
Estimate Std. Error t value Pr(|t|)
(Intercept)   1.3673 0.8476   1.613 0.119788
X 4.0235 0.1366  29.453   2e-16 ***
Vn2   0.9683 1.1987   0.808 0.427131
Vn3   4.6043 1.1987   3.841 0.000787 ***
X:Vn2 4.1108 0.1932  21.279   2e-16 ***
X:Vn3-4.0069 0.1932 -20.740   2e-16 ***
---
Signif. codes:  0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 

(Dispersion parameter for gaussian family taken to be 1.53955)

Null deviance: 15303.977  on 29  degrees of freedom
Residual deviance:36.949  on 24  degrees of freedom
AIC: 105.39

Number of Fisher Scoring iterations: 2

It is clear that X slope is diferent of Zero.
X 4.0235 0.1366  29.453   2e-16 ***

It is too clear that X:Vn2's slope is diferent of X's slope and diferent of 
Zero, because is greater than X'slope.
X:Vn2 4.1108 0.1932  21.279   2e-16 ***

But, the X:Vn3' slope is different of X'slope, but not necessarily different 
of Zero.

How I make to introduce this parameter in a new model for test? An offset only 
with Vn3 slope???

I try:

m2 - glm(Y~V*offset(0*X))
m2 - glm(Y~X*V+V*offset(0*X))
m2 - glm(Y~V:X+V*offset(0*X))

but neither work :((

Thanks for all.
Ronaldo
-- 
If you live in a country run by committee, be on the committee.
-- Graham Summer
--
|   //|\\   [*][***]
|| ( õ õ )  [Ronaldo Reis Júnior  ][PentiumIII-600 ]
| V [ESALQ/USP-Entomologia, CP-09 ][HD: 30 + 10 Gb ]
||  / l \   [13418-900 Piracicaba - SP][RAM: 128 Mb]
|  /(lin)\  [Fone: 19-429-4199 r.229  ][Video: SiS620-8Mb  ]
||/(linux)\ [[EMAIL PROTECTED]  ][Modem: Pctel-onboar]
|/ (linux) \[ICQ#: 5692561][Kernel: 2.4.18 ]
||  ( x )   [*][***]
||| _/ \_Powered by Gnu/Debian Woody D+:) | Lxuser#: 205366

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



[R] rearranging rows

2003-02-04 Thread Luca De Benedictis

Dear all,
I am working with a matrix structured as follows

Factor 1Factor2  ...
Country 1
Country 1
Country 2
Country 2
...

Country N
Country N

and I need to rearrange it according to the following scheme


Factor 1Factor2  ...
Country 2
Country 2
Country N
Country N
...

Country 1
Country 1

where countries are ordered accordingly to the average value of factor 1

correspondent to each country.
What is the easy way of doing it?

Many thanks in advance,

Luca

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



Re: [R] rearranging rows

2003-02-04 Thread kjetil brinchmann halvorsen
On 5 Feb 2003 at 1:22, Luca De Benedictis wrote:

Well, you want to rearrange according to the mean of factor 1. 
Factors are catecorical variables, and doesn't have means, so
I assume you really want to say a numerical variable.

Assuming your data is in a data frame with Country 1 etc levels of
a factor  Country  :

attach(your.data.frame)

Something like
means - tapply(Factor1, Country, mean)
s - sort(means)
na - names(s)
ns - vector(length=length(s))
for (i in 1:n) {
ns[i] - sum(Country==na[i])
}
names - rep(na, ns)
your.data.frame - your.data.frame[names,]

This is assuming that the different countries are contiguous
in the data frame, and is not tested. Surely somebody 
have a nicer solution.

Kjetil Halvorsen



 
 Dear all,
 I am working with a matrix structured as follows
 
 Factor 1Factor2  ...
 Country 1
 Country 1
 Country 2
 Country 2
 ...
 
 Country N
 Country N
 
 and I need to rearrange it according to the following scheme
 
 
 Factor 1Factor2  ...
 Country 2
 Country 2
 Country N
 Country N
 ...
 
 Country 1
 Country 1
 
 where countries are ordered accordingly to the average value of factor 1
 
 correspondent to each country.
 What is the easy way of doing it?
 
 Many thanks in advance,
 
 Luca
 
 __
 [EMAIL PROTECTED] mailing list
 http://www.stat.math.ethz.ch/mailman/listinfo/r-help

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help