Re: [R] years from as.POSIXlt

2004-03-09 Thread Thomas Petzoldt
as.numeric(format(x, f="%j")) which is the right code, works perfectly, too. Thomas P. __ [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

Re: [R] years from as.POSIXlt

2004-03-09 Thread Thomas Petzoldt
Prof Brian Ripley wrote: See ?julian, which says Note: Other components such as the day of the month or the year are very easy to computes: just use 'as.POSIXlt' and extract the relevant component. Hello, unfortunately not all mentioned functions work on all machines. Where > m

Re: [R] maxima

2004-03-09 Thread Thomas Petzoldt
Z P wrote: Dear all, suppose I have a bi-variate function f(x,y), I want to find the maxima. I define x and y vector, and get matrix z=f(x,y). how can I get which (x0,y0) makes z become the maxima? If you have function values as matrix, you may simply use: which(z==max(z), arr.ind=TRUE) or you

Re: [R] Sweave and Xemacs on Windows2000?

2004-02-26 Thread Thomas Petzoldt
wolski wrote: Hallo! Trying to configure Xemacs to work with .snw files on windows 2000. Tried to do it how it is described in the FAQ for Sweaves. When starting xemacs with and Snw file *ESS* buffer contains hundrets of lines and the few last ones. [...] And no syntax highlighting in the *.Snw

Re: [R] be careful: using attach in R functions

2004-02-24 Thread Thomas Petzoldt
li dongfeng wrote: > Hi there, > > I have just found that the ``attach'' function > can get you into trouble when called many times. [..] > Below is a demonstration of this performance loss, > you will see a linear growth in CPU time usage. > Adding a ``detach()'' call at the end of ``f'' > wi

[R] Re: (read many files)

2004-02-24 Thread Thomas Petzoldt
Claudia Paladini wrote: Dear ladies and gentlmen, I want to import a directory with about 400 files (.dat) in R. I know how to import a single file (with scan...) but I've good no idea how to import 400 at once. Can you help me ? Thanks a lot! Claudia setwd("c:/myfiles/") ## list.files uses regul

Re: [R] r: plots

2004-02-24 Thread Thomas Petzoldt
, at=pretty(z*fac), label=pretty(z*fac)/fac, ylab="z") mtext("z", side=4, line=2.5) # more about this see ?axis, ?pretty and ?mtext Thomas P. -- Thomas Petzoldt Dresden University of Technology Institute of Hydrobiology [EMAIL PROTEC

Re: [R] Computing the mode

2004-02-24 Thread Thomas Petzoldt
ersion of the one in R-news 2003/3 p. 9). Thomas P. -- Thomas Petzoldt Dresden University of Technology Institute of Hydrobiology [EMAIL PROTECTED] 01062 Dresden http://www.tu-dresden.de/fghhihb/ __ [EMAIL PROTECTED] maili

Re: [R] library nnet

2004-02-23 Thread Thomas Petzoldt
Perez Martin, Agustin wrote: DeaR useRs: I am looking for a function which fits a multinomial model and in BaronĀ“s page I find the function "multinom" in package "nnet" but this package is deprecated. Really? What do you mean with deprecated? I suppose that this function is now in other package b

[R] efficient matrix approx

2004-02-19 Thread Thomas Petzoldt
Hello, I am looking for a highly efficient matrix version of linear interpolation (like approx). As an example I have data like follows: x<-data.frame(time=1:20, x=(1:20)/10, y=runif(20)) t <- seq(1.5, 15.5 ,by=0.5) # and I found the following solution: nam <- names(x) app <- lapply(x[2:3],approx

Re: [R] filling the area between two curves in a plot

2004-02-19 Thread Thomas Petzoldt
Rajarshi Guha wrote: Hi, does anybody know how I can color the area enclosed between two curves on a plot? This is possible with the polygon function. Try something like: # create some data x <- sort(runif(10, min=0, max=10)) y <- runif(10, min=2, max=5) #Polygon-Plot plot(x,y, type="n", ylim=c

[R] Re: R for economists

2004-02-19 Thread Thomas Petzoldt
Arne Henningsen wrote: Hi, I did not find any web page about using R in economics and econometrics so far. However, this does not mean that there is none (searching with google for "R" and "economics" gives many pages about economics and a name like Firstname R. Lastname on it ;-)). Does anyb

Re: [R] interesting feature

2004-02-18 Thread Thomas Petzoldt
Svetlana Eden wrote: Hi, everybody. This was an interesting discussion last time and it helped me a lot. Could you please have a look at some feature and tell me why it was designed this way What you see in the first column are the row names. The index is 1,2,3,4 as usual. Thomas P. ___

[R] Sweave and .Rd files

2004-02-04 Thread Thomas Petzoldt
Hello, I found Sweave to be a very promising approach and in R-News 2003-2 Friedrich Leisch wrotes about writing package vignettes. There is another approach of Henrik Bengtsons R.oo package mixing R sourcecode and documentation, so I wonder if there is an approach using Sweave together with .

Re: [R] Levels number of a factor object

2004-01-23 Thread Thomas Petzoldt
Laurent Houdusse schrieb: Hi all! How to retrieve the levels number of a factor object? See this code: groups<-gl(4,10) I want to retrieve the number of levels (4) of my object "groups" I tried groups.levels but this don't work Simply try: length(levels(groups)) Thomas P. _

Re: [R] Re: using LSODA in R

2003-11-07 Thread Thomas Petzoldt
a simulation platform in ecological modelling. Thomas Petzoldt -- Thomas Petzoldt Dresden University of Technology Institute of Hydrobiology [EMAIL PROTECTED] 01062 Dresden http://www.tu-dresden.de/fghhihb/petzoldt/ __ [EMAIL PROTECTED] mailin

Re: [R] How to Extract Std.Error

2003-10-30 Thread Thomas Petzoldt
the summary() with str(summary(model)) looking into this, the following (or something similar for the other values) should work: summary(reg)$coefficients[,2] Thomas P. -- Thomas Petzoldt Dresden University of Technology Institute of Hydrobiology [EMAIL PROTECTED] 01062 Dres

[R] OOP like handling of lists?

2003-10-23 Thread Thomas Petzoldt
de the full OOP-approach in R-News 1(2002)3 of Chambers and Lang works, but may be a little bit to complicated to explain it to my collegues and students. So, is there an alternative to do such things, which I may have overlooked? Tha

Re: [R] If I produce lots of figures at one time, how can I make R graphics keep all the figures already made?

2003-10-07 Thread Thomas Petzoldt
graphics window is activated. Thomas Petzoldt __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Re: [R] prcomp or princomp

2003-10-06 Thread Thomas Petzoldt
Ann Devitt schrieb: Hello, is there any documentation on doing principal components analysis with R besides the R manual itself which is not very informative yes, see the reference cited on the princomp() - help page: Venables, W. N. and B. D. Ripley (2002). Modern Applied Statistics with S, S

Re: [R] convert a Character-string to a number

2003-09-12 Thread Thomas Petzoldt
Michael Kirschbaum schrieb: Hi Everyone. I have a simple problem but don't know, how to get along. how can I convert the vector a<-c("0,01","1,00") in a vector b<-c(0.01,1.00) Thank you for suggestions Ah, it seems to be a common German problem. My solution is: as.numeric(sub(",",".",a)) Th

Re: [R] Getting greek letters in plot labels and title

2003-09-12 Thread Thomas Petzoldt
expression(Phi), main=expression(Phi==f(x))) Thomas -- Thomas Petzoldt Dresden University of Technology Institute for Hydrobiology [EMAIL PROTECTED] 01062 Dresden http://www.tu-dresden.de/fghhihb/ __ [EMAIL PROTECTE

Re: [R] Making R packages

2003-09-09 Thread Thomas Petzoldt
Gattuso, Jean-Pierre wrote: The following command is run in a windows console: C:\Program Files\R\rw1071\bin\rcmd INSTALL D:\CO2 Then he gets the following error (approximate translation of a French message) : "Perl is not recognized as an internal or external command, an executable fil

Re: [R] R video

2003-09-09 Thread Thomas Petzoldt
n-free software or tools to make animated Gifs. Thomas -- Thomas Petzoldt Dresden University of Technology Institute for Hydrobiology [EMAIL PROTECTED] 01062 Dresden http://www.tu-dresden.de/fghhihb/ __ [EMAIL PROTECTED] mailin

Re: [R] [Off] Ecological Modelling's Book Suggestion.

2003-09-08 Thread Thomas Petzoldt
Ronaldo Reis Jr. Wrote: Hi, Anybody can suggest a good Ecological Modelling's Book. Hello, there is an increasing number of interesting books published recently and it is a matter of taste, which to read first. For a comprehensive understanding you probably should read more than one book. Belo

Re: [R] difference between <- and =

2003-08-29 Thread Thomas Petzoldt
Levi Larkey schrieb: Hi, I'm somewhat new to R and I'm trying to figure out the difference between the operators <- and =. <- is an assignement operator = is primarily used for named arguments Some thoughts about the use of = as assignement operator can be found on: http://developer.r-project.o

Re: [R] how to call a C program from R function

2003-08-28 Thread Thomas Petzoldt
Martin Olivier wrote: Hi all, I would like to call a C program from R function. I tried to use the .C() function without success. I need a very simple example (such as the hello program) to understand Do you want to call a C program (executable) or a shared library? If you want to run a compil

Re: [R] Newbie graphing questions

2003-08-28 Thread Thomas Petzoldt
Marc Schwartz wrote: In general, if you want to leave the existing device open and have a new device open for a new plot, you simply call the device name that you want to open (ie. under Linux you would use X11() ) to open a new plotting device on the display. See ?Devices for more details. X11()

Re: [R] read.spss (package foreign) and character columns

2003-08-28 Thread Thomas Petzoldt
RINNER Heinrich wrote: In R: library(foreign) test <- read.spss("test.sav", to.data.frame=T) test XCHAR 1 a 2 ab 3 abcde levels(test$XCHAR) [1] "a" "ab " "abcde" Shouldn't it rather be "a" "ab" "abcde" (no blanks)? I think, that should be no problem since the blanks in XCHAR may

Re: [R] Simple simulation in R

2003-08-26 Thread Thomas Petzoldt
Hello all I have a feeling this is very simple..but I am not sure how to do it My boss has two variables, one is an average of 4 numbers, the other is an average of 3 of those numbers i.e var1 = (X1 + X2 + X3 + X4)/4 var2 = (X1 + X2 + X3)/3 Hello Peter, try the following:

Re: [R] floodfill with matrix data

2003-08-25 Thread Thomas Petzoldt
Barry Rowlingson wrote: Howabout this i just bashed up from a quick search: boundaryFill <- function(mat, x,y,fill,boundary) [...] note it fills 4-connected regions. I wouldnt like to do it on anything complex since it'll be awful slow Yes, this is in principle the same solution I use dur

[R] floodfill with matrix data

2003-08-25 Thread Thomas Petzoldt
though I wrote a simple C function for this, it would be very helpful to find a more professional solution. Any suggestions or code snippets are greatly appreciated. Thomas Petzoldt -- The problem: ## (1) Given the follow

[R] implementing ecological models in R

2003-03-04 Thread Thomas Petzoldt
ial can be found on http://www.tu-dresden.de/fghhihb/petzoldt/zeugs.html together with an absolutely preliminary version of an accompanying library (the name simecol may be changed soon). Thank you for your feedback! Many thanks to all the people who are making the R-project possible! T

<    1   2