Re: [R] Get bearing for cartesian coordinates

2009-07-28 Thread Bill.Venables
I think all you need is 

bearing - function(x, y) atan2(y, x)*180/pi

This gives the bearing in degrees from the origin.  If you wanted the bearing 
from some other point, just take the differences:

bearing - function(x, y, origin = c(x=0,y=0)) 
atan2(y-origin[y], x-origin[x])*180/pi


Bill Venables
http://www.cmis.csiro.au/bill.venables/ 


-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
Behalf Of pecardoso
Sent: Tuesday, 28 July 2009 9:40 AM
To: r-help@r-project.org
Subject: [R] Get bearing for cartesian coordinates

Is it possible to get bearing in degrees from Cartesian (not lat long) 
coordinates?


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Making a sub data.frame

2009-07-28 Thread Bill.Venables
Suppose DF is the data frame and someIDs is the vector

subDF - subset(DF, ID %in% someIDs)


Bill Venables
http://www.cmis.csiro.au/bill.venables/ 


-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
Behalf Of desper
Sent: Tuesday, 28 July 2009 6:41 AM
To: r-help@r-project.org
Subject: [R] Making a sub data.frame


Dear all,

I have a data.frame like this 

ID VAR1
11   blaaal
121 blalda
121  adada
234baada
231 ddaaa
231 baada
...   ...

and I have another vector of ID, say, c(121,234,231)
How could I collect all the observations start with ID from c(121,234,231) ?


Thanks

All the Best,
Desper
-- 
View this message in context: 
http://www.nabble.com/Making-a-sub-data.frame-tp24687873p24687873.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Splitting matrix into several small matrices

2009-07-28 Thread Bill.Venables
I take it you want to split the matrix into sub-matrices for which some 
collection of columns is constant.  In your case this is the last four columns.

Here's an idea:

 z - matrix(c(13,1,1,1,1,12,0,0,0,0,8,1,0,1,1,8,0,1,0,0,
+   10,1,1,1,1,3,0,1,0,0,3,1,0,1,1,6,1,1,1,1),8,5,byrow = T)
 z
 [,1] [,2] [,3] [,4] [,5]
[1,]   131111
[2,]   120000
[3,]81011
[4,]80100
[5,]   101111
[6,]30100
[7,]31011
[8,]61111

 ind - do.call(paste, data.frame(z[, 2:5]))

 split(data.frame(z), ind)
$`0 0 0 0`
  X1 X2 X3 X4 X5
2 12  0  0  0  0

$`0 1 0 0`
  X1 X2 X3 X4 X5
4  8  0  1  0  0
6  3  0  1  0  0

$`1 0 1 1`
  X1 X2 X3 X4 X5
3  8  1  0  1  1
7  3  1  0  1  1

$`1 1 1 1`
  X1 X2 X3 X4 X5
1 13  1  1  1  1
5 10  1  1  1  1
8  6  1  1  1  1

  


Bill Venables
http://www.cmis.csiro.au/bill.venables/ 


-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
Behalf Of kathie
Sent: Tuesday, 28 July 2009 8:47 AM
To: r-help@r-project.org
Subject: [R] Splitting matrix into several small matrices


Dear R users...

I need to split this matrix(or dataframe), for example,

z - matrix(c(13,1,1,1,1,12,0,0,0,0,8,1,0,1,1,8,0,1,0,0,
  10,1,1,1,1,3,0,1,0,0,3,1,0,1,1,6,1,1,1,1),8,5,byrow = T)


 z
 [,1] [,2] [,3] [,4] [,5]
[1,]   131111
[2,]   120000
[3,]81011
[4,]90100
[5,]   101111
[6,]30100
[7,]31011
[8,]61111


(actually, z matrix is big, about 1000*15 matrix)

to 4 matrices like this way,


#- 1st matrix--
131111
101111
 61111

#- 2nd matrix--
120000


#- 3rd matrix--
81011
31011


#- 4th matrix--
90100
30100



Any comments will be greatly appreciated.

Kathryn Lord
-- 
View this message in context: 
http://www.nabble.com/Splitting-matrix-into-several-small-matrices-tp24689585p24689585.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Split rownames into factors

2009-07-28 Thread Bill.Venables
?substring 


Bill Venables
http://www.cmis.csiro.au/bill.venables/ 


-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
Behalf Of jimdare
Sent: Tuesday, 28 July 2009 8:10 AM
To: r-help@r-project.org
Subject: [R] Split rownames into factors


Hi Guys,

I was wondering how you would go about solving the following problem:

I have a list where the grouping information is in the row names.

Rowname [,1]

X1Jan08  324
X1Jun08  65
X1Dec08  543
X2Jan08  23
X2Jun08  54
X2Dec08  8765
X3Jan08  213
X3Jun08  43
X3Dec08  65

How can I create the following dataframe:
   ValueDateGroup
[1,]  324  Jan 08X1
[2,]  65   Jun 08X1
[3,]  543 Dec 08X1
 etc.

Thanks for your help!
James

-- 
View this message in context: 
http://www.nabble.com/Split-rownames-into-factors-tp24689181p24689181.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] storing output in html or pdf table format.

2009-07-28 Thread Liviu Andronic
Hello,

On 7/28/09, Albert EINstEIN sateeshvar...@gmail.com wrote:
  clarification on output in R. I have generated summary statistics output for
  dataset (E.g. sales) in output window. Now i want  to store that output in a
  html or pdf in a table format. if possible can any one provide code for this
  one.

http://www.rseek.org/?cx=010923144343702598753%3Aboaz1reyxd4q=html+outputsa=Searchcof=FORID%3A11

There is also html() in Hmisc. There are others: do an in-line search
for HTML on CRAN [1].
Liviu

[1] http://cran.r-project.org/web/packages/

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Sort a dataframe on the column Date

2009-07-28 Thread Meenu Sahi
Dear Users
I have a dataframe called mydata4 of the following order with the first
column as a date and the rest of the columns are numeric with rate.
Column 1  Rate1 : Rate 20
(PxMid)
01/01/2003
07/01/2001


--

I wish to sort this dataframe on the first col in ascending order.
I tried to do the following
mydata4-mydata4[,order(mydata4$PxMid)]
This give an error.

Please help.

Regards
Meenu

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] calculating p-values from t-values for a Bonferroni adjustment

2009-07-28 Thread Dieter Menne



NativeBuff2003 wrote:
 
 
 Sorry I'm new to the list and not great with R. My advisor performed
 several for me but I am getting a different output when I try to reproduce
 it.
 
 2*(1-pt(-3.59,598))
 0.000358 -his answer
 [1] 1.999642 -my answer
 
 I was working with a different data set in the following but the answer
 doesn't fit.
 2*(1-pt(-5.542,389))
 [1] 2 - my answer
 
 

I assume that his answer was generated not by the same code, but from what
(s)he looked up in the table. Note that your result = 2-her result, and
compare the output from the code below.

Dieter

2*(pt(abs(-3.59),598,lower.tail=TRUE))
2*(pt(-3.59,598,lower.tail=TRUE))
2*(pt(abs(-3.59),598,lower.tail=FALSE))
2*(pt(-3.59,598,lower.tail=FALSE))


-- 
View this message in context: 
http://www.nabble.com/calculating-p-values-from-t-values-for-a-Bonferroni-adjustment-tp24689680p24693461.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] computing the radius of an arc

2009-07-28 Thread Hans W Borchers
Nair, Murlidharan T mnair at iusb.edu writes:

 
 Alex Brenning, the developer of the RSAGA package told me that and I quote 
 the RSAGA package (which uses functions from the free geographical 
 information system [GIS] SAGA GIS) has a curvature function that is designed 
 to calculate the curvature of surfaces, in particular raster (i.e. gridded) 
 digital elevation models. I am not aware of a function in SAGA GIS or other 
 GIS that would calculate curvatures along a line, especially not in 3D


I have difficulties seeing how you would go about to do this. A surface locally
is characterized by two main curvatures --- this is Gauss' theorem for 2-dim
geometry. The sphere has the same curvature, 1/r, in both directions. So maybe
you can approximate the surface by an ellipsoid, but a strange one as the main
directions may not be orthogonal.

I am not sure this is what you wanted to achieve. As a side remark: The circle
approximating a curve in three dimensions is not uniquely determined.

Regards
Hans Werner


 I shall try to develop it and if I am successful I shall make it available.
 
 Cheers../Murli


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Cumulative row sums, row differences

2009-07-28 Thread glen_b


I tried searching but I couldn't quite find what I was looking for.

Here's a dummy data matrix (with row and column labels):
 y
   0 1  2 3  4
21 3 4  8 5  5
22 3 6  8 6 NA
23 4 5 11 4  3
24 4 2  1 4  6
25 6 4  4 6  6

I can get cumulative row sums as follows:
 cy-t(apply(y,1,cumsum))
 cy
   0  1  2  3  4
21 3  7 15 20 25
22 3  9 17 23 NA
23 4  9 20 24 27
24 4  6  7 11 17
25 6 10 14 20 26

Which works, but this seems rather clumsy, especially the need for t().

Is there a better way? One that still retains row and/or column labels?
(that will also work for data frames, if possible - though of course one can
always as.data.frame() )

Row differences present a different problem. Here's one way to get back the
original data:

 cbind(cy[,1],cy[,-1]-cy[,-nrow(cy)])
 1  2 3  4
21 3 4  8 5  5
22 3 6  8 6 NA
23 4 5 11 4  3
24 4 2  1 4  6
25 6 4  4 6  6

However, if I use that I lose the first column label. Is there a way to do
something like this without
losing that label? (again, if possible, that also works for data frames?)

thanks!

Glen_B.

-- 
View this message in context: 
http://www.nabble.com/Cumulative-row-sums%2C-row-differences-tp24692986p24692986.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Draw plot.table axis on right hand side

2009-07-28 Thread Dieter Menne



Sean Carmody wrote:
 
 With an ordinary plot, to customise the axis it is possible to suppress
 drawing the axis and then call Axis. I have been trying to change the
 location of the y-axis on a plot.table plot to the right hand side, but
 cannot even work out how to suppress drawing the labels.
 
 

Thanks for the nice example. plot calls mosaicplot, and looking at the
code it seems that the labels are rather hard-wired. Even dirty tricks like
setting the margins do not help, and 

data$a - c(, , , , )[data$x]

neither. 

So I would recommend to use package vcd instead, which has very detailed
detail handling.

Dieter





-- 
View this message in context: 
http://www.nabble.com/Draw-plot.table-axis-on-right-hand-side-tp24689766p24693737.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] probability on a barplot

2009-07-28 Thread Dieter Menne



Erin Hodgess-2 wrote:
 
 I have a barplot created from a table.
 
 What is the best way to set up the barplot such that is shows
 probability rather totals, please?
 

Maybe histogram or densityplot in lattice?

Dieter


-- 
View this message in context: 
http://www.nabble.com/probability-on-a-barplot-tp24685060p24693842.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] pairs plot

2009-07-28 Thread Jose Narillos de Santos
Hi Greg I saw, read, the TeachingDemos you suggesttef but when run pairs2
function on my R module says Can´t find function pairs2

How can I load the module or function pairs2?

Thanks in advance for your help.

You are the best.

2009/7/27, Greg Snow greg.s...@imail.org:

 Look at the pairs2 function in the TeachingDemos package.

 --
 Gregory (Greg) L. Snow Ph.D.
 Statistical Data Center
 Intermountain Healthcare
 greg.s...@imail.org
 801.408.8111


  -Original Message-
  From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
  project.org] On Behalf Of Jose Narillos de Santos
  Sent: Monday, July 27, 2009 9:02 AM
  To: r-help@r-project.org
  Subject: [R] pairs plot
 
  Hi all,
 
  I want to plot trough pairs() plot a matrix with 4 columns. I want to
  make a
  trhee plot in a graph. Plotting pairs colum 2,3,4 on y axis and 1 on X
  axis.
 
  You mean (a plot with three graphs) ommitting the first pair with
  itself.
  And only the pairs with colum 1 with the other not all pairs.
 
  I. e. this matrix
 
  4177 289390 8740 17220
  3907 301510 8530 17550
  3975 316970 8640 17650
  3651 364220 9360 21420
  3031 387390 9960 23410
  2912 430180 11040 25820
  3018 499930 12240 27620
  2685 595010 13800 31670
  2884 661870 14760 37170
 
  Thanks in advance.
 
[[alternative HTML version deleted]]
 
  __
  R-help@r-project.org mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide http://www.R-project.org/posting-
  guide.html
  and provide commented, minimal, self-contained, reproducible code.


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R Excel

2009-07-28 Thread Hassan hany
Hi,
whenever
am trying to start R from excel, or by clicking the[ RExcel2007 with
RCommander] icon., i got the following messages boxes :
SCTools not available
 then:
there seems to be no R process connected 
to excel
though both r and excel starts after I click the Icon!!
Please help
Hassan



  
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] creating and populating an environment

2009-07-28 Thread Christian Prinoth
I have looked a bit more at this issue. Using new.env() I am able to put
new vars into the new environment by using the env$... syntax. This
allows to eliminate all variables in one step with rm(env), thus
fixing problem 2) in my original mail. Problem 1) though is unsolved, or
even worsened, since now I need to prepend the environment name to each
variable whenever I use one. Even doing attach(env) does not help,
since the global environment has higher priority than the local one.

Does anyone have a suggestion? Ideally, I would like to have a separate
environment like I have inside a user-defined function.

Thanks
Christian Prinoth

 -Original Message-
 From: Christian Prinoth
 Sent: 27 July, 2009 13:33
 To: 'r-help@r-project.org'
 Subject: creating and populating an environment

 Hi, I often work with R by writing long(ish) Excel-VBA macros
 interspersed with calls to R via RExcel. A typical example of
 this would be:

 Sub VBAMacro()
   'fetch some data from an excel sheet
   'do some basic stuff on said data
   'transfer data from vba to R
   'run some R statements
   'get data back to vba
   'show results on the excel sheet
   'clean R by deleting all vars that were created: rrun
 rm(a,b,c,)
 end sub

 This has two obvious disadvantages, as I have to make sure:
 1) not to use R variable names which may already exist
 2) to remove all variables (garbage collection)

 In order to overcome these issues I was wondering if I should
 execute all R statements inside the R macro in a separate
 namespace. I have looked at new.env() but am not really sure
 how it is supposed to be used. If I type temp-new.env(),
 how do I make sure that all variables declared from then on
 end up in the temp environment? Once I am done, is
 rm(temp) sufficient to get rid of all its content?

 Basically, I would like to replace the above example with:
 Sub VBAMacro()
   rrun A-new.env()
   'fetch some data from an excel sheet
   'do some basic stuff on said data
   'transfer data from vba to R
   'run some R statements
   'get data back to vba
   'show results on the excel sheet
   rrun rm(A)
 end sub

 Thanks
 Christian Prinoth


DISCLAIMER:\ L'utilizzo non autorizzato del presente mes...{{dropped:16}}

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Odp: Cumulative row sums, row differences

2009-07-28 Thread Petr PIKAL
Hi

r-help-boun...@r-project.org napsal dne 28.07.2009 09:18:43:

 
 
 I tried searching but I couldn't quite find what I was looking for.
 
 Here's a dummy data matrix (with row and column labels):
  y
0 1  2 3  4
 21 3 4  8 5  5
 22 3 6  8 6 NA
 23 4 5 11 4  3
 24 4 2  1 4  6
 25 6 4  4 6  6
 
 I can get cumulative row sums as follows:
  cy-t(apply(y,1,cumsum))
  cy
0  1  2  3  4
 21 3  7 15 20 25
 22 3  9 17 23 NA
 23 4  9 20 24 27
 24 4  6  7 11 17
 25 6 10 14 20 26
 
 Which works, but this seems rather clumsy, especially the need for t().
 
 Is there a better way? One that still retains row and/or column labels?
 (that will also work for data frames, if possible - though of course one 
can
 always as.data.frame() )
 
 Row differences present a different problem. Here's one way to get back 
the
 original data:
 
  cbind(cy[,1],cy[,-1]-cy[,-nrow(cy)])
  1  2 3  4
 21 3 4  8 5  5
 22 3 6  8 6 NA
 23 4 5 11 4  3
 24 4 2  1 4  6
 25 6 4  4 6  6
 
 However, if I use that I lose the first column label. Is there a way to 
do
 something like this without
 losing that label? (again, if possible, that also works for data 
frames?)

You can use apply approach with diff

cbind(vvv[,1, drop=F],t(apply(vvv,1, diff)))

or your construction

cbind(cy[,1, drop=F],cy[,-1]-cy[,-nrow(cy)])

Do not forget drop argument which prevents losing label!!!

Regards
Petr

And with data frames do not forget they need not have only numeric 
columns, even if they look like numeric.


 
 thanks!
 
 Glen_B.
 
 -- 
 View this message in context: 
http://www.nabble.com/Cumulative-row-sums%2C-
 row-differences-tp24692986p24692986.html
 Sent from the R help mailing list archive at Nabble.com.
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] pairs plot

2009-07-28 Thread Petr PIKAL
Hi

r-help-boun...@r-project.org napsal dne 28.07.2009 09:55:11:

 Hi Greg I saw, read, the TeachingDemos you suggesttef but when run 
pairs2
 function on my R module says Can´t find function pairs2
 
 How can I load the module or function pairs2?

Did you do

library(TeachingDemos)?

Regards
Petr


 
 Thanks in advance for your help.
 
 You are the best.
 
 2009/7/27, Greg Snow greg.s...@imail.org:
 
  Look at the pairs2 function in the TeachingDemos package.
 
  --
  Gregory (Greg) L. Snow Ph.D.
  Statistical Data Center
  Intermountain Healthcare
  greg.s...@imail.org
  801.408.8111
 
 
   -Original Message-
   From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
   project.org] On Behalf Of Jose Narillos de Santos
   Sent: Monday, July 27, 2009 9:02 AM
   To: r-help@r-project.org
   Subject: [R] pairs plot
  
   Hi all,
  
   I want to plot trough pairs() plot a matrix with 4 columns. I want 
to
   make a
   trhee plot in a graph. Plotting pairs colum 2,3,4 on y axis and 1 on 
X
   axis.
  
   You mean (a plot with three graphs) ommitting the first pair with
   itself.
   And only the pairs with colum 1 with the other not all pairs.
  
   I. e. this matrix
  
   4177 289390 8740 17220
   3907 301510 8530 17550
   3975 316970 8640 17650
   3651 364220 9360 21420
   3031 387390 9960 23410
   2912 430180 11040 25820
   3018 499930 12240 27620
   2685 595010 13800 31670
   2884 661870 14760 37170
  
   Thanks in advance.
  
 [[alternative HTML version deleted]]
  
   __
   R-help@r-project.org mailing list
   https://stat.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide http://www.R-project.org/posting-
   guide.html
   and provide commented, minimal, self-contained, reproducible code.
 
 
[[alternative HTML version deleted]]
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] storing output in html or pdf table format.

2009-07-28 Thread ONKELINX, Thierry

Have a look at Sweave (in the utils package) or the R2HTML package.

HTH,

Thierry




ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and quality assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium
tel. + 32 54/436 185
thierry.onkel...@inbo.be
www.inbo.be

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to
say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of
data.
~ John Tukey

-Oorspronkelijk bericht-
Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
Namens Albert EINstEIN
Verzonden: dinsdag 28 juli 2009 6:56
Aan: r-help@r-project.org
Onderwerp: [R] storing output in html or pdf table format.


Hi every one,
Thanks for every one who are all supporting to us. we want some
clarification on output in R. I have generated summary statistics output
for dataset (E.g. sales) in output window. Now i want  to store that
output in a html or pdf in a table format. if possible can any one
provide code for this one.

Thanks in advance.  

--
View this message in context:
http://www.nabble.com/storing-output-in-html-or-pdf-table-format.-tp2469
2508p24692508.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer 
en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is
door een geldig ondertekend document. The views expressed in  this message 
and any annex are purely those of the writer and may not be regarded as stating 
an official position of INBO, as long as the message is not confirmed by a duly 
signed document.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Searching for specific values in a matrix

2009-07-28 Thread Martin Maechler
 BertG == Bert Gunter gunter.ber...@gene.com
 on Mon, 27 Jul 2009 15:30:08 -0700 writes:

BertG Nothing wrong with rolling your own, but see
BertG ?all.equal for R's built-in almost.equal version.

Yes, indeed!  Note that that needs a little extra care, as it
either returns TRUE or a character vector.
In sum, I'd strongly suggest you use

  %~% - function(x,y) isTRUE(all.equal(x,y))

Martin Maechler, ETH Zurich and R Core Team

BertG Bert Gunter Genentech Nonclinical Biostatistics

BertG -Original Message- From:
BertG r-help-boun...@r-project.org
BertG [mailto:r-help-boun...@r-project.org] On Behalf Of
BertG Steve Lianoglou Sent: Monday, July 27, 2009 3:17 PM
BertG To: Mehdi Khan Cc: r-help@r-project.org Subject: Re:
BertG [R] Searching for specific values in a matrix

BertG Ahh ..

BertG On Jul 27, 2009, at 6:01 PM, Mehdi Khan wrote:

 Even when choosing a value from the first few rows, it
 doesn't work.  okay here it goes:
 
  rearranged[1:10, 1:5] x y band1 VSCAT.001 soiltype 1
 -124.3949 40.42468 NA NA CD 2 -124.3463 40.27358 NA NA CD
 3 -124.3357 40.25226 NA NA CD 4 -124.3663 40.40241 NA NA
 CD 5 -124.3674 40.49810 NA NA CD 6 -124.3083 40.24744 NA
 464 NA 7 -124.3017 40.31295 NA NA D 8 -124.3375
 40.47557 NA 464 NA 9 -124.2511 40.11697 1 NA NA 10
 -124.2532 40.12640 1 NA NA
 
  query- rearranged$y== 40.42468  rearranged[query,]
 [1] x y band1 VSCAT.001 soiltype 0 rows (or 0-length
 row.names)

BertG This isn't working because the numbers you see for y
BertG (40.42468) isn't precisely what that number is. As I
BertG mentioned before you should use an almost.equals
BertG type of search for this scenario. My %~% function
BertG isn't working in your session because that is a
BertG function I've defined myself. You can of course use
BertG it, you just have to define it in your
BertG workspace. Paste these lines into your workspace (or
BertG save them to a file and source that file into your
BertG workspace).

BertG ## === almost.equal functions 

BertG almost.equal - function(x, y,
BertG tolerance=.Machine$double.eps^0.5) { abs(x - y) 
BertG tolerance }

BertG %~% - function(x, y) almost.equal(x, y)

BertG ## === end paste ==

BertG Now you can use %~% once that's in. Let's use the
BertG almost.equal function now because I don't know if the
BertG default tolerance here is too strict (I suspect
BertG showing the value for rearranged$y[1] will show you
BertG more significant digits than you're seeing in the
BertG table(?))

BertG query - almost.equal(rearranged$y, 40.42468,
BertG tolerance=0.0001) rearranged[query,]

BertG This will get you something.

 query- rearranged$ VSCAT.001== 464 except it's a huge
 table (I guess I have to get rid of all rows with NA).

BertG Yes, I believe I mentioned earlier that you have to
BertG axe the NA matches manually:

BertG query - rearranged$VSCAT.001 == 464 
BertG !is.na(rearranged$VSCAT.001) rearranged[query,]

BertG Will get you what you want.

 I tried using the %~% but R doesn't recognize it.  So
 maybe it has to do with the rounding errors?

BertG Rounding errors won't happen with integer comparisons
BertG (and it looks like the VSCAT.001 columns is integers,
BertG no?).

BertG -steve

BertG -- Steve Lianoglou Graduate Student: Computational
BertG Systems Biology | Memorial Sloan-Kettering Cancer
BertG Center | Weill Medical College of Cornell University
BertG Contact Info: http://cbio.mskcc.org/~lianos/contact

BertG __
BertG R-help@r-project.org mailing list
BertG https://stat.ethz.ch/mailman/listinfo/r-help PLEASE
BertG do read the posting guide
BertG http://www.R-project.org/posting-guide.html and
BertG provide commented, minimal, self-contained,
BertG reproducible code.

BertG __
BertG R-help@r-project.org mailing list
BertG https://stat.ethz.ch/mailman/listinfo/r-help PLEASE
BertG do read the posting guide
BertG http://www.R-project.org/posting-guide.html and
BertG provide commented, minimal, self-contained,
BertG reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Fwd: randomized block design analysis in R

2009-07-28 Thread alis villiyam
-- Forwarded message --
From: alis villiyam aalisi...@gmail.com
Date: Mon, Jul 27, 2009 at 9:47 AM
Subject: randomized block design analysis in R
To: bol...@zoology.ufl.edu


Dear All user
Hello,

I'm a  student and I have some trouble with the experimental
(columns-experiments) design of my project. I use a randomized block design
with 4 treatments including a control. For each treatment, I use 3
replicates and 3 blocks.

The treatments are:

-T1 = COD (300 mg/Lit)   COD=chemical oxygen demand

-T2 = COD (200 mg/Lit)

-T3 = COD (100 mg/Lit)

-T4 = COD (0 mg/Lit) as a control

The experiment is conducted during three months and a sample is taken each
Week in every experimental unit.

At the first, I irrigated all soil columns (12 columns) with demonize water
for 1 week.

Then during 8 weeks, I irrigated all columns with waste water with different
concentration. Then, gain, I irrigated all columns with demonize water for 4
weeks.

Now I want to know how I can analyses the results in R. For example, I want
to detect the
Effect of waste water on some physical properties of soil, before, during
use waste water and after use waste water (Is there any significant change
in properties of soil.) Time is also important, so I want to know the
interaction between time and some physical properties of soil, like water
content .first comprises between Treatments and then comprise between
weeks).

Questions to be answered:

1)  Theta (water content), before (1 week) and after the COD; is there a
difference?
2)  Theta, during, before and after the COD; is there a difference?
3)  Is there a trend in Theta, during COD (8 weeks)?
4)  Is there a difference in Theta, during COD between the treatments?
I hope somebody can help me to find correct statistical analyses in R.


Kind regards,

Alisia
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] vary the parameters for a function

2009-07-28 Thread Inchallah Yarab






How I can vary the parameters for a function? 

I have a function with 5 parameters I want to turn the function for a range of 
numbers for one of these parameters!! i want to have in the end the value of 
the function in the different cas of one of the paramter (the others paramters 
are fixes!!) thank you for your help



  
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Odp: vary the parameters for a function

2009-07-28 Thread Petr PIKAL
Hi

maybe outer?

Regards
Petr


r-help-boun...@r-project.org napsal dne 28.07.2009 11:36:10:

 
 
 
 
 
 
 How I can vary the parameters for a function? 
 
 I have a function with 5 parameters I want to turn the function for a 
range of
 numbers for one of these parameters!! i want to have in the end the 
value of 
 the function in the different cas of one of the paramter (the others 
paramters
 are fixes!!) thank you for your help
 
 
 
 
[[alternative HTML version deleted]]
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] storing output in html or pdf table format.

2009-07-28 Thread David Hajage
Or you can have a look to ascii package (examples here
http://eusebe.github.com/ascii/or
herehttp://www.ncfaculty.net/dogle/fishR/bookex/AIFFD/AIFFD.html
).

david

2009/7/28 ONKELINX, Thierry thierry.onkel...@inbo.be


 Have a look at Sweave (in the utils package) or the R2HTML package.

 HTH,

 Thierry


 
 
 ir. Thierry Onkelinx
 Instituut voor natuur- en bosonderzoek / Research Institute for Nature
 and Forest
 Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
 methodology and quality assurance
 Gaverstraat 4
 9500 Geraardsbergen
 Belgium
 tel. + 32 54/436 185
 thierry.onkel...@inbo.be
 www.inbo.be

 To call in the statistician after the experiment is done may be no more
 than asking him to perform a post-mortem examination: he may be able to
 say what the experiment died of.
 ~ Sir Ronald Aylmer Fisher

 The plural of anecdote is not data.
 ~ Roger Brinner

 The combination of some data and an aching desire for an answer does not
 ensure that a reasonable answer can be extracted from a given body of
 data.
 ~ John Tukey

 -Oorspronkelijk bericht-
 Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
 Namens Albert EINstEIN
 Verzonden: dinsdag 28 juli 2009 6:56
 Aan: r-help@r-project.org
 Onderwerp: [R] storing output in html or pdf table format.


 Hi every one,
 Thanks for every one who are all supporting to us. we want some
 clarification on output in R. I have generated summary statistics output
 for dataset (E.g. sales) in output window. Now i want  to store that
 output in a html or pdf in a table format. if possible can any one
 provide code for this one.

 Thanks in advance.

 --
 View this message in context:
 http://www.nabble.com/storing-output-in-html-or-pdf-table-format.-tp2469
 2508p24692508.htmlhttp://www.nabble.com/storing-output-in-html-or-pdf-table-format.-tp2469%0A2508p24692508.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

 Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver
 weer
 en binden het INBO onder geen enkel beding, zolang dit bericht niet
 bevestigd is
 door een geldig ondertekend document. The views expressed in  this message
 and any annex are purely those of the writer and may not be regarded as
 stating
 an official position of INBO, as long as the message is not confirmed by a
 duly
 signed document.

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] vary paramter of a function

2009-07-28 Thread Inchallah Yarab
i have a function who depends of many parameters and i want to have at the end 
the result givien by this function for a different value of only one parameter 
the others parameters are fixed.

thank you 
i didn't understand your answer peter  can you explain me?
thank you



  
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] How to do poisson distribution test like this?

2009-07-28 Thread Mao Jianfeng
Dear R-listers,

I want to reperfrom a poisson distribution test that presented in a
recent-published biological research paper (Plant Physiology 2008, vol 148,
pp. 1189-1200). That test is about the occurrence number of a kind of gene
in separate chromosomes.

For instance:

The observed gene number in chromosome A is 36.
The expected gene number in chromosome A is 30.

Then, the authors got a probability 0.137 by distribution test on this
trial. In this test, a Poisson distribution was used to determine the
significance of the gene distribution.

Questions:

How can I reperform this test in R?

Thank you in advance.

Mao Jian-Feng
Institue of Botany,
CAS, China

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Sort a column in a dataframe

2009-07-28 Thread Meenu Sahi
Dear Users

This is my dataset called mydata4. I want to sort the dataframe on the first
column PxMid which is basically a column with dates.

I've tried mydata4-mydata4[order(mydata4$PxMid),] but it doesnt work. Could
it be because these are dates?
Please help I'm really stuck !!

Thank you for your time.

Regards
Meenu

PxMid EU0006MIndex.x DMSW1Curncy.x DMSW2Curncy.x DMSW3Curncy.x
1 01/01/20032.801132.70702.89203.1720
2 01/01/20073.853504.07604.12504.1230
3 01/02/20023.415633.63854.08104.3587
4 01/02/20062.72.95453.16723.2792
5 01/05/20023.498633.79404.23004.4920
6 01/05/20063.035883.32543.59503.7380
  DMSW4Curncy.x DMSW5Curncy.x DMSW6Curncy.x DMSW7Curncy.x DMSW8Curncy.x
13.43603.66403.86404.03604.1790
24.12304.12504.13504.14604.1620
34.54874.69884.83134.93385.0138
43.36273.43423.48993.54373.5941
54.76504.86755.05505.16005.2400
63.82903.90503.96904.02404.0750
  DMSW9Curncy.x DMSW10Curncy.x DMSW12Curncy.x DMSW15Curncy.x DMSW20Curncy.x
14.2990 4.4000 4.5575 4.7175 4.8600
24.1800 4.2000 4.2330 4.2750 4.3120
35.0788 5.1263 5.2100 5.2887 5.3562
43.6457 3.6913 3.7725 3.8669 3.9410
55.3050 5.3575 5.4450 5.5425 5.6300
64.1230 4.1650 4.2360 4.3170 4.3960
  DMSW30Curncy.x EUSA40Curncy.x EUSA50Curncy.x spread.x  level.x State1
State2
1 4.8925 4.8400 4.7975   2.0005 4.006772 NA
NA
2 4.2890 4.2460 4.2040   0.1640 4.165147 NA
NA
3 5.3412 5.2913 5.2638   1.2602 4.792737 NA
NA
4 3.9840 3.9760 3.9560   0.8168 3.550524 NA
NA
5 5.6275 5.5775 5.5375   1.3975 5.007331 NA
NA
6 4.4290 4.4190 4.3980   0.8340 3.998781 NA
NA
  State3 State4 State5 State6 State7 State8 State9
1 NA NA NA  6 NA NA NA
2 NA NA  5 NA NA NA NA
3 NA NA NA NA NA NA  9
4 NA NA NA  6 NA NA NA
5 NA NA NA NA NA NA  9
6 NA NA NA  6 NA NA NA

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to do poisson distribution test like this?

2009-07-28 Thread Ted Harding
On 28-Jul-09 10:03:41, Mao Jianfeng wrote:
 Dear R-listers,
 I want to reperfrom a poisson distribution test that presented
 in a recent-published biological research paper (Plant Physiology
 2008, vol 148, pp. 1189-1200). That test is about the occurrence
 number of a kind of gene in separate chromosomes.
 
 For instance:
 
 The observed gene number in chromosome A is 36.
 The expected gene number in chromosome A is 30.
 
 Then, the authors got a probability 0.137 by distribution test on this
 trial. In this test, a Poisson distribution was used to determine the
 significance of the gene distribution.
 
 Questions:
 How can I reperform this test in R?
 
 Thank you in advance.
 Mao Jian-Feng
 Institue of Botany,
 CAS, China

Since it is not clear what test procedure they used, I have done
a couple of numerical experiments in R:

1. Compare the upper-tail probability of the POisson distribution
   with mean mu = 30 of the event that at least 36 are observed:

   1-ppois(36,30)
   # [1] 0.1196266

   Not quite the 0.137 that they got.

2. A similar comparison, using a Normal approximation to the Poisson
   (mean mu = 30, SD = sqrt(mu)):

   1 - pnorm(6/sqrt(30))
   # [1] 0.1366608

   which, after rounding, is exactly the 0.137 that they got.

So it seems they have used an upper-tail test based on the Normal
approximation to the Poisson distribution.

Method 1 (using the exact Poisson distribution) is preferable, since
it is accurate (given the assumption of Poisson distribution).
So that would, in principle, be the best way to do it in R (as
illustrated).

Possibly their adoption of Method 2 is based on a naive acceptance
of the rule-of-thumb from some textbook; or maybe their available
software does not offer ready access to the exact Poisson distribution
(which wouldn't happen if they used R -- see Method 1). As stated,
it is inaacurate compared with Method 1, so is not to be preferred.

However, if you need to reproduce their method (regardless of merit),
then use Method 2.

Hoping this helps,
Ted.


E-Mail: (Ted Harding) ted.hard...@manchester.ac.uk
Fax-to-email: +44 (0)870 094 0861
Date: 28-Jul-09   Time: 11:42:08
-- XFMail --

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Draw plot.table axis on right hand side

2009-07-28 Thread Sean Carmody
Dieter Menne wrote:

  With an ordinary plot, to customise the axis it is possible to suppress
  drawing the axis and then call Axis. I have been trying to change the
  location of the y-axis on a plot.table plot to the right hand side, but
  cannot even work out how to suppress drawing the labels.
 
 

 Thanks for the nice example. plot calls mosaicplot, and looking at the
 code it seems that the labels are rather hard-wired. Even dirty tricks
like
 setting the margins do not help, and

 data$a - c(, , , , )[data$x]

 neither.

 So I would recommend to use package vcd instead, which has very detailed
 detail handling.

 Dieter

Thanks Dieter. I see vcd had a detailed vignette. That should help me get to
grips with mosaic, which does appear to be extremely flexible.

-- 
Sean Carmody

The Stubborn Mule
http://www.stubbornmule.net
http://twitter.com/seancarmody

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] local regression using loess

2009-07-28 Thread Alain Zuur


cindy Guo wrote:
 
 Hi, All,
 
 I have a dataset with binary response ( 0 and 1) and some numerical
 covariates. I know I can use logistic regression to fit the data. But I
 want
 to consider more locally. So I am wondering how can I fit the data with
 'loess' function in R? And what will be the response: 0/1 or the
 probability
 in either group like in logistic regression?
 
 Thank you,
 Cindy
 
   [[alternative HTML version deleted]]
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
 
 


Why don't you fit a GAM with a logistic link function and binomial
distirbution?

Alain


-

Dr. Alain F. Zuur
First author of:

1. Analysing Ecological Data (2007).
Zuur, AF, Ieno, EN and Smith, GM. Springer. 680 p.

2. Mixed effects models and extensions in ecology with R. (2009).
Zuur, AF, Ieno, EN, Walker, N, Saveliev, AA, and Smith, GM. Springer.

3. A Beginner's Guide to R (2009).
Zuur, AF, Ieno, EN, Meesters, EHWG. Springer


Statistical consultancy, courses, data analysis and software
Highland Statistics Ltd.
6 Laverock road
UK - AB41 6FN Newburgh
Email: highs...@highstat.com
URL: www.highstat.com



-- 
View this message in context: 
http://www.nabble.com/local-regression-using-loess-tp24689834p24696908.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] creating and populating an environment

2009-07-28 Thread Gabor Grothendieck
prepending with env$ seems not so terrible.
Another form is:
with(e, ...stmt...) or
with(e, { ...stmt...; ...stmt...; ... })
where e is your environment.

On Tue, Jul 28, 2009 at 3:59 AM, Christian
Prinothchristian.prin...@epsilonsgr.it wrote:
 I have looked a bit more at this issue. Using new.env() I am able to put
 new vars into the new environment by using the env$... syntax. This
 allows to eliminate all variables in one step with rm(env), thus
 fixing problem 2) in my original mail. Problem 1) though is unsolved, or
 even worsened, since now I need to prepend the environment name to each
 variable whenever I use one. Even doing attach(env) does not help,
 since the global environment has higher priority than the local one.

 Does anyone have a suggestion? Ideally, I would like to have a separate
 environment like I have inside a user-defined function.

 Thanks
 Christian Prinoth

 -Original Message-
 From: Christian Prinoth
 Sent: 27 July, 2009 13:33
 To: 'r-help@r-project.org'
 Subject: creating and populating an environment

 Hi, I often work with R by writing long(ish) Excel-VBA macros
 interspersed with calls to R via RExcel. A typical example of
 this would be:

 Sub VBAMacro()
       'fetch some data from an excel sheet
       'do some basic stuff on said data
       'transfer data from vba to R
       'run some R statements
       'get data back to vba
       'show results on the excel sheet
       'clean R by deleting all vars that were created: rrun
 rm(a,b,c,)
 end sub

 This has two obvious disadvantages, as I have to make sure:
 1) not to use R variable names which may already exist
 2) to remove all variables (garbage collection)

 In order to overcome these issues I was wondering if I should
 execute all R statements inside the R macro in a separate
 namespace. I have looked at new.env() but am not really sure
 how it is supposed to be used. If I type temp-new.env(),
 how do I make sure that all variables declared from then on
 end up in the temp environment? Once I am done, is
 rm(temp) sufficient to get rid of all its content?

 Basically, I would like to replace the above example with:
 Sub VBAMacro()
       rrun A-new.env()
       'fetch some data from an excel sheet
       'do some basic stuff on said data
       'transfer data from vba to R
       'run some R statements
       'get data back to vba
       'show results on the excel sheet
       rrun rm(A)
 end sub

 Thanks
 Christian Prinoth


 DISCLAIMER:\ L'utilizzo non autorizzato del presente mes...{{dropped:16}}

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Multiple graphs

2009-07-28 Thread Alain Zuur



Data Analytics Corp. wrote:
 
 Hi,
 
 I wrote a simple master function, run(), that has inside six qplot 
 functions.  The goal is to type run() and have all six graphs appear as 
 separate windows so that I can copy them into PowerPoint for a client. 
 When I type run(), only the last graph appears, the first five 
 apparently being overwritten.  How do I get all six in separate windows, 
 ready for copying?
 
 By the way, is the a way to create a PowerPoint deck directly in R the 
 way you can in S-Plus?
 
 Thanks,
 
 Walt
 
 
 
 -- 
 
 
 Walter R. Paczkowski, Ph.D.
 Data Analytics Corp.
 44 Hamilton Lane
 Plainsboro, NJ 08536
 
 (V) 609-936-8999
 (F) 609-936-3733
 dataanalyt...@earthlink.net
 www.dataanalyticscorp.com
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
 
 


There is an example in our A Beginner's Guide to R that exports the graphs
automatically to jpg files (from a  loop inside a function)...which you
could then import into powerpoint. But as you can see from the other post,
it can even be done automatically. 


Alain 

-

Dr. Alain F. Zuur
First author of:

1. Analysing Ecological Data (2007).
Zuur, AF, Ieno, EN and Smith, GM. Springer. 680 p.

2. Mixed effects models and extensions in ecology with R. (2009).
Zuur, AF, Ieno, EN, Walker, N, Saveliev, AA, and Smith, GM. Springer.

3. A Beginner's Guide to R (2009).
Zuur, AF, Ieno, EN, Meesters, EHWG. Springer


Statistical consultancy, courses, data analysis and software
Highland Statistics Ltd.
6 Laverock road
UK - AB41 6FN Newburgh
Email: highs...@highstat.com
URL: www.highstat.com



-- 
View this message in context: 
http://www.nabble.com/Multiple-graphs-tp24690227p24697026.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] check for new files in a given directory

2009-07-28 Thread Andreas Posch
I am trying to continuously evaluate online created data files using
R-algorithms. Is there any simple way to let R iteratively check for new
files in a given directory, load them and process them?

Any help would be highly appreciated.

Best, A.

 

 


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Problem runnin rSymPy

2009-07-28 Thread stenort

Hi all,
I'm having major difficulty using the rSymPy package this week, but I have
used it without problems before now. Here is an example of what's happening:

 library(rSymPy)
Loading required package: rJava
 sympy(var('a b c d'))
Error in .jcheck() : No running detected. Maybe .jinit() would help.

And I have no idea how to fix it. I Have tried re-installing but that
doesn't seem to work either. Any help would be great, thanks!
-- 
View this message in context: 
http://www.nabble.com/Problem-runnin-rSymPy-tp24697166p24697166.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Problem runnin rSymPy

2009-07-28 Thread Gabor Grothendieck
Try reviewing the Troubleshooting section on the rSymPy home page:
http://rsympy.googlecode.com/#Troubleshooting

On Tue, Jul 28, 2009 at 7:12 AM,
stenortsten...@merchantsconnected.org.uk wrote:

 Hi all,
 I'm having major difficulty using the rSymPy package this week, but I have
 used it without problems before now. Here is an example of what's happening:

 library(rSymPy)
 Loading required package: rJava
 sympy(var('a b c d'))
 Error in .jcheck() : No running detected. Maybe .jinit() would help.

 And I have no idea how to fix it. I Have tried re-installing but that
 doesn't seem to work either. Any help would be great, thanks!
 --
 View this message in context: 
 http://www.nabble.com/Problem-runnin-rSymPy-tp24697166p24697166.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] check for new files in a given directory

2009-07-28 Thread Barry Rowlingson
On Tue, Jul 28, 2009 at 12:04 PM, Andreas Poschandreas.po...@tugraz.at wrote:
 I am trying to continuously evaluate online created data files using
 R-algorithms. Is there any simple way to let R iteratively check for new
 files in a given directory, load them and process them?

 Any help would be highly appreciated.

 list.files(dir) will tell you what files are in a directory.

 file.info(filepath) will tell you things about a file (modification time etc).

 Sys.sleep(n) will put R to sleep for n seconds so you don't have a
tight loop checking the directory every millisecond.

That's probably all the functionality you need, except maybe to keep
track of what files you consider 'new', and some way of deciding if
something has already been processed. But that's a bit
application-specific!

Barry

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] check for new files in a given directory

2009-07-28 Thread Andreas Posch
I am trying to continuously evaluate online created data files using
R-algorithms. Is there any simple way to let R iteratively check for new
files in a given directory, load them and process them? I am using R on
Windows XP. 

Any help would be highly appreciated.

Best, A.

 

 


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] check for new files in a given directory

2009-07-28 Thread Ted Harding
On 28-Jul-09 11:04:39, Andreas Posch wrote:
 I am trying to continuously evaluate online created data files using
 R-algorithms. Is there any simple way to let R iteratively check for
 new files in a given directory, load them and process them?
 
 Any help would be highly appreciated.
 Best, A.

If in Linux/Unix, the following sort of thing will work:

  LastList - system(ls,intern=TRUE)

then, later,

  NewList - system(ls,intern=TRUE)

and then

  NewList[!(NewList %in% LastList)]

is a character vector of the names in NewList which are not in LastList
(i.e. the ones which have come in since LastList was created). Then you
can do what you like with these names.

Finally:

  LastList - NewList

means you can repeat the check on the same basis.

Don't ask me how to do this in Windows ...

Hpoing this helps,
Ted.


E-Mail: (Ted Harding) ted.hard...@manchester.ac.uk
Fax-to-email: +44 (0)870 094 0861
Date: 28-Jul-09   Time: 12:24:42
-- XFMail --

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] check for new files in a given directory

2009-07-28 Thread Ted Harding
On 28-Jul-09 11:23:21, Barry Rowlingson wrote:
 On Tue, Jul 28, 2009 at 12:04 PM, Andreas
 Poschandreas.po...@tugraz.at wrote:
 I am trying to continuously evaluate online created data files using
 R-algorithms. Is there any simple way to let R iteratively check for
 new files in a given directory, load them and process them?

 Any help would be highly appreciated.
 
  list.files(dir) will tell you what files are in a directory.
 
  file.info(filepath) will tell you things about a file (modification
 time etc).
 
  Sys.sleep(n) will put R to sleep for n seconds so you don't have a
 tight loop checking the directory every millisecond.
 
 That's probably all the functionality you need, except maybe to keep
 track of what files you consider 'new', and some way of deciding if
 something has already been processed. But that's a bit
 application-specific!
 
 Barry

Snap, Baz! (Except that we played different cards -- and in view of
Andreas's follow-up, yours would be the solution for him).

However, this got me looking into '?list.files, and I see there
(R version 2.9.0 (2009-04-17)):

  recursive: logical. Should the listing recurse into directories?

But:

  Directories are included only if 'recursive = FALSE'.

Surely the latter is the wrong way round, and should be

  Directories are included only if 'recursive = TRUE'.

(that's how it worked when I just tried it).

Ted.


E-Mail: (Ted Harding) ted.hard...@manchester.ac.uk
Fax-to-email: +44 (0)870 094 0861
Date: 28-Jul-09   Time: 12:36:45
-- XFMail --

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Odp: Sort a column in a dataframe

2009-07-28 Thread Petr PIKAL
Hi

r-help-boun...@r-project.org napsal dne 28.07.2009 12:40:59:

 Dear Users
 
 This is my dataset called mydata4. I want to sort the dataframe on the 
first
 column PxMid which is basically a column with dates.
 
 I've tried mydata4-mydata4[order(mydata4$PxMid),] but it doesnt work. 
Could
 it be because these are dates?

How do you know these are dates? I suspect

str(mydata4)

will have factor at PxMid and not date. If this is true, you need to 
transform it to dates by as.Date, strptime or other suitable time/date 
function e.g. fro chron package.

Regards
Petr



 Please help I'm really stuck !!
 
 Thank you for your time.
 
 Regards
 Meenu
 
 PxMid EU0006MIndex.x DMSW1Curncy.x DMSW2Curncy.x DMSW3Curncy.x
 1 01/01/20032.801132.70702.89203.1720
 2 01/01/20073.853504.07604.12504.1230
 3 01/02/20023.415633.63854.08104.3587
 4 01/02/20062.72.95453.16723.2792
 5 01/05/20023.498633.79404.23004.4920
 6 01/05/20063.035883.32543.59503.7380
   DMSW4Curncy.x DMSW5Curncy.x DMSW6Curncy.x DMSW7Curncy.x DMSW8Curncy.x
 13.43603.66403.86404.03604.1790
 24.12304.12504.13504.14604.1620
 34.54874.69884.83134.93385.0138
 43.36273.43423.48993.54373.5941
 54.76504.86755.05505.16005.2400
 63.82903.90503.96904.02404.0750
   DMSW9Curncy.x DMSW10Curncy.x DMSW12Curncy.x DMSW15Curncy.x 
DMSW20Curncy.x
 14.2990 4.4000 4.5575 4.7175 4.8600
 24.1800 4.2000 4.2330 4.2750 4.3120
 35.0788 5.1263 5.2100 5.2887 5.3562
 43.6457 3.6913 3.7725 3.8669 3.9410
 55.3050 5.3575 5.4450 5.5425 5.6300
 64.1230 4.1650 4.2360 4.3170 4.3960
   DMSW30Curncy.x EUSA40Curncy.x EUSA50Curncy.x spread.x  level.x State1
 State2
 1 4.8925 4.8400 4.7975   2.0005 4.006772 NA
 NA
 2 4.2890 4.2460 4.2040   0.1640 4.165147 NA
 NA
 3 5.3412 5.2913 5.2638   1.2602 4.792737 NA
 NA
 4 3.9840 3.9760 3.9560   0.8168 3.550524 NA
 NA
 5 5.6275 5.5775 5.5375   1.3975 5.007331 NA
 NA
 6 4.4290 4.4190 4.3980   0.8340 3.998781 NA
 NA
   State3 State4 State5 State6 State7 State8 State9
 1 NA NA NA  6 NA NA NA
 2 NA NA  5 NA NA NA NA
 3 NA NA NA NA NA NA  9
 4 NA NA NA  6 NA NA NA
 5 NA NA NA NA NA NA  9
 6 NA NA NA  6 NA NA NA
 
[[alternative HTML version deleted]]
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Looking for example of usage of function unz

2009-07-28 Thread mauede
I would greatly appreciate some example of correct usage of function unz.
I have to download and  uncompress the following web compressef file:
ftp://ftp.sanger.ac.uk/pub/mirbase/targets/v5/arch.v5.txt.homo_sapiens.zip

I tried the following command that does not work:

Targets.rec - readLines(zz - 
unz(ftp://ftp.sanger.ac.uk/pub/mirbase/targets/v5/arch.v5.txt.homo_sapiens.zip;))

Thank you in advance,
Maura



tutti i telefonini TIM!


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] reading jpeg images?

2009-07-28 Thread Robert L Biddle

   Can someone advise me what the most sensible way is to read jpeg images?

   For our work with image analysis and eye-tracking we have been using the
   rimage package, on both Macs and Windows PCs. But while setting up a new
   Windows machine yesterday, I see that rimage is regarded as orphaned, and no
   Windows binary is available. I eventually found an old zip file for the
   package,  so  I am not stuck, but I wonder what the right way is to go
   forward. I did find the readimages package, but it also seemed problematic
   to install on both Windows on Mac, requiring extra software that it was
   itself unclear how to install.

   Is there some simpler solution I should be looking at?

   Are jpeg files so probematic I should be converting them to some other
   format and using a different package to read that?


   Thanks

   Robert Biddle
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] pairs plot

2009-07-28 Thread Jose Narillos de Santos
Hi,

I tried to load typing library(TeachingDemos)

But the message can´t find package TeachingDemos) occurs. I use versión
R 2.9 on windows.

Can you please guide me?

Sorry¡¡¡





2009/7/28, Petr PIKAL petr.pi...@precheza.cz:

 Hi

 r-help-boun...@r-project.org napsal dne 28.07.2009 09:55:11:

  Hi Greg I saw, read, the TeachingDemos you suggesttef but when run
 pairs2
  function on my R module says Can´t find function pairs2
 
  How can I load the module or function pairs2?

 Did you do

 library(TeachingDemos)?

 Regards
 Petr


 
  Thanks in advance for your help.
 
  You are the best.
 
  2009/7/27, Greg Snow greg.s...@imail.org:
  
   Look at the pairs2 function in the TeachingDemos package.
  
   --
   Gregory (Greg) L. Snow Ph.D.
   Statistical Data Center
   Intermountain Healthcare
   greg.s...@imail.org
   801.408.8111
  
  
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
project.org] On Behalf Of Jose Narillos de Santos
Sent: Monday, July 27, 2009 9:02 AM
To: r-help@r-project.org
Subject: [R] pairs plot
   
Hi all,
   
I want to plot trough pairs() plot a matrix with 4 columns. I want
 to
make a
trhee plot in a graph. Plotting pairs colum 2,3,4 on y axis and 1 on
 X
axis.
   
You mean (a plot with three graphs) ommitting the first pair with
itself.
And only the pairs with colum 1 with the other not all pairs.
   
I. e. this matrix
   
4177 289390 8740 17220
3907 301510 8530 17550
3975 316970 8640 17650
3651 364220 9360 21420
3031 387390 9960 23410
2912 430180 11040 25820
3018 499930 12240 27620
2685 595010 13800 31670
2884 661870 14760 37170
   
Thanks in advance.
   
  [[alternative HTML version deleted]]
   
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-
guide.html
and provide commented, minimal, self-contained, reproducible code.
  
 
 [[alternative HTML version deleted]]
 
  __
  R-help@r-project.org mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Fwd: Forecasting Inflation

2009-07-28 Thread Dilip Bayas
-- Forwarded message --
From: Dilip Bayas agrikonnect.dilipba...@gmail.com
Date: Mon, Jul 27, 2009 at 4:51 PM
Subject: Forecasting Inflation
To: r-help@r-project.org


Dear All,

I wanted to forecast Inflation for Indian Economy. please send what
techniques to be used after the variable selection. WPI, CPI, Money supply,
IIP, Interest rate and so on..How i can use R for the same

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Looking for example of usage of function unz

2009-07-28 Thread Ted Harding
On 28-Jul-09 12:15:33, mau...@alice.it wrote:
 I would greatly appreciate some example of correct usage of
 function unz.
 I have to download and  uncompress the following web compressef file:
 ftp://ftp.sanger.ac.uk/pub/mirbase/targets/v5/arch.v5.txt.homo_sapiens.z
 ip
 
 I tried the following command that does not work:
 
 Targets.rec - readLines(zz -
 unz(ftp://ftp.sanger.ac.uk/pub/mirbase/targets/v5/arch.v5.txt.homo_sapi
 ens.zip))
 
 Thank you in advance,
 Maura

Maura, unz() is insisting that you give the filename argument,
which, according to '?unz', is:

  filename: a filename within a zip file.

This means that you would first need to know the name[s] of the
file[s] archived in the .zip file, as far as I can see.

So, in that case, a first step would be to download the .zip
file anyway, to your local system, and then, in whatever way is
appropriate for your system (unzip -l  in Linux), find
out what the files in it are called.

But once you have got that far, you may prefer to handle the .zip
file outside of R ...

Hoping this helps,
Ted.


E-Mail: (Ted Harding) ted.hard...@manchester.ac.uk
Fax-to-email: +44 (0)870 094 0861
Date: 28-Jul-09   Time: 13:50:45
-- XFMail --

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] storing output in html or pdf table format.

2009-07-28 Thread Tal Galili
Hi Albert.
I also came across this:
http://cran.r-project.org/web/packages/hwriter/index.html
Which is very nice (although I still didn't play with it as much as I
wanted)





On Tue, Jul 28, 2009 at 7:56 AM, Albert EINstEIN sateeshvar...@gmail.comwrote:


 Hi every one,
 Thanks for every one who are all supporting to us. we want some
 clarification on output in R. I have generated summary statistics output
 for
 dataset (E.g. sales) in output window. Now i want  to store that output in
 a
 html or pdf in a table format. if possible can any one provide code for
 this
 one.

 Thanks in advance.

 --
 View this message in context:
 http://www.nabble.com/storing-output-in-html-or-pdf-table-format.-tp24692508p24692508.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




-- 
--


My contact information:
Tal Galili
Phone number: 972-50-3373767
FaceBook: Tal Galili
My Blogs:
http://www.r-statistics.com/
http://www.talgalili.com
http://www.biostatistics.co.il

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Sort a dataframe on the column Date

2009-07-28 Thread Mark Knecht
On Mon, Jul 27, 2009 at 11:46 PM, Meenu Sahimeenus...@gmail.com wrote:
 Dear Users
 I have a dataframe called mydata4 of the following order with the first
 column as a date and the rest of the columns are numeric with rate.
 Column 1          Rate1 : Rate 20
 (PxMid)
 01/01/2003
 07/01/2001
 
 
 --

 I wish to sort this dataframe on the first col in ascending order.
 I tried to do the following
 mydata4-mydata4[,order(mydata4$PxMid)]
 This give an error.

 Please help.

 Regards
 Meenu

Try

mydata4-mydata4[order(mydata4$PxMid), ]

Cheers,
Mark

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Fwd: randomized block design analysis in R

2009-07-28 Thread ONKELINX, Thierry
Dear Alisia,

These are not very easy questions to answer without detailed knowledge
on your design. That's probably why you did not get any responses so far
(I've seen your mail pop-up several times). I would recommend that you
seek guidance with your supervisor or with the local statistician.

Have a look at the posting guide
(http://www.r-project.org/posting-guide.html). It states:

Questions about statistics: The R mailing lists are primarily intended
for questions and discussion about the R software. However, questions
about statistical methodology are sometimes posted. If the question is
well-asked and of interest to someone on the list, it may elicit an
informative up-to-date answer. See also the Usenet groups
sci.stat.consult (applied statistics and consulting) and sci.stat.math
(mathematical stat and probability).  

HTH,

Thierry



ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and quality assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium
tel. + 32 54/436 185
thierry.onkel...@inbo.be
www.inbo.be

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to
say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of
data.
~ John Tukey

-Oorspronkelijk bericht-
Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
Namens alis villiyam
Verzonden: dinsdag 28 juli 2009 11:28
Aan: r-help@r-project.org
Onderwerp: [R] Fwd: randomized block design analysis in R

-- Forwarded message --
From: alis villiyam aalisi...@gmail.com
Date: Mon, Jul 27, 2009 at 9:47 AM
Subject: randomized block design analysis in R
To: bol...@zoology.ufl.edu


Dear All user
Hello,

I'm a  student and I have some trouble with the experimental
(columns-experiments) design of my project. I use a randomized block
design with 4 treatments including a control. For each treatment, I use
3 replicates and 3 blocks.

The treatments are:

-T1 = COD (300 mg/Lit)   COD=chemical oxygen demand

-T2 = COD (200 mg/Lit)

-T3 = COD (100 mg/Lit)

-T4 = COD (0 mg/Lit) as a control

The experiment is conducted during three months and a sample is taken
each Week in every experimental unit.

At the first, I irrigated all soil columns (12 columns) with demonize
water for 1 week.

Then during 8 weeks, I irrigated all columns with waste water with
different concentration. Then, gain, I irrigated all columns with
demonize water for 4 weeks.

Now I want to know how I can analyses the results in R. For example, I
want to detect the Effect of waste water on some physical properties of
soil, before, during use waste water and after use waste water (Is there
any significant change in properties of soil.) Time is also important,
so I want to know the interaction between time and some physical
properties of soil, like water content .first comprises between
Treatments and then comprise between weeks).

Questions to be answered:

1)  Theta (water content), before (1 week) and after the COD; is
there a
difference?
2)  Theta, during, before and after the COD; is there a difference?
3)  Is there a trend in Theta, during COD (8 weeks)?
4)  Is there a difference in Theta, during COD between the
treatments?
I hope somebody can help me to find correct statistical analyses in R.


Kind regards,

Alisia

Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer 
en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is
door een geldig ondertekend document. The views expressed in  this message 
and any annex are purely those of the writer and may not be regarded as stating 
an official position of INBO, as long as the message is not confirmed by a duly 
signed document.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Looking for example of usage of function unz

2009-07-28 Thread Gabor Grothendieck
Also see ?zip.unpack

On Tue, Jul 28, 2009 at 8:15 AM, mau...@alice.it wrote:
 I would greatly appreciate some example of correct usage of function unz.
 I have to download and  uncompress the following web compressef file:
 ftp://ftp.sanger.ac.uk/pub/mirbase/targets/v5/arch.v5.txt.homo_sapiens.zip

 I tried the following command that does not work:

 Targets.rec - readLines(zz - 
 unz(ftp://ftp.sanger.ac.uk/pub/mirbase/targets/v5/arch.v5.txt.homo_sapiens.zip;))

 Thank you in advance,
 Maura



 tutti i telefonini TIM!


        [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] check for new files in a given directory

2009-07-28 Thread Uwe Ligges



Andreas Posch wrote:

I am trying to continuously evaluate online created data files using
R-algorithms. Is there any simple way to let R iteratively check for new
files in a given directory, load them and process them? I am using R on
Windows XP. 



See ?list.files and ?setdiff

Uwe Ligges



Any help would be highly appreciated.

Best, A.

 

 



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] xyplot, panel.abline, from, to

2009-07-28 Thread Afshartous, David
All,

I'm trying to truncate some lines that are added to an xyplot via
panel.abline to allow additional space for inserted text.  According to
?panel.abline it seems like from and to will do the trick but it does
not work for the sample code below.  Any hints much appreciated.

Cheers,
David

x = seq(1,8)
y.1 = .6*x + 3.5 + rnorm(8, 0, .5); y.2 = .4*x + 1 + rnorm(8,0, .5)
data.ex = data.frame( x.var = c(x,x), y.var = c(y.1, y.2), id = c(rep(y1,
8), rep(y2, 8)))

xyplot( y.var ~ x.var, data = data.ex, groups = id, pch = 16, panel =
function(...) {
   panel.abline(a = 2, b = .5, lty = 1,  from = 1, to = 8)
   panel.abline(a = 3.5, b = .6, lty = 3, from = 1, to = 8)
   panel.abline(a = 1, b = .4, lty = 4, from = 1, to = 8)
   panel.xyplot(...)
   }, scales = list(y = list(limits = c(0,10)), x = list(limits =
c(0,12)) ))
   

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Superscripts and rounding

2009-07-28 Thread Uwe Ligges



ehux wrote:

I am new to the world of R/programming so this may be a really easy question.
I thank you for your patience and help in advance 


I would like the characters km^2 to be displayed on the plot subtitle as km
squared - two as a superscript. 


I would also like to have the numbers from the data set for longitude and
latitude to be rounded to four decimal places.

Thank you.

plot (
  decade[['date']],
  decade[['value']],

  type = 'l',
  col = 'lightsteelblue4',
  ylab = 'Discharge [cms]',
  main = sprintf('%s [%s]', stn[['metadata']][['name']],
stn[['metadata']][['id']]),
  km^2 - expression
  sub = sprintf('Seasonal station with natural streamflow - Lat: %s Lon: %s
Gross Area %s km^2 - Effective Area %s km^2',
stn[['metadata']][['latitude']],
stn[['metadata']][['longitude']],stn[['metadata']][['grossarea']],
stn[['metadata']][['effectivearea']]),
  cex.sub = 1, font.sub = 3, col.sub = black
  )



Since I do not have the data I can only guess:

sub = substitute('Seasonal station with natural streamflow - Lat:' * a * 
' Lon:' * b * ' Gross Area ' * c * km^2 * ' - Effective Area ' * d * km^2',

list(a = stn[['metadata']][['latitude']],
 b = stn[['metadata']][['longitude']],
 c = stn[['metadata']][['grossarea']],
 d = stn[['metadata']][['effectivearea']]))


Uwe Ligges

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Skew-Normal Linear Mixed Model (SNLMM)

2009-07-28 Thread Raphael Fraser
Dear ALL,

In the Normal Linear Mixed Model (NLMM) we make the assumption that
the random effects are normally distributed. Is it possible to fit a
linear mixed model in R where the random effects are
assumed to have a Skew-Normal distribution? I am trying to reproduce
the results in the paper referenced below. Can anyone help?

Tsung I. Lin, Jack C. Lee. Estimation and prediction in linear mixed
models with skew-normal random effects for longitudinal data.
Statistics in Medicine 2008; 27 (9):1490–1507

Regards,
Raphael

--
Raphael A. Fraser, MSc
Lecturer in Biostatistics
Tropical Medicine Research Institute
Faculty of Medical Sciences
University of the West Indies
Mona Campus
Kingston, JAMAICA

Tel:  (876) 927-2471; 977-6151
Mobile: (876) 410-4699
Fax: (876) 927-2984
e-mail: raphael.fra...@uwimona.edu.jm

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] check for new files in a given directory

2009-07-28 Thread Barry Rowlingson
On Tue, Jul 28, 2009 at 12:36 PM, Ted
Hardingted.hard...@manchester.ac.uk wrote:

 However, this got me looking into '?list.files, and I see there
 (R version 2.9.0 (2009-04-17)):

  recursive: logical. Should the listing recurse into directories?

 But:

  Directories are included only if 'recursive = FALSE'.

 Surely the latter is the wrong way round, and should be

  Directories are included only if 'recursive = TRUE'.


 by 'included' it means 'returned'. If you do 'recursive=TRUE' it
scans recursively for files and only files. If you do
recursive=FALSE it returns files and directories in the specified
directory.

Makes it tricky to figure out a complete directory tree since empty
directories won't appear at all if recursive=TRUE. You'd have to
implement your own recursive search based on
list.files(d,recursive=FALSE) and then testing for directoriness

 Sucky, unless there's a better way...

Barry

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R freezes all the time.

2009-07-28 Thread Harerton Dourado

Hi from Brazil,

I have installed the latest version of R in my system (WinXP SP3) but R 
is constantly freezing. Sometimes it happens after loading a module, 
sometimes it happens when I switch to an othe opened program, sometimes 
after loading or saving a workspace or after viewing a plot and 
sometimes it just  happens while I am just visualizing R screen.


I have reinstalled R and also my video driver but that freezing keeps 
happening.


Any ideas?

Thanks!

Harerton

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Graphing Significant difference

2009-07-28 Thread BrightK

I am new to R and would appreciate help in dealing with this problem.

I worked on a some African grasses and have a  matrix based on TukeyHSD test
showing how the species differ from each other. A value of 1 means they
DON't differ significantly from each other, whiles 0 means they differ
significantly from each other.

I want to assign letters to these combination and show them on a histogram.
How to I go about this. I attach the file to the mail and look forward to
hearing for you http://www.nabble.com/file/p24697164/R-request-Bright.xls
R-request-Bright.xls .

Bright 
-- 
View this message in context: 
http://www.nabble.com/Graphing-Significant-difference-tp24697164p24697164.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] pairs plot

2009-07-28 Thread John Kane

Have you installed it first?  
First: 
install.packages(TeachingDemos)
Then:
library(TeachingDemos)


--- On Tue, 7/28/09, Jose Narillos de Santos narillosdesan...@gmail.com wrote:

 From: Jose Narillos de Santos narillosdesan...@gmail.com
 Subject: Re: [R] pairs plot
 To: Petr PIKAL petr.pi...@precheza.cz, r-help@r-project.org, 
 greg.s...@imail.org
 Received: Tuesday, July 28, 2009, 8:24 AM
 Hi,
 
 I tried to load typing library(TeachingDemos)
 
 But the message can´t find package TeachingDemos) occurs.
 I use versión
 R 2.9 on windows.
 
 Can you please guide me?
 
 Sorry¡¡¡
 
 
 
 
 
 2009/7/28, Petr PIKAL petr.pi...@precheza.cz:
 
  Hi
 
  r-help-boun...@r-project.org
 napsal dne 28.07.2009 09:55:11:
 
   Hi Greg I saw, read, the TeachingDemos you
 suggesttef but when run
  pairs2
   function on my R module says Can´t find
 function pairs2
  
   How can I load the module or function pairs2?
 
  Did you do
 
  library(TeachingDemos)?
 
  Regards
  Petr
 
 
  
   Thanks in advance for your help.
  
   You are the best.
  
   2009/7/27, Greg Snow greg.s...@imail.org:
   
Look at the pairs2 function in the
 TeachingDemos package.
   
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111
   
   
 -Original Message-
 From: r-help-boun...@r-project.org
 [mailto:r-help-boun...@r-
 project.org] On Behalf Of Jose Narillos
 de Santos
 Sent: Monday, July 27, 2009 9:02 AM
 To: r-help@r-project.org
 Subject: [R] pairs plot

 Hi all,

 I want to plot trough pairs() plot a
 matrix with 4 columns. I want
  to
 make a
 trhee plot in a graph. Plotting pairs
 colum 2,3,4 on y axis and 1 on
  X
 axis.

 You mean (a plot with three graphs)
 ommitting the first pair with
 itself.
 And only the pairs with colum 1 with
 the other not all pairs.

 I. e. this matrix

 4177 289390 8740 17220
 3907 301510 8530 17550
 3975 316970 8640 17650
 3651 364220 9360 21420
 3031 387390 9960 23410
 2912 430180 11040 25820
 3018 499930 12240 27620
 2685 595010 13800 31670
 2884 661870 14760 37170

 Thanks in advance.

   
    [[alternative HTML version deleted]]


 __
 R-help@r-project.org
 mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-
 guide.html
 and provide commented, minimal,
 self-contained, reproducible code.
   
  
      [[alternative HTML version
 deleted]]
  
   __
   R-help@r-project.org
 mailing list
   https://stat.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide
  http://www.R-project.org/posting-guide.html
   and provide commented, minimal, self-contained,
 reproducible code.
 
 
 
     [[alternative HTML version deleted]]
 
 
 -Inline Attachment Follows-
 
 __
 R-help@r-project.org
 mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained,
 reproducible code.
 


  __
Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your 
favourite sites. Download it now
http://ca.toolbar.yahoo.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R package for Hierarchical Modelling of Multinomial Logistic Regression

2009-07-28 Thread nikolay12

Hello, 

I need to implement a hierarchical model for Bayesian multinomial logistic
regression (also known as polytomous logistic regression). I plan to use
Gaussian priors. I have about 800 variables which are mostly dichotomous.
Some are integer valued.

What R package would you recommend?

thanks,

Nick
-- 
View this message in context: 
http://www.nabble.com/R-package-for-Hierarchical-Modelling-of-Multinomial-Logistic-Regression-tp24694202p24694202.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] create dataset permanently in package (i.e. default or our own package)

2009-07-28 Thread Albert EINstEIN

Hi,
Thanks for your support. we are not getting any thing from your code. i.e.
we are unable to creating new package and adding dataset to that new
package. so can you help me out in other way i.e.
how to add a new dataset to default R distributions like cars and
datasets. these two are default distributions (i.e. packages). so please
help us in this aspect.

Thanks in advance.

-- 
View this message in context: 
http://www.nabble.com/create-dataset-permanently-in-package-%28i.e.-default-or-our-own-package%29-tp24679076p24694060.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Downloaded file is larger than the starting file

2009-07-28 Thread DeWitt Payne

I'm running R for windows 2.9.1.  When I use a script to download a file from 
the internet, the file is 1,496 bytes larger than the reported file size in the 
download process.  It doesn't give the correct answer when I process it but it 
doesn't appear to be completely corrupt as the processing script runs.  I can 
download the file from Firefox and the size of the downloaded file is correct.  
I tried starting with the internet2 flag set and it didn't help.  The url of 
the file is:
http://iup.physik.uni-bremen.de:8084/amsredata/asi_daygrid_swath/l1a/n6250/2009/jun/asi-n6250-20090603-v5.hdf
 . Is this a bug or do I have some configuration problem with my computer?

Thanks,

DeWitt Payne

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] how to add a new dataset to default R distributions

2009-07-28 Thread Albert EINstEIN

Hi,
Thanks for your support. we are not getting any thing from your code. i.e.
we are unable to creating new package and adding dataset to that new
package. so can you help me out in other way i.e.
how to add a new dataset to default R distributions like cars and
datasets. these two are default distributions (i.e. packages). so please
help us in this aspect.

Thanks in advance. 
-- 
View this message in context: 
http://www.nabble.com/how-to-add-a-new-dataset-to-default-R-distributions-tp24696796p24696796.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] useR! 2010

2009-07-28 Thread Mullen, Katharine Megan
We are happy to announce that the R user conference

   useR! 2010

is scheduled for July 21-23, 2010, and will take place at the campus
of the National Institute of Standards and Technology (NIST) in
Gaithersburg, Maryland, USA.

As for the predecessor conferences, the program will consist of two
parts: invited lectures and user-contributed sessions (abstract
submission will be available online starting from October 2009). Prior
to the conference, there will be tutorials on R (proposals for
tutorials should be sent before 2009-11-01).

INVITED LECTURES

Invited speakers will include

Mark Handcock, Frank Harrell Jr, Friedrich Leisch, Michael Meyer,  
Richard Stallman, Luke Tierney, Diethelm Wuertz.

USER-CONTRIBUTED SESSIONS

The sessions will be a platform to bring together R users,
contributors, package maintainers and developers in the S spirit that
`users are developers'. People from different fields will show us how
they solve problems with R in fascinating applications.  
The sessions are organized by members of the program committee,
including

 Dirk Eddelbuettel, John Fox, Virgilio Gomez-Rubio, 
 Richard Heiberger, Torsten Hothorn, Aaron King, Jan de Leeuw,
 Nicholas Lewin-Koh, Andy Liaw, Uwe Ligges, Martin Maechler,
 Katharine Mullen, Heather Turner, Ravi Varadhan, H. D. Vinod,
 John Verzani, Alan Zaslavsky, Achim Zeileis.

The program will cover topics such as

 * Applied Statistics  Biostatistics
 * Bayesian Statistics
 * Bioinformatics
 * Chemometrics and Computational Physics
 * Data Mining
 * Econometrics  Finance
 * Environmetrics  Ecological Modeling
 * High Performance Computing
 * Machine Learning
 * Marketing  Business Analytics
 * Psychometrics
 * Robust Statistics
 * Social network analysis
 * Spatial Statistics
 * Statistics in the Social and Political Sciences
 * Teaching
 * Visualization  Graphics
 * and many more.

PRE-CONFERENCE TUTORIALS

Before the official program, half-day tutorials will be offered on
Tuesday, July 20th.

We invite R users to submit proposals for three hour tutorials on
special topics on R. The proposals should give a brief description of
the tutorial, including goals, detailed outline, justification why the
tutorial is important, background knowledge required and potential
attendees. The proposals should be sent before 2009-11-01 to useR-2010
at R-project.org.

CONFERENCE WEBPAGE

A webpage offering more information is available at

   http://www.R-project.org/useR-2010

IMPORTANT DATES

   2009-10-01   open submission of abstracts 
   2009-10-01   open registration
   2009-11-01   tutorial submission deadline
   2010-03-01   early registration deadline
   2010-03-01   submission deadline for abstracts
   Before 2010-03-15notification of acceptance
   2010-06-20   registration deadline (later registration NOT possible on site) 
   2010-07-20   tutorials
   2010-07-21   conference start
   2010-07-23   conference end

We hope to meet you in Gaithersburg!

The organizing committee:
 Nathan Dodder, William Guthrie, Walter Liggett, John Lu,
 Katharine Mullen, Jonathon Phillips, Antonio Possolo, 
 Ravi Varadhan.

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

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Reg: Creation of own Package and Permanent Dataset in R

2009-07-28 Thread RAJ
Hi,

This is Raj from ClinAsia and we have a small query with respect to R 
Statistical Package. 

Our Query:

Actually while opening R console and R commander we see some packages like car 
and datasets. In these packages we have default datasets. 
For example: Women and Prestige so on. Now we created a Sales dataset 
importing either from excel, xml or text file. Now we are trying to store that 
dataset permanently  in any one of the packages mentioned above (car or 
datasets). I am able to create them temporarily untill that pirticular session.

But once we close the session and try to log into R Console and R Commander. We 
are not able to find the earlier created datasets Sales in the packages (Car 
and Datasets). Kindly suggest how to create permanent datasets in packages and 
also suggest how to create our own packages. 

If possible please send us the code it will be very helpful for us. 

Thanks and Regards,
Raj
ClinAsia
91-40-20010112


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] help

2009-07-28 Thread Inchallah Yarab
How I can vary the parameters for a function? 

I have a function with 5 parameters I want to turn the function for a range of 
numbers for one of these parameters!! i want to have in the end the value of 
the function in the different cas of one of the paramter (the others paramters 
are fixes!!) thank you for your help


  
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] xyplot, panel.abline, from, to

2009-07-28 Thread Philipp Pagel
On Tue, Jul 28, 2009 at 09:23:58AM -0400, Afshartous, David wrote:
 All,
 
 I'm trying to truncate some lines that are added to an xyplot via
 panel.abline to allow additional space for inserted text.  According to
 ?panel.abline it seems like from and to will do the trick but it does
 not work for the sample code below.  Any hints much appreciated.

As far as I understand, 'from' and 'to' are not parameters of
panel.abline. Have a look at panel.segements for arbitrary lines
(altough you will not be able to use intercept and slope in that
case).

cu
Philipp

-- 
Dr. Philipp Pagel
Lehrstuhl für Genomorientierte Bioinformatik
Technische Universität München
Wissenschaftszentrum Weihenstephan
85350 Freising, Germany
http://webclu.bio.wzw.tum.de/~pagel/

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R freezes all the time.

2009-07-28 Thread stephen sefick
How much RAM do you have on the machine?

On Tue, Jul 28, 2009 at 8:42 AM, Harerton Douradoharer...@terra.com.br wrote:
 Hi from Brazil,

 I have installed the latest version of R in my system (WinXP SP3) but R is
 constantly freezing. Sometimes it happens after loading a module, sometimes
 it happens when I switch to an othe opened program, sometimes after loading
 or saving a workspace or after viewing a plot and sometimes it just  happens
 while I am just visualizing R screen.

 I have reinstalled R and also my video driver but that freezing keeps
 happening.

 Any ideas?

 Thanks!

 Harerton

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




-- 
Stephen Sefick

Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods.  We are mammals, and have not exhausted the
annoying little problems of being mammals.

-K. Mullis

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Determine the dimension-names of an element in an array in R

2009-07-28 Thread Poersching
Hey,
I think I have a solution for your problem:

Correl-apply(DataArray_1,1:3, function(d1)
  apply(DataArray_2,c(2,1,3), function(d) cor(d1,d))
)
Correl-Correl[1:4,,,]
dimnames(Correl)[[1]]-c
Correl-aperm(Correl,c(2,3,1,4))

This one should work. :-)

Best Regards,
Christian

Sauvik De schrieb:
 Hi there,

 Thanks again for your reply. I know for-loop is always a solution to
 my problem and I had already coded using for-loop. But the number of
 levels for each dimension is large enough in actual problem and hence
 it was time-consuming.
 So, I was just wondering if there are any other alternative way-outs
 to solving my problem. That's why I tried with apply functions
 (sapply)assuming that this might work out faster even fractionally as
 compared to for-loop.

 Cheers,
 Sauvik

 On Mon, Jul 27, 2009 at 12:28 AM, Poersching poerschin...@web.de
 mailto:poerschin...@web.de wrote:

 Sauvik De schrieb:
 Hi:
 Lots of thanks for your valuable time!

 But I am not sure how you would like to use the function in this
 situation.

 As I had mentioned that the first element of my output array
 should be like:

 
 cor(DataArray_1[dimnames(Correl)[[1]][1],dimnames(Correl)[[2]][1],dimnames(Correl)[[4]][1],],DataArray_2[dimnames(Correl)[[1]][1],dimnames(Correl)[[3]][1],dimnames(Correl)[[4]][1],],use=pairwise.complete.obs)

 in my below code.

 and

 the output array of correlation I wish to get using sapply as
 follows:

 Correl = sapply(Correl,function(d)
 cor(DataArray_1[...],DataArray_2[...],
 use=pairwise.complete.obs))

 So it would be of great help if you could kindly specify how to
 utilise your function findIndex in ...

 Apologies for all this!

 Thanks  Regards,
 Sauvik

 Hey,
 sorry, I haven't understood your problem last time, but now this
 solution should solve your problem, so I hope. :-)
 It's only a for to loop, but an apply function may work too. I
 will think about this, but for now...  ;-)

 la-length(a)
 lb-length(b)
 lc-length(c)
 ld-length(d)
 for (ia in 1:la) {
   for (ib in 1:lb) {
 for (ic in 1:lc) {
   for (id in 1:ld) {
 Correl[ia,ib,ic,id]-cor(
  DataArray_1[dimnames(Correl)[[1]][ia],
  dimnames(Correl)[[2]][ib],
  dimnames(Correl)[[4]][id],]
  ,
  DataArray_2[dimnames(Correl)[[1]][ia],
   dimnames(Correl)[[3]][ic],
   dimnames(Correl)[[4]][id],]
  ,
  use=pairwise.complete.obs)
   }
 }
   }
 }
 ## with function findIndex you can find the dimensions with
 ## i.e. cor values greater 0.5 or smaller -0.5, like:
 findIndex(Correl,Correl[Correl0.5])
 findIndex(Correl,Correl[Correl(-0.5)])

 I have changed the code of the function findIndex in line which
 contents: el[j]-which(is.element(data,element[j]))

 Rigards,
 Christian


 On Sun, Jul 26, 2009 at 3:54 PM, Poerschingpoerschin...@web.de
 mailto:poerschin...@web.de wrote:
  Sauvik De schrieb:
 
  Hi Gabor:
  Many thanks for your prompt reply!
  The code is fine. But I need it in more general form as I had
 mentioned that
  I need to input any 0 to find its dimension-names.
 
  Actually, I was using sapply to calculate correlation and
 this idea was
  required in the middle of correlation calculation.
  I am providing the way I tried my calculation.
 
  a= c(A1,A2,A3,A4,A5)
  b= c(B1,B2,B3)
  c= c(C1,C2,C3,C4)
  d= c(D1,D2)
  e= c(E1,E2,E3,E4,E5,E6,E7,E8)
 
  DataArray_1 = array(c(rnorm(240)),dim=c(length(a),length(b),
  length(d),length(e)),dimnames=list(a,b,d,e))
  DataArray_2 = array(c(rnorm(320)), dim=c(length(a),length(c),
  length(d),length(e)),dimnames=list(a,c,d,e))
 
  #Defining an empty array which will contain the correlation
 values (output
  array)
  Correl = array(NA, dim=c(length(a),length(b),
  length(c),length(d)),dimnames=list(a,b,c,d))
 
  #Calculating Correlation between attributes b  c over values of e
  Correl = sapply(Correl,function(d)
 cor(DataArray_1[...],DataArray_2[...],
  use=pairwise.complete.obs))
 
  This is where I get stuck.
  In the above, d is acting as an element in the Correl array.
 Hence I need
  to get the dimension-names for d.
 
  #The first element of Correl will be:
 
 
 cor(DataArray_1[dimnames(Correl)[[1]][1],dimnames(Correl)[[2]][1],dimnames(Correl)[[4]][1],],DataArray_2[dimnames(Correl)[[1]][1],dimnames(Correl)[[3]][1],dimnames(Correl)[[4]][1],],use=pairwise.complete.obs)
 
  So my problem boils down to extracting the dim-names in terms
 of element(d)
  and not in terms of Correl (that I have mentioned as ... in
 the above
  code)
 
  My sincere thanks for your valuable time  

Re: [R] How to deal with this random variable?

2009-07-28 Thread Manuel Ramon

Thank you for your replay Bert. You are right, is complicated to get a good
response when people do not know how the experiment was conducted, etc. The
main problem, maybe, is that this experiment has a wrong design being
complicated to get some good conclusion from it. I read this forum
frequently and I found a lot of useful information on it. For that reason I
decided to ask to the forum; maybe someone can help us.
Thank you again for your response Bert.



Bert Gunter wrote:
 
 This sounds way too complicated for this forum, which is designed to
 provide
 help to users on the  use of the R language, not remote statistical
 consulting. While you may receive replies, I would argue that you would do
 better to find a local statistical expert with whom to work -- not least
 because they should probably have a deep understanding of how your
 experiment was conducted, data gathered, measurements made, etc. to be
 able
 to give you worthwhile advice.
 
 Long distance consulting based on incomplete understanding is very risky.
 Caveat emptor!
 
 Bert Gunter
 Genentech Nonclinical Biostatistics
 
 
 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
 On
 Behalf Of Manuel Ramon
 Sent: Monday, July 27, 2009 9:54 AM
 To: r-help@r-project.org
 Subject: [R] How to deal with this random variable?
 
 
 Hello to everybody,
 I have a data frame with 100 measures of quality for 3 variables: A, B and
 C. These quality variables are measured in diferent times along the
 productive process. My data comes from 5 experiments (5 replicates with 20
 measures for replicate). I also have a final measure (Z) but just one
 measure for each unit, that is, for the 20 units that are measured on each
 replica. 
 
 My objetive is to study the relationships between the 3 quality parameters
 with the last measure, that is:
  
   lm(Z ~ A+B+C, data=mydata)
 
 I have found significant differences between replicas for each qualite
 parameters (A, B and C) and I would like to include the replica effect as
 a
 random effect:
 
   lme(Z ~ A+B+C, data=mydata, random=~1|replica)
 
 And here is my problem. I know that there are signifficant diferences
 between replicas but since the final measure, Z, is the same for each
 replica I do not know how to deal with. 
 
 Can you help me? How could I take into account the variability due to the
 replica when I want to study the effects of variables A, B and C on the
 final result of a productive process?
 
 Thank you in advance.
 
 -
 Manuel Ramón Fernández
 Group of Reproductive Biology (GBR)
 University of Castilla-La Mancha (Spain)
 mra...@jccm.es
 -- 
 View this message in context:
 http://www.nabble.com/How-to-deal-with-this-random-variable--tp24684341p2468
 4341.html
 Sent from the R help mailing list archive at Nabble.com.
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
 
 


-
Manuel Ramón Fernández
Group of Reproductive Biology (GBR)
University of Castilla-La Mancha (Spain)
mra...@jccm.es
-- 
View this message in context: 
http://www.nabble.com/How-to-deal-with-this-random-variable--tp24684341p24695050.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] xyplot, panel.abline, from, to

2009-07-28 Thread Peter Ehlers

David,
?panel.abline does not indicate that 'from/to' are arguments to
that function. If you read the help page carefully, you'll see
that 'from/to' apply to panel.curve(). Perhaps you thought that
the '...' argument can take 'from/to'; again the help page makes
it clear that those are to be *graphical* parameters.

One quick fix would be to use panel.curve with, e.g. expr set to
a + b*x:
panel.curve(2 + .5*x, ...)

Peter Ehlers

Afshartous, David wrote:

All,

I'm trying to truncate some lines that are added to an xyplot via
panel.abline to allow additional space for inserted text.  According to
?panel.abline it seems like from and to will do the trick but it does
not work for the sample code below.  Any hints much appreciated.

Cheers,
David

x = seq(1,8)
y.1 = .6*x + 3.5 + rnorm(8, 0, .5); y.2 = .4*x + 1 + rnorm(8,0, .5)
data.ex = data.frame( x.var = c(x,x), y.var = c(y.1, y.2), id = c(rep(y1,
8), rep(y2, 8)))

xyplot( y.var ~ x.var, data = data.ex, groups = id, pch = 16, panel =
function(...) {
   panel.abline(a = 2, b = .5, lty = 1,  from = 1, to = 8)
   panel.abline(a = 3.5, b = .6, lty = 3, from = 1, to = 8)
   panel.abline(a = 1, b = .4, lty = 4, from = 1, to = 8)
   panel.xyplot(...)
   }, scales = list(y = list(limits = c(0,10)), x = list(limits =
c(0,12)) ))
   


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Kernlab - Splinedot Kernel

2009-07-28 Thread Mark McDowall

   Hi,
   I am trying to use the splinedot kernel as part of the kernlab package, but
   I get the following error:

 Error in votematrix[i, ret  0] - votematrix[i, ret  0] + 1 :
   NAs are not allowed in subscripted assignments

   The parameters that I have used to build the model are:

 SVMmodel   -  ksvm(Classification~.,  data=dsTrain,  type=C-svc,
 kernel=splinedot, C=1)

   My training set does not contain NAs and all of the values range between 0
   to 1.
   I am using R version 2.7.0.
   If  anyone  has used ksvm with the splinedot kernel, any tips would be
   greatfully accepted.
   Mark

-- 
Mark McDowall
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] how to add a new dataset to default R distributions

2009-07-28 Thread Gavin Simpson
On Tue, 2009-07-28 at 04:54 -0700, Albert EINstEIN wrote:
 Hi,
 Thanks for your support. we are not getting any thing from your code. i.e.
 we are unable to creating new package and adding dataset to that new
 package. so can you help me out in other way i.e.
 how to add a new dataset to default R distributions like cars and
 datasets. these two are default distributions (i.e. packages). so please
 help us in this aspect.
 
 Thanks in advance. 

Highly likely that that won't happen as you are asking R Core to
maintain your data sets. You should use a package for this - hundreds of
other useRs have done so!

Given that creating your own package is easy once you've read R Exts
manual:

http://cran.r-project.org/doc/manuals/R-exts.html

despite seeming a bit daunting at first if you are new to this kind of
thing. And creating a data set is as easy as getting the data into R and
formatting it as required and then, if the data are in object 'foo'
doing:

save(foo, file = foo.rda)

Then move the foo.rda file to the data directory in your package
structure (see ?package.skeleton to do even this bit for you). Then
write an Rd help page to describe the data, and that data set is
included.

You can store your data in other formats (csv say) and there you don't
even need to get it into R first, just drop the csv file in the ./data
directory.

Given that you completely fail to provide *any* of the requested
information mentioned in the posting guide, how can we help you? You
don't tell us what didn't work. Given the evidence of this and other
posts, I suspect lack of effort on your part yet you seem to be
requesting more and more help from the rest of us.

Read the posting guide and form an appropriate posting and then maybe
people on the list can sort out what is not working for you.

G

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,  [f] +44 (0)20 7679 0565
 Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London  [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT. [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] check for new files in a given directory

2009-07-28 Thread Ted Harding
On 28-Jul-09 13:40:31, Barry Rowlingson wrote:
 On Tue, Jul 28, 2009 at 12:36 PM, Ted
 Hardingted.hard...@manchester.ac.uk wrote:
 However, this got me looking into '?list.files, and I see there
 (R version 2.9.0 (2009-04-17)):

 _recursive: logical. Should the listing recurse into directories?

 But:

 _Directories are included only if 'recursive = FALSE'.

 Surely the latter is the wrong way round, and should be

 _Directories are included only if 'recursive = TRUE'.
 
  by 'included' it means 'returned'. If you do 'recursive=TRUE' it
 scans recursively for files and only files. If you do
 recursive=FALSE it returns files and directories in the specified
 directory.
 
 Makes it tricky to figure out a complete directory tree since empty
 directories won't appear at all if recursive=TRUE. You'd have to
 implement your own recursive search based on
 list.files(d,recursive=FALSE) and then testing for directoriness
 
  Sucky, unless there's a better way...
 Barry

Thanks for the clarification, Barry! I hadn't appreciated all that
(I think the wording of ?list.files is misleading here).

I agree that it can leave you falling between two stools in the
sort of situation you describe. Which, as it happens, leads me back
to the use of system(...) in Unix/Linux systems. For example, to
list all the directories (without their files) in the current
directory you could do:

  system(find . -type d -print)

which finds (recursively) everything in and under the current
directory (.) which is of type directory (d).

Likewise, the 'ls' command with suitable options (perhaps combined
with judicious 'grep'ping) can enable you to select what you want.
For example, if something is planting data files with extension
.dat from time to time,

  system(ls -tr *.dat)

would list all files with extension .dat in time (-t) order
reversed (r) (most recent last). Again, find could be useful.
Suppose the last one of such files you accessed was lastfile.dat;
then:

  system(find -maxdepth 0 -newer lastfile.dat -name '*.dat' -print)

would find, in the current directory only (-depth 0) all files
with extension .dat (-name '*.dat') which are newer than the
given file lastfile.dat.

It is for reasons of flexibility like this that I use system() for
this kind of thing anyway (with 'intern=TRUE' if the results are to
be saved in a variable), so I hadn't looked into list.files() before!

Ted.


E-Mail: (Ted Harding) ted.hard...@manchester.ac.uk
Fax-to-email: +44 (0)870 094 0861
Date: 28-Jul-09   Time: 15:24:09
-- XFMail --

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] formatting in r

2009-07-28 Thread Mary A. Marion

Hello,

I have output that I want to print out.  I am having a few issues.

1] output u to power is really nothing more than a 2 x 11 set of values 
formed using cbind function

   and printed out as a data frame
   How can I get it to output over several lines such as seen here?

2] Critical Z etc. were added by hand.  I need an example of how I can 
mix alphanumeric

   and numeric data on output.

Can you assist?  R is proving to be a really fine computational language 
that is easy to use.


Thank you.
Sincerely,
Mary A. Marion

  u  xbar  alpha  zcrit  zcrit2  zstatpvalue  
140   150.05 1.64491.96  4  6.334248e-05


  LB95  UB95LB90UB90
 145.1 154.9 145.888 154.112

Beta Power
 0.021 0.979

Critical Z = 1.645
Zstatistic = 4
Empirical Mean   150[ 135.1, 144.9 ) = Ao(µo)
Population Mean  140[ 145.1, 154.9 ] = C(x)
Pvalue   .0001

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] help

2009-07-28 Thread Ted Harding
On 28-Jul-09 08:28:22, Inchallah Yarab wrote:
 How I can vary the parameters for a function? 
 
 I have a function with 5 parameters I want to turn the function for a
 range of numbers for one of these parameters!! i want to have in the
 end the value of the function in the different cas of one of the
 paramter (the others paramters are fixes!!) thank you for your help

It depends on the internals of the function. In R, most functions
(including what you write yourself, if written in the right way)
allow you to give a vector of numbers to a numerical parameter.
The calculations are then vectorised in a single pass, and the
results for each value are returned as a vector.

For example, the pnorm() function for several different standard
deviations:

  SD = c(1,1.5,2,2.5,3)
  cbind(SD,pnorm(q=0.5, mean=0, sd=SD))
  # [1,] 1.0 0.6914625
  # [2,] 1.5 0.6305587
  # [3,] 2.0 0.5987063
  # [4,] 2.5 0.5792597
  # [5,] 3.0 0.5661838

Likewise, if your function is

  my.fun - function(par1,par2,par3,par4,par5){
(par1 + par2*par3 + (par3^2)*(par4 + par5))
  }

then you could have

  par1 - 1.1 ; par2 - 1.2 ; par4 - 1.4; par5 - 1.5
  par3 - SD # (as above)
  cbind(SD,my.fun(par1,par2,par3,par4,par5))
  #   SD   
  # [1,] 1.0  5.200
  # [2,] 1.5  9.425
  # [3,] 2.0 15.100
  # [4,] 2.5 22.225
  # [5,] 3.0 30.800

Hoping this helps!
Ted.


E-Mail: (Ted Harding) ted.hard...@manchester.ac.uk
Fax-to-email: +44 (0)870 094 0861
Date: 28-Jul-09   Time: 15:39:27
-- XFMail --

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] re ading jpeg images?

2009-07-28 Thread Hans W. Borchers

I found the 'biOps' package for Image and data analysis quite helpful.
(I did some astronomical investigations with it --- counting galaxies in
 a Hubble picture---and I do recommend this package.)

Under Windows you have to unpack the 'libjpeg' and 'libtiff' libraries
beforehand somewhere in your path.
See finzi.psych.upenn.edu/Rhelp08/2009-April/194630.html for a link
to download all necessary libraries as a zip-file.

If this link to RapidShare does not work anymore, I think I still have
that file somewhere and could send it to you by e-mail.

Regards
Hans Werner



Robert Biddle wrote:
 
 
Can someone advise me what the most sensible way is to read jpeg
 images?
 
For our work with image analysis and eye-tracking we have been using
 the
rimage package, on both Macs and Windows PCs. But while setting up a
 new
Windows machine yesterday, I see that rimage is regarded as orphaned,
 and no
Windows binary is available. I eventually found an old zip file for the
package,  so  I am not stuck, but I wonder what the right way is to go
forward. I did find the readimages package, but it also seemed
 problematic
to install on both Windows on Mac, requiring extra software that it was
itself unclear how to install.
 
Is there some simpler solution I should be looking at?
 
Are jpeg files so probematic I should be converting them to some other
format and using a different package to read that?
 
 
Thanks
 
Robert Biddle
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
 
 

-- 
View this message in context: 
http://www.nabble.com/reading-jpeg-images--tp24698332p24700340.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Downloaded file is larger than the starting file

2009-07-28 Thread Uwe Ligges

We cannot know without seeing your script.

Uwe Ligges



DeWitt Payne wrote:

I'm running R for windows 2.9.1.  When I use a script to download a file from 
the internet, the file is 1,496 bytes larger than the reported file size in the 
download process.  It doesn't give the correct answer when I process it but it 
doesn't appear to be completely corrupt as the processing script runs.  I can 
download the file from Firefox and the size of the downloaded file is correct.  
I tried starting with the internet2 flag set and it didn't help.  The url of 
the file is:
http://iup.physik.uni-bremen.de:8084/amsredata/asi_daygrid_swath/l1a/n6250/2009/jun/asi-n6250-20090603-v5.hdf
 . Is this a bug or do I have some configuration problem with my computer?

Thanks,

DeWitt Payne

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] create dataset permanently in package (i.e. default or our own package)

2009-07-28 Thread Petr PIKAL
Hi

If you want to use brute force without much knowledge about packages

make your own directory in librarary directory
select any package in your library directory and copy it to directory you 
just made
leave only INDEX and DESCRIPTION files and R and Data directorires
change DESCRIPTION file according your wish, leave INDEX as is.
in R directory put any text file which will contain any of your custom 
functions
in Data directory put any text file which will contain your data
in etc directory change Rprofile.site and add something like

library(fun)
data(modely)
data(stand)

it may work, however if you want to be serious with your own package(s) 
you shall follow advice in R-exts.html manual as was advised earlier.

Regards
Petr

r-help-boun...@r-project.org napsal dne 28.07.2009 11:40:06:

 
 Hi,
 Thanks for your support. we are not getting any thing from your code. 
i.e.
 we are unable to creating new package and adding dataset to that new
 package. so can you help me out in other way i.e.
 how to add a new dataset to default R distributions like cars and
 datasets. these two are default distributions (i.e. packages). so 
please
 help us in this aspect.
 
 Thanks in advance.
 
 -- 
 View this message in context: http://www.nabble.com/create-dataset-
 
permanently-in-package-%28i.e.-default-or-our-own-package%29-tp24679076p24694060.html
 Sent from the R help mailing list archive at Nabble.com.
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] xyplot, panel.abline, from, to

2009-07-28 Thread Deepayan Sarkar
On Tue, Jul 28, 2009 at 6:58 AM, Peter Ehlersehl...@ucalgary.ca wrote:
 David,
 ?panel.abline does not indicate that 'from/to' are arguments to
 that function. If you read the help page carefully, you'll see
 that 'from/to' apply to panel.curve(). Perhaps you thought that
 the '...' argument can take 'from/to'; again the help page makes
 it clear that those are to be *graphical* parameters.

 One quick fix would be to use panel.curve with, e.g. expr set to
 a + b*x:
 panel.curve(2 + .5*x, ...)

Yes, that would be my suggestion too, or using panel.segments

  fab - function(x) a + b * x
  panel.segments(from, fab(from), to, fab(to))

-Deepayan

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] pairs plot

2009-07-28 Thread Petr PIKAL
r-help-boun...@r-project.org napsal dne 28.07.2009 15:39:03:

 
 Have you installed it first? 
 First: 
 install.packages(TeachingDemos)

Or if you have problems with correct setting through corporate network 
rules (like myself) you can download a zip (for Windows) version and unzip 
it to library subdirectory.

 Then:
 library(TeachingDemos)

shall be executed without problem

Regards
Petr


 
 
 --- On Tue, 7/28/09, Jose Narillos de Santos 
narillosdesan...@gmail.com wrote:
 
  From: Jose Narillos de Santos narillosdesan...@gmail.com
  Subject: Re: [R] pairs plot
  To: Petr PIKAL petr.pi...@precheza.cz, r-help@r-project.org, 
greg.s...@imail.org
  Received: Tuesday, July 28, 2009, 8:24 AM
  Hi,
  
  I tried to load typing library(TeachingDemos)
  
  But the message can´t find package TeachingDemos) occurs.
  I use versión
  R 2.9 on windows.
  
  Can you please guide me?
  
  Sorry¡¡¡
  
  
  
  
  
  2009/7/28, Petr PIKAL petr.pi...@precheza.cz:
  
   Hi
  
   r-help-boun...@r-project.org
  napsal dne 28.07.2009 09:55:11:
  
Hi Greg I saw, read, the TeachingDemos you
  suggesttef but when run
   pairs2
function on my R module says Can´t find
  function pairs2
   
How can I load the module or function pairs2?
  
   Did you do
  
   library(TeachingDemos)?
  
   Regards
   Petr
  
  
   
Thanks in advance for your help.
   
You are the best.
   
2009/7/27, Greg Snow greg.s...@imail.org:

 Look at the pairs2 function in the
  TeachingDemos package.

 --
 Gregory (Greg) L. Snow Ph.D.
 Statistical Data Center
 Intermountain Healthcare
 greg.s...@imail.org
 801.408.8111


  -Original Message-
  From: r-help-boun...@r-project.org
  [mailto:r-help-boun...@r-
  project.org] On Behalf Of Jose Narillos
  de Santos
  Sent: Monday, July 27, 2009 9:02 AM
  To: r-help@r-project.org
  Subject: [R] pairs plot
 
  Hi all,
 
  I want to plot trough pairs() plot a
  matrix with 4 columns. I want
   to
  make a
  trhee plot in a graph. Plotting pairs
  colum 2,3,4 on y axis and 1 on
   X
  axis.
 
  You mean (a plot with three graphs)
  ommitting the first pair with
  itself.
  And only the pairs with colum 1 with
  the other not all pairs.
 
  I. e. this matrix
 
  4177 289390 8740 17220
  3907 301510 8530 17550
  3975 316970 8640 17650
  3651 364220 9360 21420
  3031 387390 9960 23410
  2912 430180 11040 25820
  3018 499930 12240 27620
  2685 595010 13800 31670
  2884 661870 14760 37170
 
  Thanks in advance.
 

 [[alternative HTML version deleted]]
 
 
  __
  R-help@r-project.org
  mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide 
http://www.R-project.org/posting-
  guide.html
  and provide commented, minimal,
  self-contained, reproducible code.

   
   [[alternative HTML version
  deleted]]
   
__
R-help@r-project.org
  mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
   http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained,
  reproducible code.
  
  
  
  [[alternative HTML version deleted]]
  
  
  -Inline Attachment Follows-
  
  __
  R-help@r-project.org
  mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html
  and provide commented, minimal, self-contained,
  reproducible code.
  
 
 
   __
 Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark 
your 
 favourite sites. Download it now
 http://ca.toolbar.yahoo.com.
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Superscripts and rounding

2009-07-28 Thread ehux


  sub = sprintf('Seasonal station with natural streamflow - Lat: %s Lon: %s
Gross Area %s km^2 - Effective Area %s km^2',
stn[['metadata']][['latitude']],
stn[['metadata']][['longitude']],stn[['metadata']][['grossarea']],
stn[['metadata']][['effectivearea']]),

I tried your code and a few variations, but was able to make it work  - Uwe
(but thank you!!)

I am having no problem with retrieving the data for the above code. i would
just like the sub-title to display the units after the data correctly (aka
km suberscript 2 - instead of km^2). In addition i want the numbers being
pulled from the database to round to four decimal places as currently the
lat and lon come in as huge numbers. I have tried a to use the round command
but it always just shows up as text in my title


-- 
View this message in context: 
http://www.nabble.com/Superscripts-and-rounding-tp24682319p24701709.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] local regression using loess

2009-07-28 Thread Bert Gunter

Actually, loess is much more than an interpolant.  I wouldn't 
even call it that.  It is a local regression  technique that comes 
with all the equipment you get in classical regression.  But it 
is meant for normal-like errors, which is not what you have.

-- This is misleading. The local smoother part makes a big difference. For
example df (and standard tests, consequently)are not defined as in
conventional multiple regression (though the enp argument gives you
something like df). Also, it was specifically designed for _non_-normal
errors -- specifically, long-tailed distributions -- via use of the
symmetric family argument which fits via a re-descending M-estimator not
Gaussian likelihood = least squares.

But you are certainly free to characterize it as you think appropriate if
you do not think interpolant is reasonable...

-- Bert



I would recommend that you take a look at the locfit package.  
It fits local likelihood models.  I've never tried it with binary data, 
but if y is your 0/1 response and x is a covariate, you might try 
something like:

locfit(y ~ x, ..., family=binomial)

If you have a good library at your disposal, try picking up Loader's 
book Local Regression and Likelihood.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Help with significance. T-test?

2009-07-28 Thread Ben Bolker



mik07 wrote:
 
 Hi,
 
 this is more a general statistics question I think.
 
 I am working on a system which automatically answers user questions (such
 systems are commonly called Question Answering systems).
 I evaluated different versions of the same system on a publicly available
 test set.
 This set contains 500 question. Naturally, for each question the answer
 can be wrong or right, which is coded as 0 (wrong) or 1 (correct). By
 adding up all values, and dividing them by the number of questions in the
 test set (that's 500), one gets a measure for how well the system
 performs, commonly called accuracy.
 As mentioned I evaluated two different versions of the system, and
 received two different accuracy values. Now I want to know whether the
 difference is statistically significant. 
 

?prop.test

-- 
View this message in context: 
http://www.nabble.com/Help-with-significance.-T-test--tp24699690p24701848.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Help with significance. T-test?

2009-07-28 Thread mik07

Hi,

this is more a general statistics question I think.

I am working on a system which automatically answers user questions (such
systems are commonly called Question Answering systems).
I evaluated different versions of the same system on a publicly available
test set.
This set contains 500 question. Naturally, for each question the answer can
be wrong or right, which is coded as 0 (wrong) or 1 (correct). By adding
up all values, and dividing them by the number of questions in the test set
(that's 500), one gets a measure for how well the system performs, commonly
called accuracy.
As mentioned I evaluated two different versions of the system, and received
two different accuracy values. Now I want to know whether the difference is
statistically significant. 

Can I use a t-test? I know it has certain requirements, for example a
somewhat normal distribution. That's difficult of course when the values in
question are only 0 and 1...


Has anybody any ideas?

Thanks a lot,
Mika


PS:

The data I have looks something like this (of course I actually have 500
values, not only 10):

results1:  0,1,1,1,0,1,1,0,1,0accuracy: 0.6
results2:  0,0,1,1,0,0,1,1,1,0accuracy: 0.5
-- 
View this message in context: 
http://www.nabble.com/Help-with-significance.-T-test--tp24699690p24699690.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] spherical wavelets package

2009-07-28 Thread konstantina rizopoulou

Hello to all,

I am trying to use the spherical wavelets package on my altimetry data.



I am having some problems now and then.

Currently I am having an error of 

error in matrix(0,KK,JJ) : too many elements specified



there is a thread of possibly same error 
(https://stat.ethz.ch/pipermail/r-help/2005-January/064308.html)

but it seems like it doesnt really help me.



More specifically i am trying the following command. ssha is a vector
of 1038240 observations, latlon1 a matrix 1038240x2, net a list of
1038240 points.



 out.ls-sbf(obs=ssha, latlon=latlon1, netlab=net, eta=eta, method=ls, 
 approx=TRUE,grid.size=c(100,200))



I would be highly grateful if anybody could help in any way.



Best regards

Konstantina





Konstantina Rizopoulou

MRes in Ocean Remote Sensing

Konstantina Rizopoulou 
MRes in Ocean Remote Sensing
National Oceanography Centre Southampton, UK

 +44 (0) 7772156968 (uk) 
 +30 6975205837 (greece)
 



_


re.aspx?tab=1
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Reading Excel files in Linux

2009-07-28 Thread srpd TCLTK

 

Hi,

 

I'm using the RODBC package to read Excel files in Windows. I would like to do 
it in Linux. What´s the best way to read Excel files in Linux?

 

Thanks in advance,

 

Srpd

 

 

 

 

 

 

_


y-edit.aspx
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] local regression using loess

2009-07-28 Thread Ryan Hafen
Are X1 and X2 both numeric?  You might want to get them on equivalent  
scales, and also play around with the smoothing parameter.

Try something like:

fit - locfit(Y ~ lp(X1, X2, nn=___, scale=TRUE), family=binomial)

and see what happens for different values of nn (try values between 0  
and 1 and then some larger than one).  I can't be much more help  
without data.


On Jul 27, 2009, at 9:41 PM, cindy Guo wrote:

 Hi, Ryan,

 Thank you for the information. I tried it. But there are some error  
 messages.

 When I use fit - locfit(Y~X1*X2,family='binomial'), the error  
 message is
 error lfproc(x, y, weights = weights, cens = cens, base = base, geth  
 = geth,  :
   compparcomp: parameters out of bounds

 And when I use fit - locfit(Y~X1*X2), the error message is
 error lfproc(x, y, weights = weights, cens = cens, base = base, geth  
 = geth,  :
   newsplit: out of vertex space

 This happens sometimes, not every time for different data. Do you  
 know what's the reason?

 Thank you,

 Cindy

 On Mon, Jul 27, 2009 at 5:25 PM, Ryan rha...@purdue.edu wrote:
  
   Hi, All,
  
   I have a dataset with binary response ( 0 and 1) and some  
 numerical
   covariates. I know I can use logistic regression to fit the  
 data. But I
   want
   to consider more locally. So I am wondering how can I fit the  
 data with
   'loess' function in R? And what will be the response: 0/1 or the
   probability
   in either group like in logistic regression?
  
   -- Neither. Loess is an algorithm that smoothly interpolates  
 the data. It
   makes no claim of modeling the probability for a binary response  
 variable.
  
   -- Bert Gunter
   Genentech Nonclinical Statistics
  
   Thank you,
   Cindy
  
  [[alternative HTML version deleted]]
  

 Actually, loess is much more than an interpolant.  I wouldn't
 even call it that.  It is a local regression  technique that comes
 with all the equipment you get in classical regression.  But it
 is meant for normal-like errors, which is not what you have.

 I would recommend that you take a look at the locfit package.
 It fits local likelihood models.  I've never tried it with binary  
 data,
 but if y is your 0/1 response and x is a covariate, you might try
 something like:

 locfit(y ~ x, ..., family=binomial)

 If you have a good library at your disposal, try picking up Loader's
 book Local Regression and Likelihood.

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] aggregating strings

2009-07-28 Thread Dry, Jonathan R
I am currently summarising a data set by collapsing data based on common 
identifiers in a column.  I am using the 'aggregate' function to summarise 
numeric columns, i.e. aggregate(dat[,3], list(dat$gene), mean).  I also wish 
to summarise text columns e.g. by concatenating values in a comma separated 
list, but the aggregate function can only return scalar values and so something 
like aggregate(dat[,3], list(dat$gene), cat) will not work.  Is there a 
simple function like aggregate that works for strings in R?

--
AstraZeneca UK Limited is a company incorporated in Engl...{{dropped:21}}

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Reading Excel files in Linux

2009-07-28 Thread Gabor Grothendieck
The read.xls function in the gdata package can read Excel 2003 files
on all platforms.

On Tue, Jul 28, 2009 at 10:11 AM, srpd TCLTKsrpd2...@hotmail.com wrote:



 Hi,



 I'm using the RODBC package to read Excel files in Windows. I would like to 
 do it in Linux. What´s the best way to read Excel files in Linux?



 Thanks in advance,



 Srpd













 _


 y-edit.aspx
        [[alternative HTML version deleted]]


 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.



__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Odp: aggregating strings

2009-07-28 Thread Petr PIKAL
Hi
r-help-boun...@r-project.org napsal dne 28.07.2009 17:34:35:

 I am currently summarising a data set by collapsing data based on common 

 identifiers in a column.  I am using the 'aggregate' function to 
summarise 
 numeric columns, i.e. aggregate(dat[,3], list(dat$gene), mean).  I 
also wish
 to summarise text columns e.g. by concatenating values in a comma 
separated 
 list, but the aggregate function can only return scalar values and so 
 something like aggregate(dat[,3], list(dat$gene), cat) will not work. 
Is 
 there a simple function like aggregate that works for strings in R?

Try

aggregate(dat[,3], list(dat$gene), paste, collapse=,)

Regards
Petr

 
 
--
 AstraZeneca UK Limited is a company incorporated in 
Engl...{{dropped:21}}
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] skip plot/blank plot on purpose (multi-plot question)

2009-07-28 Thread Greg Snow
Just to expand a little.

Your original question also asked if there is a way to specify which figure to 
plot in next.  If you use par(mfrow=c())  (or mfcol), then you can use 
par(mfg=c()) to specify which figure to plot next.

There is also the split.screen approach where you can split the device into 
several screens and use the screen function to specify which to plot to.  This 
probably gives the most control, but I have usually found layout to be 
sufficient and easier to use.

As has also been mentioned, lattice allows for multiple panels in a plot, but 
sometimes lattice is more complicated than base graphs for doing these things 
(and for other cases it is much simpler).

For your task, layout and plot.new is probably the most straight forward.

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111


 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
 project.org] On Behalf Of Greg Snow
 Sent: Monday, July 27, 2009 5:42 PM
 To: Mark Knecht; Bert Gunter
 Cc: r-help
 Subject: Re: [R] skip plot/blank plot on purpose (multi-plot question)
 
 Also look at the frame and plot.new functions.
 
 -Original Message-
 From: Mark Knecht markkne...@gmail.com
 To: Bert Gunter gunter.ber...@gene.com
 Cc: r-help r-help@r-project.org
 Sent: 7/27/09 1:56 PM
 Subject: Re: [R] skip plot/blank plot on purpose (multi-plot question)
 
 
 On Mon, Jul 27, 2009 at 12:21 PM, Bert Guntergunter.ber...@gene.com
 wrote:
  Well, all of this can be done quite nicely with lattice graphics:
 ?xyplot
  (See, e.g. the skip argument)
 
 
  1) Is there some generic way to call plot and have it plot, but it
  plots nothing so I don't see anything at all in position 12? This
  could be a blank plot function I call when I notice the data set is
  empty.
 
  -- But if you do not wish to learn lattice, please at least read the
 docs on
  standard graphics: ?plot (the type argument) ?plot.default (the axes
  argument)
 
 
 Thank you. It was the ?plot.default/axis argument that I was looking
 for. I knew type=n.
 
 Cheers,
 Mark
 
 
  -- Bert Gunter
  Genentech, Inc.
 
  2) Is there some generic way to specify the position number I want
 the
  next plot to use so that I'd not plot 12 but would specify 13?
 
  Thanks,
  Mark
 
  __
  R-help@r-project.org mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide http://www.R-project.org/posting-
 guide.html
  and provide commented, minimal, self-contained, reproducible code.
 
 
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-
 guide.html
 and provide commented, minimal, self-contained, reproducible code.
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-
 guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] check for new files in a given directory

2009-07-28 Thread William Dunlap
 -Original Message-
 From: r-help-boun...@r-project.org 
 [mailto:r-help-boun...@r-project.org] On Behalf Of Barry Rowlingson
 Sent: Tuesday, July 28, 2009 6:41 AM
 To: ted.hard...@manchester.ac.uk
 Cc: r-help@r-project.org; Andreas Posch
 Subject: Re: [R] check for new files in a given directory
 
 On Tue, Jul 28, 2009 at 12:36 PM, Ted
 Hardingted.hard...@manchester.ac.uk wrote:
 
  However, this got me looking into '?list.files, and I see there
  (R version 2.9.0 (2009-04-17)):
 
   recursive: logical. Should the listing recurse into directories?
 
  But:
 
   Directories are included only if 'recursive = FALSE'.
 
  Surely the latter is the wrong way round, and should be
 
   Directories are included only if 'recursive = TRUE'.
 
 
  by 'included' it means 'returned'. If you do 'recursive=TRUE' it
 scans recursively for files and only files. If you do
 recursive=FALSE it returns files and directories in the specified
 directory.
 
 Makes it tricky to figure out a complete directory tree since empty
 directories won't appear at all if recursive=TRUE. You'd have to
 implement your own recursive search based on
 list.files(d,recursive=FALSE) and then testing for directoriness
 
  Sucky, unless there's a better way...
 
 Barry

S+'s dir() and list.files() functions have an extra argument called type
that let you say if you are interested in only files (non-directories) or
directories or want all directory entries listed in the output.  Its default 
value
is set to match the R behavior
  function(...,
recursive=FALSE,
type = if(recursive) c(files, directories, all) else c(all, 
files, directories))
  {
   type - match.arg(type)
   ...
  }
I put it in when I was looking for all directories named 'R' in a collection of
packages and bundles and I didn't want to use the platform-dependent
system() function.  Should this argument be added to R's dir() and
list.files() functions?

Bill Dunlap
TIBCO Software Inc - Spotfire Division
wdunlap tibco.com

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] local regression using loess

2009-07-28 Thread Ryan
Bert Gunter gunter.berton at gene.com writes:

 
 
 Actually, loess is much more than an interpolant.  I wouldn't 
 even call it that.  It is a local regression  technique that comes 
 with all the equipment you get in classical regression.  But it 
 is meant for normal-like errors, which is not what you have.
 


Bert - when I hear interpolate, I think of connecting the 
data points, like using something like divided differences 
or hermite interpolation, so I thought that's what you 
meant.  Sorry for the misunderstanding.  

True that loess was designed to be robust, but when I 
said it is meant for normal-like errors, I was referring 
to loess with statistical procedures analagous to the 
classical regression setting, such as confidence intervals, 
anova, etc. (see Locally Weighted Regression: An 
Approach to Regression Analysis by Local Fitting, 1988).

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] some QCA questions

2009-07-28 Thread Suzanne van der Post
Dear Adrian Dusa, others,
 
I've recently started to learn R in order to use the QCA package because
i think it might offer what other QCA packages don't: possibilities for
quite a few conditions and large n. However, can someone tell me approx.
how much RAM i need to run QCA on set of  +/- 400.000 cases and +/- 15
conditions? (or differently: how much time will it take with RAM of a
certain size?)
Also I'm very keen on hearing any news on the fuzzy and multivalue
options for R...How's that comming along?
 
Thanks a lot for any information you can provide!
And of course major thanks for all the information you've already
provided for me in existing manuals, R-fora etc. Great work!
 
Greetings, 
Suzan van der Post
 
 
 



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] aggregating strings

2009-07-28 Thread Bert Gunter
You are probably going to get tons of answers, as there are many ways -- and
packages -- to do this (e.g. see packages reshape and plyr). However, you
might want to take a look at ?tapply, for which aggregate() is a wrapper,
for the basic core R approach.

Bert Gunter
Genentech Nonclinical Biostatistics

-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Dry, Jonathan R
Sent: Tuesday, July 28, 2009 8:35 AM
To: r-help@r-project.org
Subject: [R] aggregating strings

I am currently summarising a data set by collapsing data based on common
identifiers in a column.  I am using the 'aggregate' function to summarise
numeric columns, i.e. aggregate(dat[,3], list(dat$gene), mean).  I also
wish to summarise text columns e.g. by concatenating values in a comma
separated list, but the aggregate function can only return scalar values and
so something like aggregate(dat[,3], list(dat$gene), cat) will not work.
Is there a simple function like aggregate that works for strings in R?

--
AstraZeneca UK Limited is a company incorporated in Engl...{{dropped:8}}

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] vary the parameters for a function

2009-07-28 Thread Greg Snow
If you want to have a gui that allows you to change parameter values using 
buttons/sliders/etc. and see what the effects are, then look at the tkexamp 
function in the TeachingDemos package (see the examples on the help page).

If you have a predetermined set of values for the parameter of interest and 
want to run the function multiple times with those values (and other set 
values), then try mapply.  Here is an example using the power.t.test function 
to find the power for different sample sizes (and a fixed delta of 0.3, 
everything else at its default):

 tmp - mapply(power.t.test, n=c(10,20,30,50), MoreArgs=list(delta=0.3))
 unlist(tmp['power',])
[1] 0.09271619 0.15031255 0.20689369 0.31751712

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111


 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
 project.org] On Behalf Of Inchallah Yarab
 Sent: Tuesday, July 28, 2009 3:36 AM
 To: r-help@r-project.org
 Subject: [R] vary the parameters for a function
 
 
 
 
 
 
 
 How I can vary the parameters for a function?
 
 I have a function with 5 parameters I want to turn the function for a
 range of numbers for one of these parameters!! i want to have in the
 end the value of the function in the different cas of one of the
 paramter (the others paramters are fixes!!) thank you for your help
 
 
 
 
   [[alternative HTML version deleted]]
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-
 guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Density plot in ggplot2

2009-07-28 Thread RON70

Hi all, I was trying to draw a stacked density plot like that :
library(ggplot2); library(plyr)
dat - cbind(rnorm(300), rep(c(1,2), each=150))
ggplot() + geom_density(aes(x=dat[,1], fill=factor(dat[,2]),
position=stack)) +
   xlab() + ylab() +
   scale_colour_manual(name = Pallet, labels = c(X, Y))

Here everything is ok, except few points :
1. I want to remove the name of y-axis, which is by default density. Here
I put ylab(), however although for x-axis it is working, for y-axis it is
not. Is there any specific formula for that?

2. I want to rename the color plot, as well as the title of the color. The
function scale_colour_manual() seems not working. Can anyone please suggest
me how to achieve desired thing?

Thanks
-- 
View this message in context: 
http://www.nabble.com/Density-plot-in-ggplot2-tp24702858p24702858.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Skew-Normal Linear Mixed Model (SNLMM)

2009-07-28 Thread Raphael Fraser
Dear ALL,

In the Normal Linear Mixed Model (NLMM) we make the assumption that
the random effects are normally distributed. Is it possible to fit a
linear mixed model in R where the random effects are
assumed to have a Skew-Normal distribution? I am trying to reproduce
the results in the paper referenced below. Can anyone help?

Tsung I. Lin, Jack C. Lee. Estimation and prediction in linear mixed
models with skew-normal random effects for longitudinal data.
Statistics in Medicine 2008; 27 (9):1490–1507

Regards,
Raphael

--
Raphael A. Fraser, MSc
Lecturer in Biostatistics
Tropical Medicine Research Institute
Faculty of Medical Sciences
University of the West Indies
Mona Campus
Kingston, JAMAICA

Tel:  (876) 927-2471; 977-6151
Mobile: (876) 410-4699
Fax: (876) 927-2984
e-mail: raphael.fra...@uwimona.edu.jm

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Help with significance. T-test?

2009-07-28 Thread Daniel Malter
Look up the McNemar test. That sounds right...

Daniel 


-
cuncta stricte discussurus
-

-Ursprüngliche Nachricht-
Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im
Auftrag von mik07
Gesendet: Tuesday, July 28, 2009 10:49 AM
An: r-help@r-project.org
Betreff: [R] Help with significance. T-test?


Hi,

this is more a general statistics question I think.

I am working on a system which automatically answers user questions (such
systems are commonly called Question Answering systems).
I evaluated different versions of the same system on a publicly available
test set.
This set contains 500 question. Naturally, for each question the answer can
be wrong or right, which is coded as 0 (wrong) or 1 (correct). By adding
up all values, and dividing them by the number of questions in the test set
(that's 500), one gets a measure for how well the system performs, commonly
called accuracy.
As mentioned I evaluated two different versions of the system, and received
two different accuracy values. Now I want to know whether the difference is
statistically significant. 

Can I use a t-test? I know it has certain requirements, for example a
somewhat normal distribution. That's difficult of course when the values in
question are only 0 and 1...


Has anybody any ideas?

Thanks a lot,
Mika


PS:

The data I have looks something like this (of course I actually have 500
values, not only 10):

results1:  0,1,1,1,0,1,1,0,1,0accuracy: 0.6
results2:  0,0,1,1,0,0,1,1,1,0accuracy: 0.5
--
View this message in context:
http://www.nabble.com/Help-with-significance.-T-test--tp24699690p24699690.ht
ml
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Help with significance. T-test?

2009-07-28 Thread Doran, Harold
Mika

Are you familiar with item response theory? You might consider functions
in ltm or MiscPsycho for dealing with binary response data. 

 -Original Message-
 From: r-help-boun...@r-project.org 
 [mailto:r-help-boun...@r-project.org] On Behalf Of mik07
 Sent: Tuesday, July 28, 2009 10:49 AM
 To: r-help@r-project.org
 Subject: [R] Help with significance. T-test?
 
 
 Hi,
 
 this is more a general statistics question I think.
 
 I am working on a system which automatically answers user 
 questions (such systems are commonly called Question 
 Answering systems).
 I evaluated different versions of the same system on a 
 publicly available test set.
 This set contains 500 question. Naturally, for each question 
 the answer can be wrong or right, which is coded as 0 
 (wrong) or 1 (correct). By adding up all values, and 
 dividing them by the number of questions in the test set 
 (that's 500), one gets a measure for how well the system 
 performs, commonly called accuracy.
 As mentioned I evaluated two different versions of the 
 system, and received two different accuracy values. Now I 
 want to know whether the difference is statistically significant. 
 
 Can I use a t-test? I know it has certain requirements, for 
 example a somewhat normal distribution. That's difficult of 
 course when the values in question are only 0 and 1...
 
 
 Has anybody any ideas?
 
 Thanks a lot,
 Mika
 
 
 PS:
 
 The data I have looks something like this (of course I 
 actually have 500 values, not only 10):
 
 results1:  0,1,1,1,0,1,1,0,1,0accuracy: 0.6
 results2:  0,0,1,1,0,0,1,1,1,0accuracy: 0.5
 --
 View this message in context: 
 http://www.nabble.com/Help-with-significance.-T-test--tp246996
90p24699690.html
 Sent from the R help mailing list archive at Nabble.com.
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide 
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
 

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Searching for specific values in a matrix

2009-07-28 Thread Steve Lianoglou
quick question, i am trying to get an interval of values now with  
this code by toggling the tolerance limit.  is there any way i can  
modify this code to find values which are within limits of BOTH  
latitude and longitude?  currently i have to pick one or the other.


It's not really clear where your data is lat/long .. is this x/y?

Anyway, you can  two query vectors to get the data that's between  
both. For instance:


rearranged[1:10, 1:5]
  xy band1 VSCAT.001 soiltype
1  -124.3949 40.42468NANA   CD
2  -124.3463 40.27358NANA   CD
3  -124.3357 40.25226NANA   CD
4  -124.3663 40.40241NANA   CD
5  -124.3674 40.49810NANA   CD
6  -124.3083 40.24744NA   464 NA
7  -124.3017 40.31295NANAD
8  -124.3375 40.47557NA   464 NA
9  -124.2511 40.11697 1NA NA
10 -124.2532 40.12640 1NA NA

Assume you want a range constrained by x and y:

good.x - rearranged$x  124.3  rearranged$x  125
good.y - rearranged$y  40.5  rearranged$y  41

rearranged[good.x  good.y,]

Like that?

-steve

--
Steve Lianoglou
Graduate Student: Computational Systems Biology
  |  Memorial Sloan-Kettering Cancer Center
  |  Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Density plot in ggplot2

2009-07-28 Thread Paul Emberson

Hi Ron,

I'm not sure why ylab doesn't work.  Maybe a bug.  I note the label 
doesn't get removed with labs() either.  However using 
scale_y_continuous(name=) does remove the label.


For the legend, you are using a fill scale, not a colour scale i.e. 
fill=factor(dat[,2]), not colour=factor(dat[,2])


use  scale_fill_hue(name = Pallet, labels = c(X, Y)) instead.

Regards,

Paul

RON70 wrote:

Hi all, I was trying to draw a stacked density plot like that :
library(ggplot2); library(plyr)
dat - cbind(rnorm(300), rep(c(1,2), each=150))
ggplot() + geom_density(aes(x=dat[,1], fill=factor(dat[,2]),
position=stack)) +
   xlab() + ylab() +
   scale_colour_manual(name = Pallet, labels = c(X, Y))

Here everything is ok, except few points :
1. I want to remove the name of y-axis, which is by default density. Here
I put ylab(), however although for x-axis it is working, for y-axis it is
not. Is there any specific formula for that?

2. I want to rename the color plot, as well as the title of the color. The
function scale_colour_manual() seems not working. Can anyone please suggest
me how to achieve desired thing?

Thanks


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] character vector - numeric matrix ??

2009-07-28 Thread kathie

Dear R users... 

I'd like to change this character vector, zz,  

zz - c(12,56,89)

to the following numeric matrix.

 [,1] [,2]
[1,]12
[2,]56
[3,]89


Actually, zz vector has a long length.

Any comments will be greatly appreciated.

Kathryn Lord

-- 
View this message in context: 
http://www.nabble.com/character-vector--%3E-numeric-matrixtp24703927p24703927.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


  1   2   >