[R] Get Information

2008-11-08 Thread justin Kameni
I am a new commer in R. I am using the library tcltk, i need few information about it. so that, i wrote the following programme to save the file, but when i save the file, i do not find the file save, please help me, in order to continue my projet. this is the programme: tt <- tktoplevel() txt

Re: [R] [R-SIG-Finance] please recommend statistics, time series and econometrics books with finance, macroeconomics, trading and business applications

2008-11-08 Thread Brian G. Peterson
Michael wrote: Hi all, Please recommend good books for the following three categories. (I am aim at finance, macroeconomics, trading and business applications). (1) statistical (financial) data analysis; (2) time series; (3) econometrics. More specifically, I am looking for the following two t

Re: [R] [Stat related] Understanding Portmanteau test

2008-11-08 Thread Andrew Robinson
On Sat, Nov 08, 2008 at 09:58:14PM -0800, RON70 wrote: > > Still waiting for some input. Did my question void forum rule in any manner? No, no specific rule. It's just not a particularly easy question to answer, because it's not clear in what context you have seen the phrase "portmanteau test".

Re: [R] [Stat related] Understanding Portmanteau test

2008-11-08 Thread RON70
Still waiting for some input. Did my question void forum rule in any manner? RON70 wrote: > > Sorry to be off-topic. Can somebody please explain me what is Portmanteau > test? Why it's name is like that? When I would say, a particular test is > portmanteau test? I did some googling but got no s

Re: [R] Umlaut read from csv-file

2008-11-08 Thread Prof Brian Ripley
On Sat, 8 Nov 2008, Heinz Tuechler wrote: At 08:01 08.11.2008, Prof Brian Ripley wrote: We have no idea what you understood (you didn't tell us), but the help says encoding: character vector. The encoding(s) to be assumed when 'file' is a character string: see 'file'. A possible va

Re: [R] [R-SIG-Finance] please recommend statistics, time series and econometrics books with finance, macroeconomics, trading and business applications

2008-11-08 Thread Michael
I have read these books already... still searching for better books ... On Sat, Nov 8, 2008 at 7:49 PM, Spencer Graves <[EMAIL PROTECTED]> wrote: > One book is Ruey Tsay (2005) Analysis of Financial Time Series, 2nd ed. > (Wiley). The R package "FinTS" provides script files to that show how

Re: [R] [R-SIG-Finance] please recommend statistics, time series and econometrics books with finance, macroeconomics, trading and business applications

2008-11-08 Thread Spencer Graves
One book is Ruey Tsay (2005) Analysis of Financial Time Series, 2nd ed. (Wiley). The R package "FinTS" provides script files to that show how to work some of the example in the book. Try also "RSiteSearch" (www.r-project.org -> search PLUS the "RSiteSearch" function in R) for more

Re: [R] [OT] propensity score implementation

2008-11-08 Thread Frank E Harrell Jr
Wensui Liu wrote: Dear All, My question is more a statistical question than a R question. The reason I am posting here is that there are lots of excellent statistician on this list, who can always give me good advices. Per my understanding, the purpose of propensity score is to reduce the bias

Re: [R] maptools sunrise sunset function

2008-11-08 Thread stephen sefick
Nevermind, when one puts in the proper coordinates in decimal degrees everything works just fine. thanks for you patience, Stephen On Sat, Nov 8, 2008 at 7:40 PM, stephen sefick <[EMAIL PROTECTED]> wrote: > ##This is a function that I am trying to write to calculate sunrise > and sunset and works

Re: [R] Election Maps

2008-11-08 Thread Duncan Temple Lang
I've been marginally curious about this since 2004, and spent a little time providing the beginnings of a port which gives the basic facilities of Mark Newman's code in R. There is a package on the Omegahat repository via install.packages("Rcartogram", repos = "http://www.omegahat.org/R";,

[R] maptools sunrise sunset function

2008-11-08 Thread stephen sefick
##This is a function that I am trying to write to calculate sunrise and sunset and works "mostly", but returns nonsensical values. What am I #missing? Thanks in advance. ###remember to include maptools as dependence### library(maptools) sunrise.set <- function(lat, long, date, timezone="UTC", nu

[R] please recommend statistics, time series and econometrics books with finance, macroeconomics, trading and business applications

2008-11-08 Thread Michael
Hi all, Please recommend good books for the following three categories. (I am aim at finance, macroeconomics, trading and business applications). (1) statistical (financial) data analysis; (2) time series; (3) econometrics. More specifically, I am looking for the following two types of books: (

[R] [OT] propensity score implementation

2008-11-08 Thread Wensui Liu
Dear All, My question is more a statistical question than a R question. The reason I am posting here is that there are lots of excellent statistician on this list, who can always give me good advices. Per my understanding, the purpose of propensity score is to reduce the bias while estimating the

Re: [R] Parsing regular expressions differently - feature request

2008-11-08 Thread Wacek Kusnierczyk
Wacek Kusnierczyk wrote: > Duncan Murdoch wrote: > > Here's a quick hack to achieve the impossible: > That might solve John's problem, but I doubt it. As far as I can see it won't handle \L, for example. >>> well, it was not supposed to. it addre

Re: [R] determining plot location in lattice

2008-11-08 Thread Greg Snow
Glad I could be of help. Some possible enhancements that you may want to try: I would wrap all of that into a function so that the assignments using <<- don't put stuff into the global environment but just change things in the top level functions local environment. Rather than having the click

Re: [R] Parsing regular expressions differently - feature request

2008-11-08 Thread Wacek Kusnierczyk
Wacek Kusnierczyk wrote: > Duncan Murdoch wrote: > >> >> That might solve John's problem, but I doubt it. As far as I can see >> it won't handle \L, for example. >> >> > > well, it was not supposed to. it addresses the need for doubling > backslashes when a backslash character is an eleme

Re: [R] Parsing regular expressions differently - feature request

2008-11-08 Thread Wacek Kusnierczyk
Duncan Murdoch wrote: > Here's a quick hack to achieve the impossible: >>> That might solve John's problem, but I doubt it. As far as I can see >>> it won't handle \L, for example. >>> >> >> well, it was not supposed to. it addresses the need for doubling >> backslashes when a backslash char

Re: [R] Plotting Standard Regression Fit-Am I wrong or a bug?

2008-11-08 Thread Daniel Malter
Do: length(variablename) where variablename is in {mats,time,quar}, i.e. do it for each of them. This will tell you. Btw: I think you might wanna pickup an introductory manual. Btw. Peter Dalgaard pointed to the same issue regarding the plot. Daniel - cuncta stricte d

Re: [R] Re gular Expression help

2008-11-08 Thread Gabor Grothendieck
I'll see if I can speed it up if I get some time. I personally use it on relatively short strings where the low absolute time means that the higher relative time your comparisons show are not that important. On Sat, Nov 8, 2008 at 5:33 PM, Wacek Kusnierczyk <[EMAIL PROTECTED]> wrote: > Gabor Gro

Re: [R] Parsing regular expressions differently - feature request

2008-11-08 Thread Duncan Murdoch
On 08/11/2008 5:43 PM, Wacek Kusnierczyk wrote: Duncan Murdoch wrote: I was wondering if that is really necessary for perl=TRUE? wouldn't it be possible to parse a string differently in a regex context, e.g. automatically insert \\ for each \ , such that you can use the perl syntax directly? For

Re: [R] Parsing regular expressions differently - feature request

2008-11-08 Thread Wacek Kusnierczyk
Duncan Murdoch wrote: > >> I was wondering if that is really necessary for perl=TRUE? wouldn't >> it be >> possible to parse a string differently in a regex context, e.g. >> automatically insert \\ for each \ , such that you can use the perl >> syntax >> directly? For exampl

Re: [R] Plotting Standard Regression Fit-Am I wrong or a bug?

2008-11-08 Thread uep
However, now a linear regression with a factor for quarterly effect doesn't want to work for me: t2<-lm(mats~time+quar) and I get an error message: "Error in model.frame.default(formula = mats ~ time + quar, drop.unused.levels = TRUE) : variable lengths differ (found for 'quar')" Which variabl

Re: [R] Re gular Expression help

2008-11-08 Thread Wacek Kusnierczyk
Gabor Grothendieck wrote: > I suspect strapply is only relatively slow on short strings where > it doesn't matter anyways since for long strings performance would > likely be dominated by the underlying regexp operations. I know that > users are using the package for very long strings since I once

Re: [R] Plotting Standard Regression Fit-Am I wrong or a bug?

2008-11-08 Thread uep
Thank you Daniel, I did try to change xlim's and ylim's, but the fitted line still doesn't appear on the plot. Below is a small expample I've created (I'm sorry for using names, but I het confused with x's and y's): >mat<-matrix(c(1,2,3,4,5,6,7,8,1,2,3,4,1,2,3,4,1,5,2,7,3,7,5,8),nrow=8,ncol=3) >

Re: [R] question about the "Y of R" article in the latest R news

2008-11-08 Thread Gabor Grothendieck
On Sat, Nov 8, 2008 at 5:09 PM, Mark Kimpel <[EMAIL PROTECTED]> wrote: > I found the article the "Y of R" in the latest R news to be very > interesting. It is certainly challenging me to learn more about how R works > "under the hood" as the author states. What is less clear to me is whether > this

Re: [R] Re gular Expression help

2008-11-08 Thread Gabor Grothendieck
I suspect strapply is only relatively slow on short strings where it doesn't matter anyways since for long strings performance would likely be dominated by the underlying regexp operations. I know that users are using the package for very long strings since I once had to lift the 25,000 character

[R] question about the "Y of R" article in the latest R news

2008-11-08 Thread Mark Kimpel
I found the article the "Y of R" in the latest R news to be very interesting. It is certainly challenging me to learn more about how R works "under the hood" as the author states. What is less clear to me is whether this approach is primarily for teaching purposes or has a real world application. W

Re: [R] Re gular Expression help

2008-11-08 Thread Wacek Kusnierczyk
Gabor Grothendieck wrote: > For the problem at hand I think I would use your solution > which is both easily understood and fastest. On the > other hand the tapply based solutions are coordinate > free (i.e. no explicit mucking with indices) and readily > generalize to more than 2 groups -- just r

[R] [R-pkgs] New package "frontier" for Stochastic Frontier Analysis (SFA)

2008-11-08 Thread Arne Henningsen
Hi! A few weeks ago, I have uploaded a new R package "frontier" for Stochastic Frontier Analysis (SFA) [1] to CRAN [2]. It includes the FORTRAN code of Tim Coelli's [3] software "Frontier 4.1" [4]. Hence, the R package "frontier" should have the same capabilities as "Frontier 4.1", i.e. Maximum

Re: [R] Re gular Expression help

2008-11-08 Thread Gabor Grothendieck
For the problem at hand I think I would use your solution which is both easily understood and fastest. On the other hand the tapply based solutions are coordinate free (i.e. no explicit mucking with indices) and readily generalize to more than 2 groups -- just replace [^pq] with [^pqr], say. On S

Re: [R] Parsing regular expressions differently - feature request

2008-11-08 Thread Duncan Murdoch
On 08/11/2008 3:16 PM, Wacek Kusnierczyk wrote: Duncan Murdoch wrote: On 08/11/2008 11:03 AM, Gabor Grothendieck wrote: On Sat, Nov 8, 2008 at 9:41 AM, Duncan Murdoch <[EMAIL PROTECTED]> wrote: On 08/11/2008 7:20 AM, John Wiedenhoeft wrote: Hi there, I rejoiced when I realized that you can u

Re: [R] Re gular Expression help

2008-11-08 Thread Wacek Kusnierczyk
Wacek Kusnierczyk wrote: > Gabor Grothendieck wrote: > >> Here are a few more solutions. x is the input vector >> of character strings. >> >> The first is a slightly shorter version of one of Wacek's. >> The next three all create an anonymous grouping variable >> (using sub, substr/gsub and str

Re: [R] Re gular Expression help

2008-11-08 Thread Wacek Kusnierczyk
Gabor Grothendieck wrote: > Here are a few more solutions. x is the input vector > of character strings. > > The first is a slightly shorter version of one of Wacek's. > The next three all create an anonymous grouping variable > (using sub, substr/gsub and strapply respectively) > whose components

Re: [R] AIC value in lmer

2008-11-08 Thread Douglas Bates
On Fri, Nov 7, 2008 at 11:03 AM, <[EMAIL PROTECTED]> wrote: > Dear R Users, > May be this message should be directy send to Douglas Bates ... > I just want to know if I can use the AIC value given in the output of an lmer > model to classify my logistic models. > I heard that the AIC value given

Re: [R] Fitting a modified logistic with glm?

2008-11-08 Thread Mike Lawrence
On Sat, Nov 8, 2008 at 3:59 PM, Rubén Roa-Ureta <[EMAIL PROTECTED]> wrote: > ... > The fit is for grouped data. > ... As illustrated in my example code, I'm not dealing with data that can be grouped (x is a continuous random variable). -- Mike Lawrence Graduate Student Department of Psychology

Re: [R] Plotting Standard Regression Fit-Am I wrong or a bug?

2008-11-08 Thread Peter Dalgaard
uep wrote: I'm trying to plot a time series (quarterly observations, seasonal effect, T=56),regression line and predicted point on the same plot. I'm using following commands: plot(qdts,xlim=c(1982,1997)) lines(fitted(m2)~time,data=qd,col="red") points(predict(m2,newdata=nqd),col="blue") Umm,

Re: [R] Plotting Standard Regression Fit-Am I wrong or a bug?

2008-11-08 Thread uep
uep wrote: > > I'm trying to plot a time series (quarterly observations, seasonal effect, > T=56),regression line and predicted point on the same plot. > I'm using following commands: >> plot(qdts,xlim=c(1982,1997)) >> lines(fitted(m2)~time,data=qd,col="red") >> points(predict(m2,newdata=nqd),c

Re: [R] Parsing regular expressions differently - feature request

2008-11-08 Thread Wacek Kusnierczyk
Duncan Murdoch wrote: > On 08/11/2008 11:03 AM, Gabor Grothendieck wrote: >> On Sat, Nov 8, 2008 at 9:41 AM, Duncan Murdoch <[EMAIL PROTECTED]> >> wrote: >>> On 08/11/2008 7:20 AM, John Wiedenhoeft wrote: Hi there, I rejoiced when I realized that you can use Perl regex from within R.

Re: [R] Plotting Standard Regression Fit-Am I wrong or a bug?

2008-11-08 Thread Daniel Malter
Please provide a self-contained example (small simulated dataset or the original data [if it is or reasonable size] such that it can be copy-pasted in R). We cannot tell what is going wrong when we can't follow what is going on. Generally, that you don't get any error message indicates that the li

Re: [R] Fitting a modified logistic with glm?

2008-11-08 Thread Rubén Roa-Ureta
Mike Lawrence wrote: Hi all, Where f(x) is a logistic function, I have data that follow: g(x) = f(x)*.5 + .5 How would you suggest I modify the standard glm(..., family='binomial') function to fit this? Here's an example of a clearly ill-advised attempt to simply use the standard glm(..., famil

Re: [R] Parsing regular expressions differently - feature request

2008-11-08 Thread Gabor Grothendieck
On Sat, Nov 8, 2008 at 2:05 PM, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > On 08/11/2008 11:03 AM, Gabor Grothendieck wrote: >> >> On Sat, Nov 8, 2008 at 9:41 AM, Duncan Murdoch <[EMAIL PROTECTED]> >> wrote: >>> >>> On 08/11/2008 7:20 AM, John Wiedenhoeft wrote: Hi there, I rej

[R] Fitting a modified logistic with glm?

2008-11-08 Thread Mike Lawrence
Hi all, Where f(x) is a logistic function, I have data that follow: g(x) = f(x)*.5 + .5 How would you suggest I modify the standard glm(..., family='binomial') function to fit this? Here's an example of a clearly ill-advised attempt to simply use the standard glm(..., family='binomial') approach:

[R] Plotting Standard Regression Fit-Am I wrong or a bug?

2008-11-08 Thread uep
I'm trying to plot a time series (quarterly observations, seasonal effect, T=56),regression line and predicted point on the same plot. I'm using following commands: > plot(qdts,xlim=c(1982,1997)) > lines(fitted(m2)~time,data=qd,col="red") > points(predict(m2,newdata=nqd),col="blue") where: qdts<-

Re: [R] Parsing regular expressions differently - feature request

2008-11-08 Thread Duncan Murdoch
On 08/11/2008 11:03 AM, Gabor Grothendieck wrote: On Sat, Nov 8, 2008 at 9:41 AM, Duncan Murdoch <[EMAIL PROTECTED]> wrote: On 08/11/2008 7:20 AM, John Wiedenhoeft wrote: Hi there, I rejoiced when I realized that you can use Perl regex from within R. However, as the FAQ states "Some functions,

Re: [R] lines, ecdf and colors

2008-11-08 Thread jim holtman
Try: plot(ecdf(x)) lines(ecdf(y), col.hor='blue') see ?plot.stepfun On Sat, Nov 8, 2008 at 1:39 PM, eric lee <[EMAIL PROTECTED]> wrote: > Hi. I'm trying to plot two ecdf's on the same graph using two > different colors. I can plot using the same color, but it doesn't > work when I change color

Re: [R] lines, ecdf and colors

2008-11-08 Thread Thomas Petzoldt
eric lee wrote: Hi. I'm trying to plot two ecdf's on the same graph using two different colors. I can plot using the same color, but it doesn't work when I change colors? Any suggestions? Thanks in advance for your help. x <- c(0.80, 0.83, 1.89, 1.04, 1.45, 1.38, 1.91, 1.64, 0.73, 1.46) y <-

[R] lines, ecdf and colors

2008-11-08 Thread eric lee
Hi. I'm trying to plot two ecdf's on the same graph using two different colors. I can plot using the same color, but it doesn't work when I change colors? Any suggestions? Thanks in advance for your help. x <- c(0.80, 0.83, 1.89, 1.04, 1.45, 1.38, 1.91, 1.64, 0.73, 1.46) y <- c(1.15, 0.88, 0.9

[R] GAMs and isotropic bivariate functions with mgcv

2008-11-08 Thread L Dalla
Hi there, I was wondering if by the way the isotropic bivariate function works in the mgcv package, one can use highly correlated coordinates (given the shape of the study area) without worrying about the potential problems of correlation between explanatory variables, i.e., does s(LON, LAT) de

[R] Wireframe - labels on z-axis overlap with tick marks

2008-11-08 Thread Andrzej Szymanski
Hello, I'm trying to get the z-axis labels in the right place - they overlap with the tick marks and axis. How can I move them them to the left? wireframe(volcano,zlab="",scales = list(arrows=F,z=list(labels=c(1:100)/1000))) Thanks, Andrzej -- Andrzej Szymański, M.Sc. tel. +48 12 6174035

Re: [R] Updating from an Old to a New version of R

2008-11-08 Thread Uwe Ligges
dt Excellent wrote: Hi to everybody is there any way to update from an older version of R to a newer one without having to reload all the packages I've used up to that time?Many regards to all of you If you install contributed packages into a separate library tree, you can simply run up

Re: [R] Faster way to combine data sets with different date ranges

2008-11-08 Thread John Kane
Just expand the weekly data set to have an entry for each day and cbind SurveyData with the new Modified.sat.data. I was having a similar problem but with dates and here was a solution suggested by Gustaf Rydevik using rep() with the each option. =

Re: [R] determining plot location in lattice

2008-11-08 Thread Sundar Dorai-Raj
Hi, Greg, Thanks again for your reply. I looked at TkIdentify which lead me to "plt", which with RSiteSearch("grid plt") lead me to gridBase::gridPLT. Here's my solution: stopifnot(require(tkrplot), require(lattice), require(gridBase)) makePlot <- function() { print(xyp

Re: [R] grouping data together

2008-11-08 Thread John Kane
A very simple but long way to do this would be to subset your data set. There are better ways but this way would be easy to understand. January <- subset(mydata, Month=="January") Repeat for each month. --- On Fri, 11/7/08, Swanton0822 <[EMAIL PROTECTED]> wrote: > From: Swanton0822 <[EMAIL PR

Re: [R] Parsing regular expressions differently - feature request

2008-11-08 Thread Gabor Grothendieck
On Sat, Nov 8, 2008 at 9:41 AM, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > On 08/11/2008 7:20 AM, John Wiedenhoeft wrote: >> >> Hi there, >> >> I rejoiced when I realized that you can use Perl regex from within R. >> However, as the FAQ states "Some functions, particularly those involving >> regul

Re: [R] Clustering and functions

2008-11-08 Thread Sarah Goslee
It would help a lot if you told us what the error message was, and provided some data to work with. As it is, we can't even run the function to find out what goes wrong. And also, OS, version of R - all that stuff that the posting guide requests. Sarah On Sat, Nov 8, 2008 at 10:31 AM, Bryan Rich

[R] Updating from an Old to a New version of R

2008-11-08 Thread dt Excellent
Hi to everybody is there any way to update from an older version of R to a newer one without having to reload all the packages I've used up to that time?Many regards to all of you ___ ΧρησιμοποιείÏ[[elided Yahoo

Re: [R] Unexpected behavior of clocktime related to daylight savings time

2008-11-08 Thread Dennis Fisher
Professor Ripley, My apologies for not clarifying the timezone - I am in California (PDT -> PST). I did review various help pages and I am still unclear on the explanation. I replicated your code: > as.POSIXct("2008-11-02 01:17:00") [1] "2008-11-02 01:17:00 PST" > as.POSIXct("2008-11-02

[R] Clustering and functions

2008-11-08 Thread Bryan Richardson
I am new to R and have written a function that clusters on subsets of a big data data set with 60,000 points. I am not sure why, but I keep getting a run-time error. Any suggestions would be greatly appreciated. Here is the code: library(cba) d<-read.csv("data.csv", header=TRUE) v<-c(53,54,

Re: [R] plot.hclust with lots of objects

2008-11-08 Thread Martin Maechler
> "TP" == Thomas Petzoldt <[EMAIL PROTECTED]> > on Sat, 08 Nov 2008 11:11:30 +0100 writes: TP> Hi Paul, one possibility: write the tree to a wide pdf TP> file and then zoom and scroll using Adobe Acrobat or TP> another PDF reader. Here is a tree with 1000 objects: TP>

Re: [R] Parsing regular expressions differently - feature request

2008-11-08 Thread Duncan Murdoch
On 08/11/2008 7:20 AM, John Wiedenhoeft wrote: Hi there, I rejoiced when I realized that you can use Perl regex from within R. However, as the FAQ states "Some functions, particularly those involving regular expression matching, themselves use metacharacters, which may need to be escaped by t

Re: [R] Parsing regular expressions differently - feature request

2008-11-08 Thread Gabor Grothendieck
Some feature to simplify entry of backslashes has been mentioned many times and keeps coming up from time to time. It would not only be useful for regexp's but also for latex and Windows path names and I too hope that it will be addressed. On Sat, Nov 8, 2008 at 7:20 AM, John Wiedenhoeft <[EMAIL P

Re: [R] Help With Graphs

2008-11-08 Thread Gábor Csárdi
Moreover, use 'symbols' to draw the circle, it is a better and simpler solution. Gabor On Fri, Nov 7, 2008 at 9:02 PM, Sarah Goslee <[EMAIL PROTECTED]> wrote: > ?text > > On Fri, Nov 7, 2008 at 12:42 PM, Alex99 <[EMAIL PROTECTED]> wrote: >> >> Hi guys, >> >> I am truing to draw a circle and choos

[R] Parsing regular expressions differently - feature request

2008-11-08 Thread John Wiedenhoeft
Hi there, I rejoiced when I realized that you can use Perl regex from within R. However, as the FAQ states "Some functions, particularly those involving regular expression matching, themselves use metacharacters, which may need to be escaped by the backslash mechanism. In those cases you may ne

Re: [R] ggplot2: how to combine position=stack and position=dodge in a single graph?

2008-11-08 Thread Elena Schulz
Hi Hadley, thanks for your hints and sorry for my late answer. I will check them and see whether they will help in my case. Unfortunately I found some nasty data import problems that I have to solve before I can continue with the graphics. (encoding problems) For me the reason for combining d

Re: [R] grouping data together

2008-11-08 Thread Swanton0822
. http://www.nabble.com/file/p20392420/kew.dat kew.dat Hi, i did something wrong, with the data attach all i want is 12 groups for the months like this:(group 1=group Jan,..group12= group Dec) group 1 group 2 group 3.. group 12 and inside each group is the vaule of t

Re: [R] [rkward-devel] questions on RKWard

2008-11-08 Thread stfs
Hi Horace I suppose by 'image' you mean the workspace ? If that's the case it always has to run in a workspace thus creating one in memory if you don't choose one yourself. You may want to go into 'Settings > RKWard Settings > General' and change 'Startup Actions'. If, on the other hand, you a

Re: [R] missing value where TRUE/FALSE needed

2008-11-08 Thread Ray Brownrigg
To answer the actual question, your i and j indices are not what you expect (but are what you specify). Consider the following, which follows your algorithm: > vector1 <- sample(1:100,2) > vector2 <- sample(1:100,2) > for (i in vector1) { + for (j in vector2) { + show(c(i, j)) + } + } [

Re: [R] Agent-based social simulation and R

2008-11-08 Thread Tom Backer Johnsen
Thomas Petzoldt wrote: Hi Tom, you may have a look at the CRAN package simecol, that has some examples how to implement different types of dynamic models in R (differential equations, grid models, individual based models). Individual-based models (IBMs) are a model family used in ecology, wh

Re: [R] Agent-based social simulation and R

2008-11-08 Thread Tom Backer Johnsen
Thomas Petzoldt wrote: Hi Tom, you may have a look at the CRAN package simecol, that has some examples how to implement different types of dynamic models in R (differential equations, grid models, individual based models). Individual-based models (IBMs) are a model family used in ecology, wh

Re: [R] Data Manipulation, add frequency index

2008-11-08 Thread Gabor Grothendieck
See ?ave and ?seq_along DF <- data.frame(Name = c("Mary", "Mary", "Mary", "Sam", "Sam", "John", "John", "John", "John"), stringsAsFactors = FALSE) DF$index <- ave(1:nrow(DF), DF$Name, FUN = seq_along) On Sat, Nov 8, 2008 at 5:43 AM, jie feng <[EMAIL PROTECTED]> wrote: > Hi, there, > > I have

Re: [R] Data Manipulation, add frequency index

2008-11-08 Thread Dimitris Rizopoulos
one way is with ave(), e.g., dat <- data.frame(name = rep(c("Mary", "Sam", "John"), c(3,2,4))) dat$freq <- ave(seq_along(dat$name), dat$name, FUN = seq_along) dat I hope it helps. Best, Dimitris jie feng wrote: Hi, there, I have a simple data manipulation question for you. Thank you for yo

[R] Data Manipulation, add frequency index

2008-11-08 Thread jie feng
Hi, there, I have a simple data manipulation question for you. Thank you for your help! Suppose that I have this data about people appearing in a class Mary Mary Mary Sam Sam John John John John Then I want to find out what exact time(s) the student appears at the moment such as Mary 1 Mary

Re: [R] plot.hclust with lots of objects

2008-11-08 Thread Thomas Petzoldt
Hi Paul, one possibility: write the tree to a wide pdf file and then zoom and scroll using Adobe Acrobat or another PDF reader. Here is a tree with 1000 objects: x <- matrix(rnorm(3000), nrow=1000) hc <- hclust(dist(x)) pdf("tree.pdf", width=150) plot(hc) dev.off() Thomas P. paul murima w

Re: [R] Agent-based social simulation and R

2008-11-08 Thread Thomas Petzoldt
Hi Tom, you may have a look at the CRAN package simecol, that has some examples how to implement different types of dynamic models in R (differential equations, grid models, individual based models). Individual-based models (IBMs) are a model family used in ecology, which are in its essence almo

Re: [R] Umlaut read from csv-file

2008-11-08 Thread Heinz Tuechler
At 08:01 08.11.2008, Prof Brian Ripley wrote: We have no idea what you understood (you didn't tell us), but the help says encoding: character vector. The encoding(s) to be assumed when 'file' is a character string: see 'file'. A possible value is '"unknown"': see the ‘Det