.
Patrick Kuss wrote:
> Dear Sander Oom and Jim Lemon,
>
> thanks for putting the soils.texture() function into R. However, for
> whatever reason I am not able to display the triangle correctly. Each of
> the 27 tick labels shows as "c(10,20,30,40,50,60,70,80,90)" and thus
&g
jnenvoer 35, Leuven, Belgium
> Tel: +32/(0)16/336899
> Fax: +32/(0)16/337015
> Web: http://med.kuleuven.be/biostat/
> http://www.student.kuleuven.be/~m0390867/dimitris.htm
>
>
> - Original Message -
> From: "Sander Oom" <[EMAIL PROTECTED]>
> To:
> Se
Dear R users,
When you do:
> x <- rnorm(10)
> y <- rnorm(10)
> z <- rnorm(10)
> a <- data.frame(x,y,z)
> a$x
[1] 1.37821893 0.21152756 -0.55453182 -2.10426048 -0.08967880 0.03712110
[7] -0.80592149 0.07413450 0.15557671 1.22165341
Why does this not work:
> a[a$y>0.5,y] <-1
Error in "[<-.d
objects, but columns of y. So you need to specify
> that.
>
> y$x4 <- ifelse(y$x1 > 0, y$x2, y$x3)
>
>
>
> ________
>
> From: [EMAIL PROTECTED] on behalf of Sander Oom
> Sent: Sat 11/03/2006 11:23 PM
> To: r-help@stat.math.ethz.
Dear R-users,
I need to do an SQL like, conditional, operation on a data frame using
an ifelse construction. However I can not get it to work.
Example:
> x1 <- rnorm(10)
> x2 <- rnorm(10)
> x3 <- rnorm(10)
> x3 <- NA
> y <- cbind(x1,x2,x3)
> y
x1 x2 x3
[1,] -0.56927780 -0
Thanks for the very useful tips!
Now I have enough round and square bracket and other tricks to wrap up
the function! The double square bracket trick in test[[varname]] is golden!
Thanks again,
Sander.
__
R-help@stat.math.ethz.ch mailing list
https:/
Dear all,
I have a data frame containing the results of an experiment. Like this:
a<-seq(1,4,by=1)
b<-seq(1,2,by=1)
test<-expand.grid(b,a,a)
colnames(test)<-c("replicates","bins", "groups")
test$abc <- rnorm(32)
test$def <- rnorm(32)
test$ghi <- rnorm(32)
test
The following code snippet aggregat
Shame nobody has included this function in their package! Would be
useful to have as a standard function!
Sander.
Dimitris Rizopoulos wrote:
> take a look at this function by Kevin Wright
>
> RSiteSearch("sort.data.frame")
>
>
> Best,
> Dimitris
>
>
> Dimitris Rizopoulos
> Ph.D. Student
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
> daily_max 44 42 39 41 45 43 42 45 NA42
> above_37 21 213221 NA 1
> above_39 21013211 NA 1
> above_41 21002211
; Ph.D. Student
> Biostatistical Centre
> School of Public Health
> Catholic University of Leuven
>
> Address: Kapucijnenvoer 35, Leuven, Belgium
> Tel: +32/16/336899
> Fax: +32/16/337015
> Web: http://www.med.kuleuven.ac.be/biostat/
> http://www.student.kule
Best,
> Dimitris
>
>
> Dimitris Rizopoulos
> Ph.D. Student
> Biostatistical Centre
> School of Public Health
> Catholic University of Leuven
>
> Address: Kapucijnenvoer 35, Leuven, Belgium
> Tel: +32/16/336899
> Fax: +32/16/337015
> Web: http://ww
Dear all,
We have a large data set with temperature data for weather stations
across the globe (15000 stations).
For each station, we need to calculate the number of days a certain
temperature is exceeded.
So far we used the following S code, where mat88 is a matrix containing
rows of 365 dai
Now you made me curious!
Installed the package myself as well!
Maybe you can send an example graph to Romain, to be included in the
graph gallery. Then we can all see what plot3d does!
Thanks,
Sander.
Sander Oom wrote:
Sabine,
It helps us to help you if you tell us what you want to do
Sabine,
It helps us to help you if you tell us what you want to do, preferably
with a code example, and what system/version of R you have: type version.
On my PC I get:
> version
_
platform i686-pc-linux-gnu
arch i686
os linux-gnu
system i686, linux-gnu
status
major2
m
.
Romain Francois wrote:
Le 07.06.2005 12:36, Sander Oom a écrit :
I agree that a wiki to facilitate submission of graph code could be
very effective! Still needs to be well protected against vandalism.
Seems a regular backup, to facilitate a clean restore, is the best
approach.
Romain, would you
Why ask if you already know the answer. Did you try table()?
Other commands related: reshape {stats} and xtabs {stats}
I learned about this only a couple of days ago on this list!
Meanwhile read the posting guide and send your requests in English.
Good luck,
Sander.
Hansi Weissensteiner wro
Oooops, already missed one:
5. search of the R mailing lists: http://maths.newcastle.edu.au/~rking/R/
ad5. never used this before. Think Google also does an excellent job
finding these if you start search with "R".
Sander.
Sander Oom wrote:
Maybe some of this confusion ab
!!
Sander.
Chris Evans wrote:
On 6 Jun 2005 at 17:48, Sander Oom wrote:
... much snipped ...
The whole point of a gallery is to show something to the user before
the user knows what he is looking for. The R help functions currently
available are hopeless when you have a picture of a graph in
Barry Rowlingson wrote:
Romain Francois wrote:
Graphics will be classified in :
- categories
- sub-categories within those categories
So far so good.
Maybe, maybe not! Would a system of keywords work better than strict
hierarchical categories, as long as plots can have more than one key
Navarre Sabine wrote:
> Hi,
>
> I would like to do a polar graph (=star graph) ! is that graph existing on R?
> Because more softwares can do that but I don't found it on R!
>
> Thanks
>
> Sabine
>
>
> -
>
> ils, photos et vid廩s !
>
> [[
Maybe some of this confusion about search opportunities and pros/cons
could be avoided if the search page on CRAN
(http://cran.r-project.org/search.html) would be extended to cover all
main search tools!
Quickly scanning the discussion, I found these:
1- simply Google: some tips and tricks hav
Hi Thomas,
Your code works perfectly!
Thanks a lot,
Sander.
Thomas Lumley wrote:
On Fri, 3 Jun 2005, Sander Oom wrote:
Dear R users,
I have received a table in the following format:
id a b c1 c2 d1 d2
1 1 1 65 97 78 98
2 1 2 65 97 42 97
3 2 1 65 68 97 98
Dear R users,
I have received a table in the following format:
id a b c1 c2 d1 d2
1 1 1 65 97 78 98
2 1 2 65 97 42 97
3 2 1 65 68 97 98
4 2 2 65 97 97 98
Factors of the design are: a, b, and e, where e has levels c and d. The
levels c and d then have 2 rep
Indeed it does! Sorry for the impulsive response!
Sander.
Duncan Murdoch wrote:
Sander Oom wrote:
An interesting thought just came to me when reading this discussion! I
use both R and Latex and have never had the trouble of overlooking
error messages when debugging long Latex code!
Of
An interesting thought just came to me when reading this discussion! I
use both R and Latex and have never had the trouble of overlooking error
messages when debugging long Latex code!
Of course this is because when compiling a latex document, a summary of
the compilation process is provided a
Hi Charles,
Warm felt sympathies for your struggles. I consider myself a happy GUI
user and have also struggled with the 'command line' history and lack of
out-of-the-box functionality associated with Linux. However, Linux does
have many, many advantages over other OS's, so I will stick to it.
HI Robert,
Of course Linux already has a console! Just type R in the Terminal
console and R will start (assuming all is installed correctly). Graphics
will be launched in separate windows.
If you want more then the Terminal console, try:
http://www.sciviews.org/_rgui/
Good luck,
Sander.
R
nd + Silt + Clay
= 1,
# are: P(1-Sand+(Sand-(1-Silt))*0.5, Clay*sin(pi/3))
#
# Author(s)
#
# Jim Lemon
# Sander Oom
#
# References
#
# Soil Survey Division Staff. 1993. Soil survey manual. Soil Conservation
Service.
# U.S. Department of Agriculture Handbook 18.
#
# Examples
#
# # some tria
9,0.06*sin60,"Silt", col=coltext)
par(oldpar)
}
tmp <- array(dim=c(10,3))
tmp[,2] <- abs(rnorm(10)*20)
tmp[,3] <- abs(rnorm(10)*10)
tmp[,1] <- 100-tmp[,2]-tmp[,3]
col <- rep("black",10)
pch <- rep(1, 10)
plot.soiltexture(tmp,pch,col=NULL,colgrid="black&qu
with the generic plot functions works well.
Makes the function less dependent on other packages!
Will merge the two functions into one and post it back to the mailing
list! Then the graph might be ready for the graph gallery!
Thanks,
Sander.
Jim Lemon wrote:
> Sander Oom wrote:
>&g
ot;, col="grey")
text(0.06,0.021,"Sand", col="grey")
x1<-c(0.37,0.435,0.5,0.8,0.86)
x2<-c(0.435,0.537,0.64,0.86,0.94)
y1<-c(0.2*sin60,0.08*sin60,0,0,0.12*sin60)
y2<-c(0.08*sin60,0.08*sin60,0.285*sin60,0.12*sin60,0.12*sin60)
segments(x1,y1,x2,y2,
n60)
segments(x1,y1,x2,y2, col="grey")
text(0.49,0.18*sin60,"Loam", col="grey")
text(0.72,0.15*sin60,"Silt loam", col="grey")
text(0.9,0.06*sin60,"Silt", col="grey")
par(oldpar)
}
tmp <- array(dim=c(10,3))
tmp[,1] &l
Hi Jari,
I assume this has been superseded by the ternaryplot{vcd} function!?
Thanks,
Sander.
Jari Oksanen wrote:
> Sander,
>
> Just a quick note before I go to the field.
>
> I attach a tri.R file for drawing ternary plots. The base function was
> posted to R News someday. One thing that I ad
Maybe I should try to figure out how to replicate your code inside a
ternaryplot{vcd} call.
Cheers,
Sander.
Jim Lemon wrote:
> Sander Oom wrote:
>> Dear R users,
>>
>> has anybody made an attempt to create the soil texture triangle graph
>> in R? For an example see here
Dear R users,
has anybody made an attempt to create the soil texture triangle graph in
R? For an example see here:
http://www.teachingkate.org/images/soiltria.gif
I would like to get the lines in black and texture labels in gray to
allow for plotting my texture results on top.
Any examples
Hikel, Jerry wrote:
Hi -- I have searched the documentation and archives on graphing
capabilities in R for the past couple of hours, but I haven't been able
to find anything directly related to my problem.
I want to create a plot with several lines displayed on it. I want each
line to be display
Dear R users,
I would like to use sub- and super-script in axis labels. I assume this
is best done using Hershey symbols. When trying to find information on
using Hershey font symbols in axis labels, I came across the following
discussion thread:
http://maths.newcastle.edu.au/~rking/R/help/0
different from
mean three but not mean one. You then get: a, ab, c for mean one, two
and three respectively.
Of course what is often used does not constitute the best way of doing it.
Sander.
Liaw, Andy wrote:
From: Sander Oom
Hi Chris and Chris,
I was keeping my eye on this thread as I have also
Hi Chris and Chris,
I was keeping my eye on this thread as I have also been discovering
multiple comparisons recently. Your instructions are very clear! Thanks.
Now I would love to see an R boffin write a nifty function to produce a
graphical representation of the multiple comparison, like this
e that involves Hmisc but not xtable...
detach("package:Hmisc")
library(xtable)
...code that involves xtable but not Hmisc...
On 5/16/05, Sander Oom <[EMAIL PROTECTED]> wrote:
I tried to follow your suggestions, but without success:
Error: couldn't find function "xtable.my
ge source
code.
Short of that, you should make sure that Hmisc is loaded later than
xtable,
and use something like what Gabor suggested to access label() in
xtable. (I
would use some other name, though: label() in xtable is already an S3
generic).
Andy
From: Sander Oom
Hi Andy and Gabor,
Th
to do that, as that constitute a change in the package source
code.
Short of that, you should make sure that Hmisc is loaded later than xtable,
and use something like what Gabor suggested to access label() in xtable. (I
would use some other name, though: label() in xtable is already an S3
gener
renaming the functions is to add namespace to
either xtable or Hmisc. Given the size of Hmisc, it probably would be much
easier to do that with xtable.
With namespace in xtable, you can do xtable:::label() to refer to the
label() in xtable specifically.
Andy
From: Of Sander Oom
Dear David,
I would li
(Hmisc) to export the anova table, but results are not
promising! I prefer xtable!!
Thanks,
Sander.
Frank E Harrell Jr wrote:
Sander Oom wrote:
Dear Frank,
I have a Sweave document in which I export anova (aov) tables to Latex
and calculate some summary statistics with summarize{Hmisc} for a
graph
v table to Latex using latex{Hmisc}.
Thanks very much for your help,
Sander.
Frank E Harrell Jr wrote:
Sander Oom wrote:
Dear R users,
The Sweave code below runs fine, as it is. However, an error occurs
when the line 'library(xtable)' is uncommented:
Error: chunk 1
Error in "label<
,...)
lpoints(x, y, pch=16, col="white", cex=2)
panel.superpose(x, y, type="p", ...)
},
par.settings= sp,
auto.key= list(columns=1, x=0.7, y=0.8, corner = c(0,0))
)
Deepayan Sarkar wrote:
On Friday 13 May 2005 10:36 am, Sander Oom wrote:
Hi Deepayan!
Deepaya
Hi Deepayan!
Deepayan Sarkar wrote:
On Friday 13 May 2005 08:07 am, Sander Oom wrote:
An off list response from Mat Soukop (thanks Mat!!) provides an even
more elegant solution (see code below)! I have included the original
code, so people can decide whether to plot in a single panel or in
27;free',x=list(at=1:4, labels=levels(tmp$AltGeo))),
xlim=c(0.5, 4.5), ylim=c(min(tmp$Lower)-1,max(tmp$Upper)+1),
xlab='AltGeo', ylab='Sodium',
panel = function(x, y, type, ...) {
panel.xYplot(x, y, type="p",...)
lpoints(x, y, pch=16
tmp$xvar <- rep(1:4, each=2)+rep(c(-.05,.05), 4)
xYplot(Cbind(Sodium,Lower,Upper) ~ xvar, groups=Position, data=tmp,
scales=list(y='free',x=list(at=1:4,
labels=levels(tmp$AltGeo))),
xlab='AltGeo', xlim=c(.5, 4.5),
key=list(points=Rows(trellis.par.get("superpose.
y aware of this and knows a workaround?
Thanks,
Sander.
***
\documentclass[a4paper]{article}
\title{Sweave Test for summarize}
\author{Sander Oom}
\usepackage{a4wide}
\begin{document}
\maketitle
\begin{figure}[ht]
\begin{center}
<>=
# library(xtable)
library(Hmisc)
set.seed(11
names = c("1",
"2", "3", "4", "5", "6", "7", "8"), class = "data.frame")
tmp$Position <- unclass(tmp$Position)
xYplot(Cbind(Sodium,Lower,Upper) ~ Position|AltGeo, groups=AltGeo,
data=tmp, ylim=c(mi
Dear all,
I am trying to plot means and error bars using xYplot, but I get an
error message from xYplot which I can not figure out:
> Error in Summary.factor(..., na.rm = na.rm) :
range not meaningful for factors
The data frame (tmpNa) was created using aggregate. I have used dump to
cre
(y,lower,upper) ~ month|continent, subset=sex=='male',data=dfr)
xYplot(Cbind(y,lower,upper) ~ month|continent, groups=sex, data=dfr); Key()
# add ,label.curves=FALSE to suppress use of labcurve to label curves where
# farthest apart
Deepayan Sarkar wrote:
On Wednesday 04 May 2005 10:30,
Dear R graphics gurus,
Another question about lattice graphics. This time I would like to plot
means and confidence intervals by group factor in a lattice graph. I can
not find any working lattice examples. Maybe a custom panel function is
the answer, but that is a bit beyond me for now.
The in
Dear R users,
If I manage to sort out this graph, it is certainly a candidate for the
new R graph gallery
(http://addictedtor.free.fr/graphiques/displayGallery.php)!
I created the following lattice graph:
library(lattice)
tmp <- expand.grid(geology = c("Sand","Clay","Silt","Rock"),
species =
loaded into R (as a matrix I suppose but what file formats
are supported)? I've seen the pixmap library but the formats are not broadly
supported.
-Original Message-
From: Sander Oom [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 16, 2005 3:49 AM
To: [EMAIL PROTECTED]
Subject: Apack
Hi Yyan,
The proj4R package by Roger Bivand will allow you to project data in
many ways and directions.
http://spatial.nhh.no/R/Devel/proj4R-pkg.pdf
It uses the proj libraries from:
http://www.remotesensing.org/proj/
Not sure where you would derive the time zone!
Good luck,
Sander.
yyan liu wrote
Hi Ernst,
Pretty soon some one is going to: 1) tell you that the mailing list is
in English, 2) that you should provide more details of your data and 2)
that your message should show signs that you have read the posting guide
and have searched the help documentation in a first attempt to find th
7;m open to any suggestion.
Romain.
Le 18.02.2005 14:33, Sander Oom a écrit :
Dear R users,
Following some of the recent questions and discussions about the R
plotting abilities, it occurred to me again that it would be very
valuable to have an R graph gallery.
Eric Lecoutre made a very nice example in:
providing access to all
users, but with limited maintenance costs for the provider.
Do others agree this could be a valuable resource? Would anybody have
the resources to host such an R graph gallery?
Yours,
Sander Oom.
--
-
Dr. Sander P. Oom
tor of the
original data that it is a good idea to plot his graphs in R instead of
excel. ;-)
Duncan Murdoch wrote:
On Wed, 16 Feb 2005 15:44:00 +0200, Sander Oom
<[EMAIL PROTECTED]> wrote :
Thanks Peter!
Of course I only have (nx-1)(ny-1) facets in a x*y plot!
The help page line:
...
the ramp even
though it has a surplus of colours (grey levels)! Why not just ignore
the surplus colours?
Anyway it works,
Sander.
Peter Dalgaard wrote:
Sander Oom <[EMAIL PROTECTED]> writes:
Dear R users,
Could somebody tell me why the grey color ramp is repeated in this
graph, eventhou
Dear R users,
Could somebody tell me why the grey color ramp is repeated in this
graph, eventhough the ramp values go from 0 to 1? I must be missing
something obvious, but I can not see it!
z <-
c(0.064329041,0.117243316,0.161565116,0.19923015,0.231642175,0.259835539,0.284571226,
0.038507288,0.
!?
Any suggesting how to resize the graph to plot the time line correctly
in postscript?
Thanks,
Sander.
Jim Lemon wrote:
Sander Oom wrote:
Dear R users,
In order to illustrate the possible effects of events on variables
plotted against time, I would like plot a time line of events along side
the plot
Rudi,
If it turns out that fonts can not be embedded with R, then one option
is to import/export the file through CorelDraw (or other vector drawing
software equivalent). The 'export to eps' function in CorelDraw provides
an option to embed all the fonts!
It requires manual labour, but it will
=-1,at=tl.labels[[1]],labels=tl.labels[[2]],col="black")
# now a vertical one
time.line(y=-1,at=tl.labels[[1]],labels=tl.labels[[2]],col="black")
> version
_
platform i386-pc-mingw32
arch i386
os mingw32
system i386, mingw32
status
major2
minor0.1
/howto/organize/images/timeline.gif
The rest of the graph can be generated as in the example below.
Any suggestions on how to plot the events along a time line?
Thanks in advance,
Sander Oom.
PS: Would it be an idea to start a R gallery of graphs with sample code?
I came across the 'R graph ga
trivial, namely:
A[A == 10] <- NA
M[M == 10] <- NA
return(A + M - 1)
Then if step d) is performed first (i.e. appropriate values in A are
replaced by the 'most common neighbour' [perhaps using
round(mean(.., na.rm=T))] this still works, but would have to be repeated
for each replicat
Dear all,
As our previous email did not get any response, we try again with a
reformulated question!
We are trying to do something which needs an efficient loop over a huge
array, possibly functions such as apply and related (tapply,
lapply...?), but can't really understand syntax and examples i
Dear all,
We are trying to clean multiple realizations of a pattern. Erroneous NODATA
and spurious DATA occur in the realizations. As we have to do a 1000
realizations for many patterns, efficiency of the code is important.
We need to correct the realizations with a 'mask' pattern of DATA/NODATA
ng from the gregmisc package with pad = TRUE:
require(gregmisc)
XY <- data.frame(num = seq(0,10), X = seq(0,30,3), Y = seq(0, 40, 4) )
DistXY <- function(idx) {
i <- idx[2]
with(XY, sqrt( (X[i]-X[i-1])^2 + (Y[i]-Y[i-1])^2 ) )
}
XY$Dist <- running( 1:nrow(XY), width=2, fun = Dis
:
unused argument(s) (i ...)
> detach(XY)
>
Any suggestions much appreciated,
Sander Oom.
--
Dr. Sander P. Oom
Animal, Plant and Environmental Sciences
University of the Witwatersrand
Private Bag 3
Wits 2050
South Africa
Tel (work)
) #
axis.POSIXct(1, at=seq(startMonth, endMonth, by="month"), format="%m/%y")
#r <- as.POSIXct(range(Time), "hours") #
clock24 <-
strptime(c("0","2","4","6","8","10","12","14","
The plot is nearly there! Using the axis.POSIXct command I have got the
x-axis under control. However, the units for the y-axis (Time) are in
seconds by default (i.e. range is from 0 to 1440). I'm trying to plot hours
along the y-axis, without changing the units for the plot itself, but
without
74 matches
Mail list logo