Re: [R] how to label multiple plots

2007-11-24 Thread Jim Lemon
G Ilhamto wrote: > Dear R-list, > > I want to combine several plots in one graph. > I did this: plot(a1); plot(a2, add=TRUE); ...plot(a5, add=TRUE) > The problem is the more plot we put, the more complex the graph. > Is there any way to label each line; or other way just to make sure I know > whic

Re: [R] Customizing x-axis with stripchart

2007-11-24 Thread Max Kuhn
On Nov 24, 2007 7:14 PM, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > On Nov 24, 2007 7:01 PM, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > > On 24/11/2007 6:22 PM, Paul Smith wrote: > > > On Nov 24, 2007 11:14 PM, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > > With plot, one can use to the o

Re: [R] Customizing x-axis with stripchart

2007-11-24 Thread Gabor Grothendieck
On Nov 24, 2007 11:29 PM, Max Kuhn <[EMAIL PROTECTED]> wrote: > > On Nov 24, 2007 7:14 PM, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > > On Nov 24, 2007 7:01 PM, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > > > On 24/11/2007 6:22 PM, Paul Smith wrote: > > > > On Nov 24, 2007 11:14 PM, Duncan Mur

Re: [R] Customizing x-axis with stripchart

2007-11-24 Thread Gabor Grothendieck
On Nov 24, 2007 10:37 PM, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > > On 24/11/2007 9:07 PM, Gabor Grothendieck wrote: > > On Nov 24, 2007 8:56 PM, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > But it really isn't that hard to do: just type fix(stripchart), and it > will be pretty clear

Re: [R] R 2.6 and library(survival)

2007-11-24 Thread Ben Bolker
makis motakis-2 wrote: > > Hi all, > > I have installed in R 2.6 the survival package and I am trying to analyze > some > data and present plots. The problem occurs when I try to plot lines on > the same plot. E.g. take simulated data for time (t), event (e) and groups > (group1 and group2)

Re: [R] Customizing x-axis with stripchart

2007-11-24 Thread Duncan Murdoch
On 24/11/2007 9:07 PM, Gabor Grothendieck wrote: > On Nov 24, 2007 8:56 PM, Duncan Murdoch <[EMAIL PROTECTED]> wrote: But it really isn't that hard to do: just type fix(stripchart), and it will be pretty clear what to delete (the calls to box(), axis(), and Axis()). >>> or download

Re: [R] question regarding an error message from survey package

2007-11-24 Thread James Reilly
Your calibration model has one linear predictor, so it only has two parameters, but you have specified three population totals. A slightly different setup should work; try again with: st <- factor(1:3, levels=c(3, 1:2)) pop<-c('(Intercept)'=100, st1=10, st2=20) James Reilly Department of Statis

Re: [R] Customizing x-axis with stripchart

2007-11-24 Thread Gabor Grothendieck
On Nov 24, 2007 8:56 PM, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > >> But it really isn't that hard to do: just type fix(stripchart), and it > >> will be pretty clear what to delete (the calls to box(), axis(), and > >> Axis()). > > > > or download it from: > > > > https://svn.r-project.org/R/tr

Re: [R] Customizing x-axis with stripchart

2007-11-24 Thread Duncan Murdoch
On 24/11/2007 7:14 PM, Gabor Grothendieck wrote: > On Nov 24, 2007 7:01 PM, Duncan Murdoch <[EMAIL PROTECTED]> wrote: >> On 24/11/2007 6:22 PM, Paul Smith wrote: >>> On Nov 24, 2007 11:14 PM, Duncan Murdoch <[EMAIL PROTECTED]> wrote: >> With plot, one can use to the option 'axes=F' to remove ax

Re: [R] Customizing x-axis with stripchart

2007-11-24 Thread Gabor Grothendieck
On Nov 24, 2007 7:01 PM, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > On 24/11/2007 6:22 PM, Paul Smith wrote: > > On Nov 24, 2007 11:14 PM, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > With plot, one can use to the option 'axes=F' to remove axes. I have > tried it with stripchart, but no s

Re: [R] Customizing x-axis with stripchart

2007-11-24 Thread Duncan Murdoch
On 24/11/2007 6:22 PM, Paul Smith wrote: > On Nov 24, 2007 11:14 PM, Duncan Murdoch <[EMAIL PROTECTED]> wrote: With plot, one can use to the option 'axes=F' to remove axes. I have tried it with stripchart, but no success. How can one then customize the x-axis with stripchart? >>> str

Re: [R] 'Split' character

2007-11-24 Thread jim holtman
Here is one way: > a<-1:10 > b<-21:30 > mydata<-data.frame(a,b) > mydata.split<-split(mydata,(mydata[,1:2]),drop=TRUE) > x <- mydata.split > # customize the names > names(x) <- sapply(strsplit(names(x), "\\."), paste, collapse="-my > character-") > x $`1-my character-21` a b 1 1 21 $`2-my cha

Re: [R] 'Split' chracter

2007-11-24 Thread Henrique Dallazuanna
In split function I don't know, but you can do: names(mydata.split) <- gsub("\\.", "-", names(mydata.split)) -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O On 24/11/2007, Sébastien <[EMAIL PROTECTED]> wrote: > Dear R-users, > > The following code splits a very simpl

Re: [R] Customizing x-axis with stripchart

2007-11-24 Thread Paul Smith
On Nov 24, 2007 11:14 PM, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > >> With plot, one can use to the option 'axes=F' to remove axes. I have > >> tried it with stripchart, but no success. How can one then customize > >> the x-axis with stripchart? > > > > stripchart() doesn't give you that option.

[R] 'Split' character

2007-11-24 Thread pomchip
Dear R-users, The following code splits a very simple dataframe into a list, each element of the list being one line of the dataframe. You will see that the split function names each element of the list by using uses the content of a and b and merging them with a "." character. Is there a way to

[R] 'Split' chracter

2007-11-24 Thread Sébastien
Dear R-users, The following code splits a very simple dataframe into a list, each element of the list being one line of the dataframe. You will see that the split function names each element of the list by using uses the content of a and b and merging them with a "." character. Is there a way

Re: [R] Customizing x-axis with stripchart

2007-11-24 Thread Duncan Murdoch
On 24/11/2007 5:49 PM, Duncan Murdoch wrote: > On 24/11/2007 5:42 PM, Paul Smith wrote: >> Dear All, >> >> With plot, one can use to the option 'axes=F' to remove axes. I have >> tried it with stripchart, but no success. How can one then customize >> the x-axis with stripchart? > > stripchart() do

Re: [R] PCA with NA

2007-11-24 Thread Hartmut Oldenbürger
Hi Birgit, and All Possibly you should not consider the case completed ;-) There is an important alternative to imputing means, or estimates from first or second order regression (Frane, Psychometrica, BMDP): partial-least-squares (Wold), which uses as much information from the data as possible t

Re: [R] how to compute highest density interval?

2007-11-24 Thread Ben Bolker
Duncan Murdoch-2 wrote: > > On 24/11/2007 7:43 AM, gallon li wrote: >> Suppose i want to compute a 95% highest density for a beta distribution >> beta(a,b) >> >> the two end points x1 and x2 shoudl satisfy the following two equations: >> >> pbeta(x1,a,b)-pbeta(x2,a,b)=95% >> >> dbeta(x1,a,b)

Re: [R] Customizing x-axis with stripchart

2007-11-24 Thread Duncan Murdoch
On 24/11/2007 5:42 PM, Paul Smith wrote: > Dear All, > > With plot, one can use to the option 'axes=F' to remove axes. I have > tried it with stripchart, but no success. How can one then customize > the x-axis with stripchart? stripchart() doesn't give you that option. You could edit the source

[R] Customizing x-axis with stripchart

2007-11-24 Thread Paul Smith
Dear All, With plot, one can use to the option 'axes=F' to remove axes. I have tried it with stripchart, but no success. How can one then customize the x-axis with stripchart? Thanks in advance, Paul __ R-help@r-project.org mailing list https://stat.e

Re: [R] Dot plots in R

2007-11-24 Thread Richard M. Heiberger
Yes, with the HH package. require(HH) dotplot(sample(0:9, 50, replace=TRUE), panel=panel.dotplot.tb) dotplot(rep(1:5,10) ~ sample(0:9, 50, replace=TRUE), panel=panel.dotplot.tb) dotplot(rep(1:5,10) ~ sample(0:9, 50, replace=TRUE) | rep(c(1,1,1,2,2),10), panel=panel.dotplot.tb) dotplot(~ sample(0:9

[R] R2winBUGS | option to turn off GUI?

2007-11-24 Thread Evan Cooch
Greetings - I run a multi-pro server box (GNU/Linux), on which I've installed winBUGS under wine. Works fine, and plays nice with r2WinBUGS, provided everything is done through a graphical front-end (either by working from console, or using a virtual desktop via VNC or equivalent). However, I'

Re: [R] Dot plots in R

2007-11-24 Thread Paul Smith
On Nov 24, 2007 10:11 PM, A. Beaujean <[EMAIL PROTECTED]> wrote: > ?stripchart shows the at command > e.g., > stripchart(data, method="stack", pch=16, at=0) That is perfect! Thanks. Paul __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

Re: [R] Dot plots in R

2007-11-24 Thread A. Beaujean
?stripchart shows the at command e.g., stripchart(data, method="stack", pch=16, at=0) On Nov 24, 2007 4:02 PM, Paul Smith <[EMAIL PROTECTED]> wrote: > On Nov 24, 2007 9:57 PM, jim holtman <[EMAIL PROTECTED]> wrote: > > Does this give you want you want? > > > > x <- sample(1:10) > > plot(rep(1:10,

Re: [R] Dot plots in R

2007-11-24 Thread jim holtman
You can play around with 'ylim' and 'cex'. On Nov 24, 2007 5:02 PM, Paul Smith <[EMAIL PROTECTED]> wrote: > On Nov 24, 2007 9:57 PM, jim holtman <[EMAIL PROTECTED]> wrote: > > Does this give you want you want? > > > > x <- sample(1:10) > > plot(rep(1:10, x), unlist(sapply(x, seq)), pch=19, cex=3,

Re: [R] Dot plots in R

2007-11-24 Thread Paul Smith
On Nov 24, 2007 9:57 PM, jim holtman <[EMAIL PROTECTED]> wrote: > Does this give you want you want? > > x <- sample(1:10) > plot(rep(1:10, x), unlist(sapply(x, seq)), pch=19, cex=3, yaxt='n') > > > > On Nov 24, 2007 4:26 PM, Paul Smith <[EMAIL PROTECTED]> wrote: > > Dear All, > > > > Can R produce

Re: [R] Dot plots in R

2007-11-24 Thread jim holtman
Does this give you want you want? x <- sample(1:10) plot(rep(1:10, x), unlist(sapply(x, seq)), pch=19, cex=3, yaxt='n') On Nov 24, 2007 4:26 PM, Paul Smith <[EMAIL PROTECTED]> wrote: > Dear All, > > Can R produce dot plots like the one of the following picture: > > http://en.wikipedia.org/wiki/I

Re: [R] Dot plots in R

2007-11-24 Thread A. Beaujean
stripchart would probably work, e.g., data<-matrix(c(rep(1,4),rep(2,4),rep(3,10),rep(4,8),rep(5,11)), ncol=1) stripchart(data, method="stack", pch=16) On Nov 24, 2007 3:26 PM, Paul Smith <[EMAIL PROTECTED]> wrote: > Dear All, > > Can R produce dot plots like the one of the following picture: > >

Re: [R] Dot plots in R

2007-11-24 Thread Deepayan Sarkar
On 11/24/07, Paul Smith <[EMAIL PROTECTED]> wrote: > Dear All, > > Can R produce dot plots like the one of the following picture: > > http://en.wikipedia.org/wiki/Image:Dotplot_of_random_values.png > > ? > > I have tried dotchart, but no success. Try ?stripchart -Deepayan ___

Re: [R] AIC and model selection; not a R question

2007-11-24 Thread Ben Bolker
Lynnette Dagenais wrote: > > Hi, > > I was wondering if someone could help me answer a question that is bound > to come up in my Master's defense. I'm using AIC to select models and my > question is how do I know that the models I developed a priori contain the > 'best' models in the system.

Re: [R] AIC and model selection; not a R question

2007-11-24 Thread Charles C. Berry
On Sat, 24 Nov 2007, Lynnette Dagenais wrote: > Hi, > > I was wondering if someone could help me answer a question that is bound > to come up in my Master's defense. Lynnette, I expect you will get some opinions here, but you might get a better answer from your committee. Have you already ask

[R] Dot plots in R

2007-11-24 Thread Paul Smith
Dear All, Can R produce dot plots like the one of the following picture: http://en.wikipedia.org/wiki/Image:Dotplot_of_random_values.png ? I have tried dotchart, but no success. Thanks in advance, Paul __ R-help@r-project.org mailing list https://s

Re: [R] Packages - a great resource, but hard to find the right one

2007-11-24 Thread Thaden, John J
John Sorkin [mailto:[EMAIL PROTECTED] wrote... > As far as finding packages goes, I believe > that R would be a better tool if a package > finder were built into the R distribution > and added to the menus presented by the R > GUI. The package finder would allow the user > to enter search word

Re: [R] anova planned comparisons/contrasts

2007-11-24 Thread Tyler Smith
On 2007-11-22, Dieter Menne <[EMAIL PROTECTED]> wrote: > Tyler Smith mail.mcgill.ca> writes: > >> I'm trying to figure out how anova works in R by translating the >> examples in Sokal And Rohlf's (1995 3rd edition) Biometry. I've hit a >> snag with planned comparisons, their box 9.4 and section 9.

[R] AIC and model selection; not a R question

2007-11-24 Thread Lynnette Dagenais
Hi, I was wondering if someone could help me answer a question that is bound to come up in my Master's defense. I'm using AIC to select models and my question is how do I know that the models I developed a priori contain the 'best' models in the system. How do I not know that some models which

Re: [R] help in plotting

2007-11-24 Thread David Winsemius
David Winsemius <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > This is a worked example taken from Seefeld and Kim's monograph: > Sorry, boloxed the authors. By Kim Seefeld and Ernst Linder. -- David Winsemius __

Re: [R] help in plotting

2007-11-24 Thread David Winsemius
"G Ilhamto" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > I want to combine several plots in one graph. > I did this: plot(a1); plot(a2, add=TRUE); ...plot(a5, add=TRUE) > The problem is the more plot we put, the more complex the graph. > Is there any way to label each line; or other way

Re: [R] grDevices

2007-11-24 Thread David Winsemius
"amna khan" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > I am using R 2.6.0. In R console grDevices are not giving results like > "png", "postcript", xlim, etc. I think they are not activated? Its not clear to me what you have tried, or what you are trying to do. xlim is a paramet

Re: [R] ragged array with append

2007-11-24 Thread Peter Dalgaard
Alexy Khrabrov wrote: > On Nov 24, 2007, at 2:07 PM, Chuck Cleland wrote: > > >> with(d, split(word, kind)) >> >> # OR >> >> with(d, split(as.character(word), kind)) >> > > Awesome! Scoping: how do I get the result back to the top level? > > > with(d, wk <- split(word,kind)) > > wk > Err

Re: [R] complex conjugates roots from polyroot?

2007-11-24 Thread Ravi Varadhan
Hi Spencer, Here is a simple approach to detect conjugate pairs: is.conj <- function(z1, z2, tol=1.e-10) { # determine if two complex numbers are conjugates cond1 <- abs(Re(z1) - Re(z2)) < tol cond2 <- abs(Im(z1) + Im(z2)) < tol cond1 & cond2 } set.seed(123) z <- polyroot(sample(1:5, size=8, rep

Re: [R] Packages - a great resource, but hard to find the right one

2007-11-24 Thread John Sorkin
This thread has generated a number of comments. My reading of the messages is (1) There are a number of ways to find packages, no one is perfect. (2) Packages vary in quality and a review process that would help identify better packages and suggest improvements for packages would be helpful. As f

[R] question regarding an error message from survey package

2007-11-24 Thread eugen pircalabelu
Hi R-users! Can anyone tell me what this error message refers to exactly > a<-c('m','f','m') > b<-c(1:3) > st<-c(1:3) > data.frame(a,b,st) a b st 1 m 1 1 2 f 2 2 3 m 3 3 > data.frame(a,b,st)->l > p<-svydesign(ids=~1, data=l) > pop<-c('(intercept)'=100, st1=10,st2=20) > calibrate(p,~st, pop)

Re: [R] Indexing and partially replacing 99, 999 in data frames

2007-11-24 Thread jim holtman
for you last case with 'frog': sum(complete.cases(frog)) On Nov 24, 2007 11:52 AM, Mark Hempelmann <[EMAIL PROTECTED]> wrote: > > Dear WizaRds, > >unfortunately, I have been unable to replace the '99' and '999' > entries in > > library(UsingR) > attach(babies) > > as definitions for mis

[R] Indexing and partially replacing 99, 999 in data frames

2007-11-24 Thread Mark Hempelmann
Dear WizaRds, unfortunately, I have been unable to replace the '99' and '999' entries in library(UsingR) attach(babies) as definitions for missing values NA, because sometimes the 99 entry is indeed a correct value. Usually, or so I thought, NAs can easily replace a, say, 999 entry via

Re: [R] help in plotting

2007-11-24 Thread jim holtman
You can use color (col=), line type (lty=), line width (lwd=), plot character (pch=) --- take you choice. \the more plot we put, the more complex the graph. > Is there any way to label each line; or other way just to make sure I know > which one which? > > Thank you for the help, > Ilham > >

Re: [R] Fwd: how to calculate the return?

2007-11-24 Thread Patrick Burns
You don't need a loop. If 'data' is a matrix of prices: re <- diff(log(data)) creates a matrix of returns. Patrick Burns [EMAIL PROTECTED] +44 (0)20 8525 0696 http://www.burns-stat.com (home of S Poetry and "A Guide for the Unwilling S User") Denver XU wrote: >hi,scionforbai, >Thank you very

Re: [R] Packages - a great resource, but hard to find the right one

2007-11-24 Thread hadley wickham
> What do you mean here? Surely all packages authors aim to provide reliable > and effective software. If they know that they are offering something > unstable, they should say so clearly. In fact, they should wait until it is > stable. Most R users are not researchers, but users. Now I'm begi

[R] Hmisc: can not reproduce figure 4 of Statistical Tables and Plots using S and LATEX

2007-11-24 Thread John Smith
Dear R-users: I can not reproduce figure 4 of *Statistical Tables and Plots using S and LATEX* by Prof. Frank Harrell with the following code: rm(list=ls()) library(Hmisc) getHdata(pbc) attach(pbc) age.groups <- cut2(age, c(45,60)) g <- function(y) apply(y, 2, quantile, c(.25,.5,.75)) y <- with(

Re: [R] how to calculate the return?

2007-11-24 Thread Gabor Grothendieck
Are you sure its a matrix? or is it a data frame? > BOD # built into R Time demand 118.3 22 10.3 33 19.0 44 16.0 55 15.6 67 19.8 > class(BOD) [1] "data.frame" > BOD[2] demand 18.3 2 10.3 3 19.0 4 16.0 5 15.6 6 19.8 > BOD[[2]] [1] 8.3 10.3 1

[R] Fwd: how to calculate the return?

2007-11-24 Thread Denver XU
hi,scionforbai, Thank you very much. I made very stupid mistake for the number is not stock price. In fact, if the number is correct, data[i,1] is equivalent to data[i] 2007/11/24, Scionforbai <[EMAIL PROTECTED]>: > Hi Denver, > > > I want to calculate the return say AMR,so I use > > If data is

Re: [R] how to calculate the return?

2007-11-24 Thread Scionforbai
Hi Denver, > I want to calculate the return say AMR,so I use If data is a matrix or a data.frame you need to use the correct index: [row,col] instead of [row]. Try: re=numeric(10) for (i in 2:nrow(data)) { re[1]=0 re[i]=log(data[i,1]/data[i-1,1]) } This works, but of course you have

[R] how to calculate the return?

2007-11-24 Thread Denver XU
Hi, R-users, data is a matrix like this AMR BS GE HR MO UK SP500 1974 -0.3505 -0.1154 -0.4246 -0.2107 -0.0758 0.2331 -0.2647 1975 0.7083 0.2472 0.3719 0.2227 0.0213 0.3569 0.3720 1976 0.7329 0.3665 0.2550 0.5815 0.1276 0.0781 0.2384 1977 -0.2034

Re: [R] how to compute highest density interval?

2007-11-24 Thread Duncan Murdoch
On 24/11/2007 7:43 AM, gallon li wrote: > Suppose i want to compute a 95% highest density for a beta distribution > beta(a,b) > > the two end points x1 and x2 shoudl satisfy the following two equations: > > pbeta(x1,a,b)-pbeta(x2,a,b)=95% > > dbeta(x1,a,b)=dbeta(x2,a,b) > > Is there any fast wa

[R] scan(file, encoding=?)

2007-11-24 Thread Alexy Khrabrov
I'm trying to read a file in Windows CP1251 encoding (8-byte Cyrillics). My Mac's iconv understands it fine under that alias. Alas, I get an error, invalid multibyte string when trying to read it. When I convert it to UTF-8 with iconv and read without encoding=, all is well. However, I'

[R] [R-pkgs] Major update to package relimpo: Version 2.0

2007-11-24 Thread Ulrike Grömping
Dear userRs, Version 2.0 of package relaimpo is on CRAN (and on my homepage with an additional metric for non-US users). It contains several major improvements: - usage of factors - incorporation of interactions (for metric lmg only) - incorporation of observation weights - application to data fr

Re: [R] [:]

2007-11-24 Thread Charilaos Skiadas
Alexy, note that negative indices have a different meaning in R, namely they indicate elements to remove. v[-(1:i)] would mean all but the elements from 1 to i (make sure i is non-negative first). So if you want: All elements up to i: v[1:i] All elements from i: v[-1:(i-1)] You c

[R] how to label multiple plots

2007-11-24 Thread G Ilhamto
Dear R-list, I want to combine several plots in one graph. I did this: plot(a1); plot(a2, add=TRUE); ...plot(a5, add=TRUE) The problem is the more plot we put, the more complex the graph. Is there any way to label each line; or other way just to make sure I know which one which? Thanks, Ilham

[R] how to compute highest density interval?

2007-11-24 Thread gallon li
Suppose i want to compute a 95% highest density for a beta distribution beta(a,b) the two end points x1 and x2 shoudl satisfy the following two equations: pbeta(x1,a,b)-pbeta(x2,a,b)=95% dbeta(x1,a,b)=dbeta(x2,a,b) Is there any fast way to compute x1 and x2 in R? [[alternative HTML ver

Re: [R] Packages - a great resource, but hard to find the right one

2007-11-24 Thread Antony Unwin
On 23 Nov 2007, at 11:56 pm, hadley wickham wrote: > My argument is that package reviews are a rather strange beast, being > a review of something that is neither particularly stable What do you mean here? Surely all packages authors aim to provide reliable and effective software. If they k

Re: [R] [:]

2007-11-24 Thread Gabor Csardi
Please someone correct me if i'm wrong, but i think this is impossible with the current R language. ':' is an ordinary function (see get(":")) just like "[", so v[1:3] is actually the composition of two functions, it is the same as "["(":"(1,3)). The ":" has no idea about whether it'll be embedded

Re: [R] ragged array with append

2007-11-24 Thread Chuck Cleland
Alexy Khrabrov wrote: > On Nov 24, 2007, at 2:07 PM, Chuck Cleland wrote: > >> with(d, split(word, kind)) >> >> # OR >> >> with(d, split(as.character(word), kind)) > > Awesome! Scoping: how do I get the result back to the top level? > > > with(d, wk <- split(word,kind)) > > wk > Error: object

Re: [R] ragged array with append

2007-11-24 Thread Alexy Khrabrov
On Nov 24, 2007, at 2:07 PM, Chuck Cleland wrote: > with(d, split(word, kind)) > > # OR > > with(d, split(as.character(word), kind)) Awesome! Scoping: how do I get the result back to the top level? > with(d, wk <- split(word,kind)) > wk Error: object "wk" not found -- trying to create it at

Re: [R] ragged array with append

2007-11-24 Thread Chuck Cleland
Alexy Khrabrov wrote: > I wonder what's the right way in R to do the following -- placing > objects of the same kind together in subarrays of varying length. > Here's what I mean: > > > word <- c("a","b","c","d","e","f","g","h","i","j") > > kind <- c(1,1,1,2,3,4,5,5,7,7) > > d <- data.fram

[R] ragged array with append

2007-11-24 Thread Alexy Khrabrov
I wonder what's the right way in R to do the following -- placing objects of the same kind together in subarrays of varying length. Here's what I mean: > word <- c("a","b","c","d","e","f","g","h","i","j") > kind <- c(1,1,1,2,3,4,5,5,7,7) > d <- data.frame(word,kind) > d word kind 1

Re: [R] looking for function like rollmean()

2007-11-24 Thread Chuck Cleland
Jonas Stein wrote: > Hi, > > i have some data, that has 1-5 % noise. > I want to smooth this data without loosing rows. > > rollmean() would be great, but it returns a vector of different size as the > initial vector. You might consider one of the smoothers in smooth() from the stats package.

Re: [R] [:]

2007-11-24 Thread Chuck Cleland
Alexy Khrabrov wrote: > What are idioms for taking a head or a tail of a vector, either up to > an index, or from an index to the end? Also -- is it necessary to > use length(v) to refer to the last element? E.g., Python has > > v[:3] # indices 0,1,2 > v[3:] # indices 3,4,... > v[-1] # the la

[R] [:]

2007-11-24 Thread Alexy Khrabrov
What are idioms for taking a head or a tail of a vector, either up to an index, or from an index to the end? Also -- is it necessary to use length(v) to refer to the last element? E.g., Python has v[:3] # indices 0,1,2 v[3:] # indices 3,4,... v[-1] # the last element of v v[:-1] # all but las

[R] Help on State-space modeling

2007-11-24 Thread Bernardo Ribeiro
Hi all, I'm working on a term structure estimation using state-space modeling for 1, 2 and 3 factor models. When I started to read the functions on R, I got to the function ss on the library sspir. From what I understood this function is similar to SsfFit from S-PLUS. But for my models purpos

Re: [R] rbinom with computed probability

2007-11-24 Thread Berwin A Turlach
G'day Sigalit, On Fri, 23 Nov 2007 11:25:30 +0200 "sigalit mangut-leiba" <[EMAIL PROTECTED]> wrote: > Hello, > I have a loop with probability computed from a logistic model like > this: for (i in 1:300){ > > p[i]<-exp(-0.834+0.002*x[i]+0.023*z[i])/(1+exp(-0.834+0.002*x[i]+0.023 > +z[i])) > > x

[R] truncated fields with RODBC

2007-11-24 Thread Mikkel Grum
I'm changing some functions from storing data in SQLite (using RSQLite) to storing it in PostgreSQL (using RODBC). When trying to store very long character fields I get the following message: >sqlSave(pg, Grids, rownames = FALSE, append = TRUE) Warning messages: 1: In odbcUpdate(channel, query