[R] R: polygon error?

2007-05-26 Thread Guazzetti Stefano
It seems to me that you are using polygon in a wrong way.
What you probably need could be something like:
 
polygon(c(rev(t$z), t$z),
 c(rep(0, nrow(t)), t$ht), col=2, border=NA)

Stefano
-Messaggio originale-
Da: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] conto di LL
Inviato: sabato 26 maggio 2007 12.34
A: r-help@stat.math.ethz.ch
Oggetto: [R] polygon error?


Hi.. I'm not sure why polygon returns an area above the standard normal curve.

z - pretty(c(-3,3), 100)
ht - dnorm(z)
data - data.frame(z=z, ht=ht)
zc - 1.645
plot(data, type=l)
lines(data)
t - subset(data, zzc)
polygon(t, col=red)

Thanks,
Lance


[[alternative HTML version deleted]]

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

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


[R] R: Simple programming question

2007-05-18 Thread Guazzetti Stefano
try also this

dfr$score-factor(dfr$var3 %in% sort(unique(dfr$var3), decr=T)[1:2] * dfr$var3,
   labels=c(low, mid, high))
Hope this helps, 

Stefano

-Messaggio originale-
Da: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] conto di Lauri Nikkinen
Inviato: venerdì 18 maggio 2007 15.15
A: r-help@stat.math.ethz.ch
Oggetto: [R] Simple programming question


Hi R-users,

I have a simple question for R heavy users. If I have a data frame like this


dfr - data.frame(id=1:16, categ=rep(LETTERS[1:4], 4),
var3=c(8,7,6,6,5,4,5,4,3,4,3,2,3,2,1,1))
dfr - dfr[order(dfr$categ),]

and I want to score values or points in variable named var3 following this
kind of logic:

1. the highest value of var3 within category (variable named categ) -
high
2. the second highest value - mid
3. lowest value - low

This would be the output of this reasoning:

dfr$score -
factor(c(high,mid,low,low,high,mid,mid,low,high,mid,low,low,high,mid,low,low))
dfr

The question is how I do this programmatically in R (i.e. if I have 2000
rows in my dfr)?

I appreciate your help!

Cheers,
Lauri

[[alternative HTML version deleted]]

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

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


[R] R: extract from a data frame

2007-04-23 Thread Guazzetti Stefano
Oats[Oats$Variety %in% c(Victory, Golden Rain),]
or
subset(Oats, Variety %in% c(Victory, Golden Rain))

Stefano

-Messaggio originale-
Da: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] conto di elyakhlifi
mustapha
Inviato: lunedì 23 aprile 2007 9.56
A: R-help@stat.math.ethz.ch
Oggetto: [R] extract from a data frame


hello,
I'd like know how to do to extract data from a frame for example
how can I do to extract only the data where variety=victory or variety=golden 
rain
thanks.

 Oats
   Block Variety nitro yield
1  I Victory   0.0   111
2  I Victory   0.2   130
3  I Victory   0.4   157
4  I Victory   0.6   174
5  I Golden Rain   0.0   117
6  I Golden Rain   0.2   114
7  I Golden Rain   0.4   161
8  I Golden Rain   0.6   141
9  I  Marvellous   0.0   105
10 I  Marvellous   0.2   140
11 I  Marvellous   0.4   118
12 I  Marvellous   0.6   156
13II Victory   0.061
14II Victory   0.291
15II Victory   0.497
16II Victory   0.6   100
17II Golden Rain   0.070
18II Golden Rain   0.2   108
19II Golden Rain   0.4   126
20II Golden Rain   0.6   149
21II  Marvellous   0.096
22II  Marvellous   0.2   124
23II  Marvellous   0.4   121


  
___ 
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
Profitez des connaissances, des opinions et des expériences des internautes sur 
Yahoo! Questions/Réponses 

[[alternative HTML version deleted]]

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


[R] R: math-operations

2007-03-30 Thread Guazzetti Stefano
I guess you need %% and %/%

try  
 513 %/% 100
[1] 5
 513 %% 100
[1] 13

?%%


Stefano


-Messaggio originale-
Da: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] conto di Schmitt, Corinna
Inviato: venerdì 30 marzo 2007 15.34
A: r-help@stat.math.ethz.ch
Oggetto: [R] math-operations


Hallo R-experts,

for a function I need to work with the commands div and mod known
from Pascal and Ruby. The only help I know is ceiling() and floor()
in R. Do div and mod exist? When yes please send me a little
example.

In Pascal-Syntax I want: 
513 div 100 = 5
513 mod 100 = 13

How can I get this in R-syntax?

Thanks, Corinna

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

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


[R] R: Searching and deleting elements of list

2007-03-08 Thread Guazzetti Stefano
you could try mapply

 mydata2-mapply([, mydata, lapply(mydata, function(x) !x %in% A))
 mydata2[[1]]-A  #to replace the obviously deleted elements of A
 mydata2
 mydata2[[1]]
 mydata2[[2]]
 mydata2[[3]]
 mydata2[[4]]

Stefano


-Messaggio originale-
Da: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] conto di jastar
Inviato: giovedì 8 marzo 2007 12.31
A: r-help@stat.math.ethz.ch
Oggetto: [R] Searching and deleting elements of list



Hi,
I have a problem. Please, look at example and try to help me!!

 A-c(aaa,bbb,ccc,ddd,eee)
 B-c(vvv,ooo,aaa,eee,zzz,bbb)
 C-c(sss,jjj,ppp,ddd)
 D-c(bbb,ccc)
mydata=list(A,B,C,D)

I want to find and delete from 'mydata' all elements which occur in A
(except A). 
I mean after operation:
 mydata[[1]]
[1] aaa bbb ccc ddd eee
 mydata[[2]]
[1] vvv ooo zzz
 mydata[[3]]
[1] sss,jjj,ppp
 mydata[[4]]
NULL

My list have about 1 subelements (each contains several strings) so
using loops is senseless.

Thank's for all replies and sorry for my English (I hope you understand what
I'm talking about) :-)
 
-- 
View this message in context: 
http://www.nabble.com/Searching-and-deleting-elements-of-list-tf3368489.html#a9372270
Sent from the R help mailing list archive at Nabble.com.

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

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


[R] R: Grouping columns in a data frame based on the values of a column

2006-09-15 Thread Guazzetti Stefano
Perhaps using 'ave' and 'cut':

 df - data.frame(x=runif(100, 0.1, 1),  y=rnorm(100, 0.2, 0.6))
 df$xcut-cut(df$x, seq(0, 1, 0.1))
 df$z-ave(df$y, df$xcut)
 df[order(df$x),]


Stefano

-Messaggio originale-
Da: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] conto di
[EMAIL PROTECTED]
Inviato: venerdì 15 settembre 2006 17.45
A: r-help@stat.math.ethz.ch
Oggetto: [R] Grouping columns in a data frame based on the values of a
column


Dear R users,

This is a trivial question, there might even be an R function for it, but I have
to do it many times and wonder if there is an efficient for it.


Suppose we have a data frame like this:
d - data.frame(x=sample(seq(0.1:1, by=0.01), size=100, replace=TRUE),
y=rnorm(100, 0.2, 0.6))

and want to have the average of y for a given interval of x, for example
mean(y)[0x0.1]. Is there a simple way of doing this or I need to improvise?

Thank you so much for any help
Eleni Rapsomaniki

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

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


[R] R: data.frame to shape

2006-08-09 Thread Guazzetti Stefano
assuming that the rows are sorted correctly
dat
   id   x   y
1  50 1647685 4815259
2  50 1647546 4815196
3  50 1647454 4815294
4  50 1647405 4815347
5  50 1647292 4815552
6  50 1647737 4815410
7  74 1647555 4815201
8  74 1647464 4815023
9  74 1646970 4815129
10 74 1646895 4815264
11 74 1646762 4815513

 list.dat-split(dat, dat$id)
 
  closed.polygons-lapply(list.dat, function(x) rbind(x, x[1,]))
 
  do.call(rbind, closed.polygons)
  id   x   y
50.1  50 1647685 4815259
50.2  50 1647546 4815196
50.3  50 1647454 4815294
50.4  50 1647405 4815347
50.5  50 1647292 4815552
50.6  50 1647737 4815410
50.11 50 1647685 4815259
74.7  74 1647555 4815201
74.8  74 1647464 4815023
74.9  74 1646970 4815129
74.10 74 1646895 4815264
74.11 74 1646762 4815513
74.71 74 1647555 4815201

but maybe there are better ways to do what you want


   -Messaggio originale-
   Da: [EMAIL PROTECTED]
   [mailto:[EMAIL PROTECTED] conto di Leonardo Lami
   Inviato: 09 August, 2006 15:33
   A: r-help@stat.math.ethz.ch
   Oggetto: [R] data.frame to shape
   
   
   Hi all,
   I have a simple question:
   I have a data.frame like this:
   
  id   x   y
   1  50 1647685 4815259
   2  50 1647546 4815196
   3  50 1647454 4815294
   4  50 1647405 4815347
   5  50 1647292 4815552
   6 50 1647737 4815410
   7 74 1647555 4815201
   8 74 1647464 4815023
   9 74 1646970 4815129
   10 74 1646895 4815264
   11 74 1646762 4815513
   
   and I'd like to trasform it with the convert.to.shapefile 
   function 
   (shapefiles package) but to make this I must have a 
   data.frame like this:
   
  id   x   y
   1  50 1647685 4815259
   2  50 1647546 4815196
   3  50 1647454 4815294
   4  50 1647405 4815347
   5  50 1647292 4815552
   6  50 1647737 4815410
   7  50 1647685 4815259
   8  74 1647555 4815201
   9  74 1647464 4815023
   10 74 1646970 4815129
   11 74 1646895 4815264
   12 74 1646762 4815513
   13 74 1646762 4815513
   
   with the first point of every id repeated to close the polygon.
   There is a function to make this indipendently by the 
   number of the id
   
   Best regards
   Leonardo
   
   -- 
   Leonardo Lami
   email + jabber: [EMAIL PROTECTED]
   www.faunalia.it
   Cell: (+39)349-1310164  Tel+Fax: (+39) 0587-213742
   Piazza Garibaldi 5 - 56025 Pontedera (PI), Italy
   
   __
   R-help@stat.math.ethz.ch mailing list
   https://stat.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide 
   http://www.R-project.org/posting-guide.html
   and provide commented, minimal, self-contained, reproducible code.
   
   

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


[R] R: the first and last case

2006-07-26 Thread Guazzetti Stefano
could it be

 dat[unlist(tapply(1:nrow(dat), ind, range)),]
?

stefano



   -Messaggio originale-
   Da: [EMAIL PROTECTED]
   [mailto:[EMAIL PROTECTED] conto di 
   Mauricio Cardeal
   Inviato: 26 July, 2006 14:22
   A: r-help@stat.math.ethz.ch
   Oggetto: [R] the first and last case
   
   
   Hi all
   
   Sometime ago I asked for a solution about how to aggregate 
   data and the 
   help was wonderful. Now, I´d like to know how to extract for each 
   individual case below the first and the last observation to 
   obtain this:
   
   ind  y
   18
   19
   27
   2   11
   39
   3   10
   4   8
   4   5
   
   # Below the example:
   
   ind - c(1,1,1,2,2,3,3,3,4,4,4,4)
   y - c(8,10,9,7,11,9,9,10,8,7,6,5)
   dat - as.data.frame(cbind(ind,y))
   dat
   attach(dat)
   mean.ind - aggregate(dat$y, by=list(dat$ind), mean)
   mean.ind
   
   Thanks
   Mauricio
   
   __
   R-help@stat.math.ethz.ch mailing list
   https://stat.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

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


[R] R: determination of number of entries in list elements

2006-05-19 Thread Guazzetti Stefano
You need lapply or sapply
for example:

sapply(yourlist, length)
then you can do
subset(yourlist, sapply(yourlist, length)  yourlength) 

Stefano

   -Messaggio originale-
   Da: [EMAIL PROTECTED]
   [mailto:[EMAIL PROTECTED] conto di Benjamin Otto
   Inviato: 19 May, 2006 12:10
   A: R-Help
   Oggetto: [R] determination of number of entries in list elements
   
   
   Hi,
   
   is there some elegant way to determine the number of 
   components stored in
   each list element?
   
   Example:
   
   The list:
   -
list
   
   $Elem1
   [1] A B C
   
   $Elem1
   [1] D
   
   $Elem1
   [1] E F
   
   Then normal command length(list) would return 3. But I 
   would like some
   command return the array of the single element lengths like
   
   [1] 3 1 2
   
   so I can afterwards get my list subset with only entries 
   which have a
   certain amount of components bigger or lower than a certain 
   threshold.
   
   regards
   
   Benjamin
   
   __
   R-help@stat.math.ethz.ch mailing list
   https://stat.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide! 
   http://www.R-project.org/posting-guide.html
   
   

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] R: R: [Re:] function to replace missing values with median value?]]

2006-05-04 Thread Guazzetti Stefano
oops!, I pressed the 'send' key too soon, ...

see ?replace

replace(x, is.na(x), median(x, na.rm=T))

take also a look at the function itself

 replace
function (x, list, values) 
{
x[list] - values
x
}
environment: namespace:base

Stefano

   -Messaggio originale-
   Da: [EMAIL PROTECTED]
   [mailto:[EMAIL PROTECTED] conto di 
   Guazzetti Stefano
   Inviato: Thursday, May 04, 2006 07:55 AM
   A: [EMAIL PROTECTED]; [EMAIL PROTECTED]
   Cc: r-help@stat.math.ethz.ch
   Oggetto: [R] R: [Re:] function to replace missing values with median
   value?]]
   
   
   there is also a replace function
   
   
  -Messaggio originale-
  Da: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] conto di
  [EMAIL PROTECTED]
  Inviato: Thursday, May 04, 2006 07:31 AM
  A: [EMAIL PROTECTED]
  Cc: r-help@stat.math.ethz.ch
  Oggetto: [R] [Re:] function to replace missing values 
   with median
  value?]]
  
  
  The following should work
  
  sz - function(x) { ifelse(is.na(x) == F, x, median(x, 
  na.rm=TRUE)) }
  
  best, isaia.
  
   Original Message 
  Subject: [R] function to replace missing values with 
   median value?
  Date: Wed, 3 May 2006 10:06:40 -0700 (PDT)
  From: r user [EMAIL PROTECTED]
  To: rhelp r-help@stat.math.ethz.ch
  
  I have a data set with ~10 variables (i.e. columns).
  
  I wrote this little function to replace missing values
  with zero.
  
  “ sz - function(x) { ifelse(is.na(x)==F,x,0) } “
  
  Can anyone help with a function that replaces missing
  values with the median of the non-missing values?
  
  __
  R-help@stat.math.ethz.ch mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide!
  http://www.R-project.org/posting-guide.html
  
  -- 
  ~~~
  ~ Ennio D. Isaia
  ~ Dep. of Statistics  Applied Mathematics, University of Torino
  ~ Piazza Arbarello, 8 - 10122 Torino (Italy)
  ~ Phone: +39 011 670 57 29 ~~ Fax: +39 011 670 57 83
  ~~~
  
  __
  R-help@stat.math.ethz.ch mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide! 
  http://www.R-project.org/posting-guide.html
  
  
   
   __
   R-help@stat.math.ethz.ch mailing list
   https://stat.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] R: [Re:] function to replace missing values with median value?]]

2006-05-03 Thread Guazzetti Stefano
there is also a replace function


   -Messaggio originale-
   Da: [EMAIL PROTECTED]
   [mailto:[EMAIL PROTECTED] conto di
   [EMAIL PROTECTED]
   Inviato: Thursday, May 04, 2006 07:31 AM
   A: [EMAIL PROTECTED]
   Cc: r-help@stat.math.ethz.ch
   Oggetto: [R] [Re:] function to replace missing values with median
   value?]]
   
   
   The following should work
   
   sz - function(x) { ifelse(is.na(x) == F, x, median(x, 
   na.rm=TRUE)) }
   
   best, isaia.
   
    Original Message 
   Subject: [R] function to replace missing values with median value?
   Date: Wed, 3 May 2006 10:06:40 -0700 (PDT)
   From: r user [EMAIL PROTECTED]
   To: rhelp r-help@stat.math.ethz.ch
   
   I have a data set with ~10 variables (i.e. columns).
   
   I wrote this little function to replace missing values
   with zero.
   
   “ sz - function(x) { ifelse(is.na(x)==F,x,0) } “
   
   Can anyone help with a function that replaces missing
   values with the median of the non-missing values?
   
   __
   R-help@stat.math.ethz.ch mailing list
   https://stat.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide!
   http://www.R-project.org/posting-guide.html
   
   -- 
   ~~~
   ~ Ennio D. Isaia
   ~ Dep. of Statistics  Applied Mathematics, University of Torino
   ~ Piazza Arbarello, 8 - 10122 Torino (Italy)
   ~ Phone: +39 011 670 57 29 ~~ Fax: +39 011 670 57 83
   ~~~
   
   __
   R-help@stat.math.ethz.ch mailing list
   https://stat.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide! 
   http://www.R-project.org/posting-guide.html
   
   

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] R: Dotplot x-axis

2006-04-14 Thread Guazzetti Stefano
Take a look at the scales argument in dotpolot.
Maybe you need something like:

 position-exp(-5:0)/(1+exp(-5:0))
 dotplot(type~freq/(3027-freq),
 scales=list(x=list(log=T,
 at=position, lab=round(position, 3))) )


Stefano

   -Messaggio originale-
   Da: [EMAIL PROTECTED]
   [mailto:[EMAIL PROTECTED] conto di Michael Kubovy
   Inviato: 14 April 2006 15:29
   A: r-help@stat.math.ethz.ch
   Oggetto: [R] Dotplot x-axis
   
   
   Here's a small dataset:
   
   type - c('hierarchical','partial','single','complete','single 
   +hierarchical','single+partial','partial+hierarchical','sing
   le+partial 
   +hierarchical')
   freq - c(1455,729,688,65,29,28,16,17)
   lodds - log(freq/(3027 - freq))
   dotplot(type~lodds)
   
   I would like to have the x-axis have ticks at nice, close 
   to equally- 
   spaced values, of the proportions rather than at round log-odds  
   values, which appear as -5:0. For example: perhaps have ticks at c 
   (0.007, 0.02, 0.05, 0.12, 0.27, 0.5), which are approximate 
   values of  
   exp(-5:0)/(1+exp(-5:0))
   
   Advice?
   _
   Professor Michael Kubovy
   University of Virginia
   Department of Psychology
   USPS: P.O.Box 400400Charlottesville, VA 22904-4400
   Parcels:Room 102Gilmer Hall
McCormick RoadCharlottesville, VA 22903
   Office:B011+1-434-982-4729
   Lab:B019+1-434-982-4751
   Fax:+1-434-982-4766
   WWW:http://www.people.virginia.edu/~mk9y/
   
   __
   R-help@stat.math.ethz.ch mailing list
   https://stat.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide! 
   http://www.R-project.org/posting-guide.html
   
   

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] R: Fw: Controling the x or y limit

2006-02-10 Thread Guazzetti Stefano
perhaps you are looking at something like

plot(0, xlim=c(0,20), xaxt=n)
axis(1, at=pretty(0:20, 10))


Stefano
-Messaggio originale-
Da: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] conto di Subhabrata
Inviato: venerdì 10 febbraio 2006 7.05
A: r-help
Cc: [EMAIL PROTECTED]
Oggetto: [R] Fw: Controling the x or y limit


 Hello - R-experts,

This may sound simple to many --- 
We can specify the x limit by saying xlim = c(0, 20) for example.
 Then the graph will show the range of x -axis between 0 - 20.
 But the coordinate gap will be automatic like 0 then 5 then 15 and 20. 
 Is there any way by which we can set it in a gap of 2 or any number.

 Thank you for any help.
 
 With Regards

 Subhabrata

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] R: dataframe subset

2006-02-08 Thread Guazzetti Stefano
Dear Bernhard,
if I understand correctly your question
may be you want something like

 df-data.frame(x=sample(1:10, 100, repl=T), 
y=sample(1:5, 100, repl=T))
 subset(df, x%in%y)

Regards, 

Stefano

   -Messaggio originale-
   Da: [EMAIL PROTECTED]
   [mailto:[EMAIL PROTECTED] conto di Bernhard
   Baumgartner
   Inviato: 08 February 2006 15:22
   A: r-help@stat.math.ethz.ch
   Oggetto: [R] dataframe subset
   
   
   I have a dataframe with a column, say x consisting of 
   values, each 
   value appearing different times, e.g.
   x: 1,1,1,1,2,2,4,4,4,9,10,10,10,10,10 ...
   and a vector, including e.g.:
   y: 2,9,10,...
   I need a subset of the dataframe: all rows where x is equal 
   to one of 
   the values in y. Currently I use a loop for this, but 
   because x and y 
   are large this is very slow. 
   Is there any idea how to solve this problem faster?
   Thank you,
   Bernhard
   
   __
   R-help@stat.math.ethz.ch mailing list
   https://stat.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] R: Graph with values of coordinates of points in x axis

2005-06-15 Thread Guazzetti Stefano
try: 
 plot(x, y, type=l, xlab=Months, 
  xaxt=n, ylab=Y values)
 axis(1, at=0:5*6)

Stefano
   -Messaggio originale-
   Da: [EMAIL PROTECTED]
   [mailto:[EMAIL PROTECTED] conto di Massimiliano
   Tripoli
   Inviato: mercoledì 15 giugno 2005 10.35
   A: r-help@stat.math.ethz.ch
   Oggetto: [R] Graph with values of coordinates of points in x axis
   
   
   Hi all,
   
   I want to draw a line with the values of x marked in X axis.
   
   I tried with
   x - c(0,6,12,18,24,30)  #coordinates of points x
   y - c(2,5,7,5,7,16) #coordinates of points y
   plot(x,type=n,xlab=Months,main=main,ylim=c(0,16),xlim=c(0,30))
   lines(x,y)
   
   The graph shows by default an increment of the sequence in 
   x axis that I'm 
   not able to change.
   I'would like to have 0,6,12,18,24,30 and not 0,10,15,20,25,30.
   Any hint is appreciated.
   
   Thanks in advance.
   
   __
   R-help@stat.math.ethz.ch mailing list
   https://stat.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


R: [R] weighted.mean and tapply (again)

2005-05-26 Thread Guazzetti Stefano
what about using mapply?

 splitted.value-with(x.1, split(VALUE, GROUP))
 splitted.freq-with(x.1, split(FREQUENCY, GROUP))
 mapply(weighted.mean, splitted.value, w=splitted.freq)


Stefano


   -Messaggio originale-
   Da: [EMAIL PROTECTED]
   [mailto:[EMAIL PROTECTED] conto di
   [EMAIL PROTECTED]
   Inviato: mercoledì 25 maggio 2005 17.57
   A: Dan Bolser
   Cc: R mailing list; [EMAIL PROTECTED]
   Oggetto: Re: [R] weighted.mean and tapply (again)
   
   
   
   
   
   
x.1 - read.table('clipboard',header=T)
x.1
  GROUP VALUE FREQUENCY
   1  2 278
   2  2 340
   3  2 416
   4  2 5 3
   5  2 6 1
   6  2 8 1
   7  3 319
   8  3 410
   9  3 519
   10 3 6 4
by(x.1, x.1$GROUP, function(x) weighted.mean(x$VALUE, 
   x$FREQUENCY))
   x.1$GROUP: 2
   [1] 2.654676
   
   ---
   x.1$GROUP: 3
   [1] 4.153846
   
   
   Jim
   __
   James HoltmanWhat is the problem you are trying to solve?
   Executive Technical Consultant  --  Office of Technology, Convergys
   [EMAIL PROTECTED]
   +1 (513) 723-2929
   
   
   
   
  
 Dan Bolser
   
  
 [EMAIL PROTECTED]To:  
R mailing list r-help@stat.math.ethz.ch  
  
 uk  cc:  
   
  
 Sent by: Subject: 
[R] weighted.mean and tapply (again)   
  
 [EMAIL PROTECTED] 
   
  
 ath.ethz.ch   
   
  
   
   
  
   
   
  
 05/25/2005 11:33  
   
  
   
   
  
   
   
   
   
   
   I read answers to questions including the words tapply and
   weighted.mean, but I didn't understand either the problem 
   (data) or the
   solution provided.
   
   Here is my question ...
   
dat[1:10,]
 GROUP  VALUE FREQUENCY
   1 2  278
   2 2  340
   3 2  416
   4 2  5 3
   5 2  6 1
   6 2  8 1
   7 3  319
   8 3  410
   9 3  519
   1 3  6 4
   
   
   For each GROUP, I would like to calculate the weighted.mean 
   of VALUE using
   the FREQUENCY as the weight, so for the snippet of data 
   shown that would
   be...
   
   group.2 - weighted.mean(c(2,3,4,5,6,8),c(78,40,16,3,1,1))
   group.3 - weighted.mean(c(3,4,5,6),c(19,10,19,4))
   
cbind(rbind(2,3),rbind(group.2,group.3))
   [,1] [,2]
   group.22 2.654676
   group.33 4.153846
   
   I would like to use tapply to automatically do this across the whole
   dataset (dat) - which includes lots of other distinct 
   grouping factors,
   however, like I said, I couldn't understand (and therefore 
   apply to my
   data) any of the other solutions I found, so any help here would be
   greatly appreciated!
   
   All the best,
   Dan.
   
   __
   R-help@stat.math.ethz.ch mailing list
   https://stat.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide!
   http://www.R-project.org/posting-guide.html
   
   __
   R-help@stat.math.ethz.ch mailing list
   https://stat.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide! 
   http://www.R-project.org/posting-guide.html
   

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] unexpected behaviour of 'curve' function

2004-11-26 Thread Guazzetti Stefano
Dear all, 

curve(x^3*(1-x)^7, from = 0, to = 1)

works as  expected but, omitting the xlim or the to 
and from arguments and calling curve more than once:

par(mfrow = c(2,2))
for (i in 1:4)
curve(x^3*(1-x)^7)

gives an expected (al least to me) result.
Note also that a pu object is returned by curve

 pu
[1] -0.1802445  1.1802445

The behaviour is reproducible with both  R 2.0.0
and R 2.0.1

I can see that a promise of evaluation of pu
is made within curve but I cannot understand completely
what happens.

Thanks in advance, 

Stefano Guazzetti


platform i386-pc-mingw32
arch i386   
os   mingw32
system   i386, mingw32  
status  
major2  
minor0.0
year 2004   
month10 
day  04 
language R

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


R: [R] How to plot this

2004-11-17 Thread Guazzetti Stefano
Hi,
looking at ?plot.density you will find a zero.line argument: 
set it to FALSE and no gray lines will appear in the plot.

plot(density(y), zero.line = F,  main= , ann = F,
  xlim = c(0, 4), ylim = c(0, 1), lty = 2, col = 4, axes = F)
#and the add
 mtext(side = 1, line = 0, text = Environmental gradient )
 mtext(side = 2, line = 0, text = Abundance of species  )
 arrows(0, 0, 4, 0,  angle = 15, length = 0.1, lwd=2)
 arrows(0, 0, 0, 1,  angle = 15, length = 0.1, lwd=2)


Hope this helps
Stefano

 -Messaggio originale-
 Da: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] conto di [EMAIL PROTECTED]
 Inviato: mercoledì 17 novembre 2004 7.39
 A: [EMAIL PROTECTED]
 Oggetto: [R] How to plot this
 
 
 Hi there,
 
  
 
 I produced a plot using the following codes:
 
  
 
 y-rnorm(1000, 2, 0)
 
 x0-c(0, 0)
 
 y0-c(0, 0)
 
 y1-c(0, 1)
 
 x1-c(0, 4)
 
 plot(density(y), ylab=Abundance of species, xlab=Environmental
 gradient, main= , 
 
xlim=c(0, 4), ylim=c(0, 1), lty=2, col=4, xaxt=n, yaxt=n,
 frame.plot=F)
 
 lines(x0, y1) # add an axis
 
 lines(x1, y0) # add an axis
 
 arrows(3.95, 0, 4, 0,  angle = 15, length = 0.1)
 
 arrows(0, 0.98, 0, 1,  angle = 15, length = 0.1)
 
  
 
 Please help me to remove the grey horizontal line and put the axis
 labels closer to the axes. And also appreciate any 
 suggestions on how to
 make those arrows look nicer, e.g. a filled small arrow for each axis,
 like what from points(0, 1,   pch=17), but a slightly narrowed one.
 Thanks.
 
  
 
 Regards,
 
  
 
 Jin Li
 
 
 
 Jin Li, PhD
 
 Climate Impacts Modeller
 
 CSIRO Sustainable Ecosystems
 
 Atherton, QLD 4883, Australia
 
 
 
  
 
 
   [[alternative HTML version deleted]]
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


R: [R] retrieve rows from frame assuming criterion

2004-07-23 Thread Guazzetti Stefano
Assuming your data.frame is called data

data[data$PUNTAR==c(IX49,IX48),]

is probably what you want

Stefano



 -Messaggio originale-
 Da: Luis Rideau Cruz [mailto:[EMAIL PROTECTED]
 Inviato: venerdì 23 luglio 2004 15.37
 A: [EMAIL PROTECTED]
 Oggetto: [R] retrieve rows from frame assuming criterion
 
 
 Hi all,
 
 I have a data frame in which one column(PUNTAR) is of character type.
 What I want is to retrieve is the frame but only with those 
 rows matching elements of PUNTAR with a list characters (e.g 
 c(IX49,IX48) )
 
 YearTUR  STODNR   PUNTAR
 1994  9412 94020061 IX49
 1994  9412 94020062 IX48
 1994  9412 94020063  X32
 1994  9412 94020065  X23
 1994  9412 94020066  X27
 1994  9412 94020067 XI19
 1994  9412 94020068 XI16
 1994  9412 94020069 XI14
 1994  9412 94020070  XI8
 1994  9412 94020071  X25
 1994  9412 94020072  X18
 1994  9412 94020073 II23
 1994  9412 94020074XII33
 1994  9412 94020075XII31
 
 my.function(frame) should be then equal to 
 
 Year TURNR   STODNR M_PUNTAR
 1994  9412 94020061 IX49
 1994  9412 94020062 IX48
 
 Thank you in advance
 
 
 Luis Ridao Cruz
 Fiskirannsóknarstovan
 Nóatún 1
 P.O. Box 3051
 FR-110 Tórshavn
 Faroe Islands
 Phone: +298 353900
 Phone(direct): +298 353912
 Mobile: +298 580800
 Fax: +298 353901
 E-mail:  [EMAIL PROTECTED]
 Web:www.frs.fo
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


R: [R] retrieve rows from frame assuming criterion [corrected]

2004-07-23 Thread Guazzetti Stefano
sorry for my previus (WRONG)
answer, as someone already pointed out
a solution could be

subset(data, PUNTAR==c(IX49,IX48))



 -Messaggio originale-
 Da: Guazzetti Stefano 
 Inviato: venerdì 23 luglio 2004 15.55
 A: 'Luis Rideau Cruz'; [EMAIL PROTECTED]
 Oggetto: R: [R] retrieve rows from frame assuming criterion
 
 
 Assuming your data.frame is called data
 
 data[data$PUNTAR==c(IX49,IX48),]
 
 is probably what you want
 
 Stefano
 
 
 
  -Messaggio originale-
  Da: Luis Rideau Cruz [mailto:[EMAIL PROTECTED]
  Inviato: venerdì 23 luglio 2004 15.37
  A: [EMAIL PROTECTED]
  Oggetto: [R] retrieve rows from frame assuming criterion
  
  
  Hi all,
  
  I have a data frame in which one column(PUNTAR) is of 
 character type.
  What I want is to retrieve is the frame but only with those 
  rows matching elements of PUNTAR with a list characters (e.g 
  c(IX49,IX48) )
  
  YearTUR  STODNR   PUNTAR
  1994  9412 94020061 IX49
  1994  9412 94020062 IX48
  1994  9412 94020063  X32
  1994  9412 94020065  X23
  1994  9412 94020066  X27
  1994  9412 94020067 XI19
  1994  9412 94020068 XI16
  1994  9412 94020069 XI14
  1994  9412 94020070  XI8
  1994  9412 94020071  X25
  1994  9412 94020072  X18
  1994  9412 94020073 II23
  1994  9412 94020074XII33
  1994  9412 94020075XII31
  
  my.function(frame) should be then equal to 
  
  Year TURNR   STODNR M_PUNTAR
  1994  9412 94020061 IX49
  1994  9412 94020062 IX48
  
  Thank you in advance
  
  
  Luis Ridao Cruz
  Fiskirannsóknarstovan
  Nóatún 1
  P.O. Box 3051
  FR-110 Tórshavn
  Faroe Islands
  Phone: +298 353900
  Phone(direct): +298 353912
  Mobile: +298 580800
  Fax: +298 353901
  E-mail:  [EMAIL PROTECTED]
  Web:www.frs.fo
  
  __
  [EMAIL PROTECTED] mailing list
  https://www.stat.math.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


R: R: [R] retrieve rows from frame assuming criterion [corrected]

2004-07-23 Thread Guazzetti Stefano
Yes, 
paraphrasing Murphy I can say of myself:

Nothing seems to be able to stop a stupid thought
in its pathway from the brain to the keyboard.  :-)

Sorry once again and thank for your patience.

Stefano

 -Messaggio originale-
 Da: Prof Brian Ripley [mailto:[EMAIL PROTECTED]
 Inviato: venerdì 23 luglio 2004 16.30
 A: Guazzetti Stefano
 Cc: Luis Rideau Cruz; [EMAIL PROTECTED]
 Oggetto: Re: R: [R] retrieve rows from frame assuming criterion
 [corrected]
 
 
 On Fri, 23 Jul 2004, Guazzetti Stefano wrote:
 
  sorry for my previus (WRONG)
  answer, as someone already pointed out
  a solution could be
  
  subset(data, PUNTAR==c(IX49,IX48))
 
 That's still wrong.  You want PUNTAR %in% c(IX49,IX48).  Using ==
 recycles entries, so it tests the first element against 
 IX49, the second
 against IX48, the third against IX49 
 
   -Messaggio originale-
   Da: Guazzetti Stefano 
   Inviato: venerdì 23 luglio 2004 15.55
   A: 'Luis Rideau Cruz'; [EMAIL PROTECTED]
   Oggetto: R: [R] retrieve rows from frame assuming criterion
   
   
   Assuming your data.frame is called data
   
   data[data$PUNTAR==c(IX49,IX48),]
   
   is probably what you want
   
   Stefano
 
 -- 
 Brian D. Ripley,  [EMAIL PROTECTED]
 Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
 University of Oxford, Tel:  +44 1865 272861 (self)
 1 South Parks Road, +44 1865 272866 (PA)
 Oxford OX1 3TG, UKFax:  +44 1865 272595
 


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


R: [R] proportions confidence intervals

2004-07-12 Thread Guazzetti Stefano
You should consider prop.test or  binom.test. 
The problem you will find is that these functions are 
not intended to do what you want but to give you one
confidence interval at a time.

However a starting point could be :

 I-sample(1:50) #the numerator
 N-sample(50:200, 50) #the denominator
 conf.intervals-t( sapply(
mapply(binom.test, SIMPLIFY=F, x=I, n=N), [[, conf.int) )

 cbind(I, N, P=I/N, conf.int)



best whishes, 

Stefano


-Messaggio originale-
Da: Darren Shaw [mailto:[EMAIL PROTECTED]
Inviato: lunedì 12 luglio 2004 17.45
A: [EMAIL PROTECTED]
Oggetto: [R] proportions confidence intervals


Dear R users

this may be a simple question - but i would appreciate any thoughts

does anyone know how you would get one lower and one upper confidence 
interval for a set of data that consists of proportions.  i.e. taking a 
usual confidence interval for normal data would result in the lower 
confidence interval being negative - which is not possible given the data 
(which is constrained between 0 and 1)

i can see how you calculate a upper and lower confidence interval for a 
single proportion, but not for a set of proportions

many thanks


Darren Shaw



-
Dr Darren J Shaw
Centre for Tropical Veterinary Medicine (CTVM)
The University of Edinburgh
Scotland, EH25 9RG, UK

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


R: [R] Creating Binary Outcomes from a continuous variable

2004-07-07 Thread Guazzetti Stefano
consider a cutpoint of 20

x-runif(100, min=1, max=50)
as.integer(x  20)

Stefano

 -Messaggio originale-
 Da: Doran, Harold [mailto:[EMAIL PROTECTED]
 Inviato: mercoledì 7 luglio 2004 14.57
 A: [EMAIL PROTECTED]
 Oggetto: [R] Creating Binary Outcomes from a continuous variable
 
 
 Dear List:
 
  
 
 I have searched the archives and my R books and cannot find a 
 method to
 transform a continuous variable into a binary variable. For example, I
 have test score data along a continuous scale. I want to create a new
 variable in my dataset that is 1=above a cutpoint (or passed the test)
 and 0=otherwise.
 
  
 
 My instinct tells me that this will require a combination of the
 transform command along with a conditional selection. Any help is much
 appreciated.
 
  
 
 Thanks,
 
 Harold
 
 
   [[alternative HTML version deleted]]
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


R: [R] help with histogram

2004-05-07 Thread Guazzetti Stefano
Maybe you want something like:

x-rnorm(1000)
hist(x, breaks=100,
 col=ifelse(abs((hist(x, breaks=100, main=))$breaks)  1.669,
 4,2))

see also the density argument in ?hist
Stefano

 -Messaggio originale-
 Da: Martin Olivier [mailto:[EMAIL PROTECTED]
 Inviato: venerdì 7 maggio 2004 14.40
 A: r-help
 Oggetto: [R] help with histogram
 
 
 Hi all,
 
 I need some help with the function histogram. Let x be a vector.
 The command hist(x,col=blue) gives an histogram for the vector x.
 I would like to add some colors in the graphics such that the 
 histogram is
 red if abs(x)1.669 and blue otherwise...and what is the 
 solution if I 
 want to
 change the  filling instead of the color
 
 Thanks for your help,
 Olivier
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


R: [R] lines and glm

2004-04-08 Thread Guazzetti Stefano
You probably mean something like:

 ti - 1:1000
 e1 - rnorm(1000)
 e2 - rnorm(1000)
 x - 0.0001*ti+e1
 y2 - -2+x+e2
 y - ifelse(y20,1,0)
 
 plot(x, y, pch = 16, col = darkblue,
  main = expression(paste(Scatter diagram of , 
italic(y[t]), against ,  italic(x[t]))),
  xlab = expression(italic(x[t])),
  ylab = expression(italic(y[t])))

 model-glm(y ~ x, family = binomial)
 predProbs-predict(model,data.frame(x=seq(min(x), max(x), length.out=100)), 
type=response)
 lines(seq(min(x), max(x), length.out=100), predProbs, col=2, lwd=2)



Note also that it is not a good idea to name t a R object, since the name is 
reserved for a special function.


Stefano


 -Messaggio originale-
 Da: Jan P. Smit [mailto:[EMAIL PROTECTED]
 Inviato: giovedì 8 aprile 2004 13.38
 A: [EMAIL PROTECTED]
 Oggetto: [R] lines and glm
 
 
 Dear R-helpers,
 
 I'm a beginner using R 1.8.1 on Windows 2000. I'm trying to 
 replicate some
 examples in Franses'  Paap's Quantitative Models in 
 Marketing Research. 
 
  t - 1:1000
  e1 - rnorm(1000)
  e2 - rnorm(1000)
  x - 0.0001*t+e1
  y2 - -2+x+e2
  y - ifelse(y20,1,0)
  
  plot(x, y, pch = 16, col = darkblue,
 +  main = expression(paste(Scatter diagram of , italic(y[t]), 
 against ,
 +  italic(x[t]))),
 +  xlab = expression(italic(x[t])),
 +  ylab = expression(italic(y[t])))
  lines(glm(y ~ x, family = binomial))
 
 Error in xy.coords(x, y) : x and y lengths differ
 
 However, 
 
  length(x)
 [1] 1000
  length(y)
 [1] 1000
 
 as it should be.
 
 I'm sure I must be missing something obvious, but it is not 
 clear to me
 (after reading the Introduction, FAQ and the relevant 
 functions help pages)
 what.
 
 Sincerely,
 
 Jan Smit
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


R: [R] Changing background in splom et al.

2004-03-03 Thread Guazzetti Stefano

trellis.device(bg=white, color=F)

before your call to splom could make what you want but 
take also a look at

?trellis.par.set


Stefano

 -Messaggio originale-
 Da: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Inviato: mercoledì 3 marzo 2004 12.10
 A: r-help
 Oggetto: [R] Changing background in splom et al.
 
 
 Context: Windows XP, R 1.8.1
 
 I'm studying Venables-Ripley MASS book and having a go at 
 the  many examples
 in library MASS. The code I'm checking (from script ch04.R) now is 
 
 ..
 data(swiss)
 splom(~ swiss, aspect = fill,
   panel = function(x, y, ...) {
  panel.xyplot(x, y, ...); panel.loess(x, y, ...)
   }
 )
 
 which produces an agreable plot with a gray background and 
 cyan points,
 but.
 Copying the plot as a metafile into Word and having a laser 
 printer I'd
 better stick to a b/w plot. 
 
 How can I turn the background to white and the cyan points to black?
 
 Ciao - Vittorio
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html