Re: [R] Bad EMF export

2007-10-16 Thread Poirier Clement
Quoting Prof Brian Ripley <[EMAIL PROTECTED]>: > I think you mean savePlot: I have never heard of saveCopy. yes sorry for the mistake it is savePlot function() > We have seen this before, and the problem was the EMF viewer, not the > EMF file. So how is this being viewed? Ok ! I modify the emf

[R] Canberra distance

2007-10-16 Thread Frédéric Chiroleu
Hi, I misunderstand the definition of Canberra distance in R. On Internet and in function description pages of dist() from stats and Dist() from amap, Canberra distance between vectors x and y, d(x,y), is : d(x,y) = sum(abs(x-y)/(x+y)) But in use, through simple examples, we find that the form

Re: [R] Data manipulation

2007-10-16 Thread Klaus Friis Østergaard
2007/10/15, Petr PIKAL <[EMAIL PROTECTED]>: > > Hi > > > Well, let us put it another way. Do you want for each unique combination > of Hole and Feature to subtract a value from one data frame, let us call > it nom from another data frame, let us call it raw? If yes I assume you > have exactly same

Re: [R] Create *png or *.jpeg plot under Linux

2007-10-16 Thread Prof Brian Ripley
On Mon, 15 Oct 2007, Bio7 wrote: > > I have an example where i plot an image and load it dynamically in an image > analysis tool to create > a film (dynamic graph). This works well under Windows but i can't plot to > *.png or *.jpeg files > under Linux (Ubuntu) with the same command. And why not?

Re: [R] Problems with F77_CALL and Visual C++

2007-10-16 Thread Prof Brian Ripley
On Tue, 16 Oct 2007, dario nappa wrote: > I am working on a DLL and I use Visual C++. > > > In the Visual c++ code I use F77_CALL(dcopy)(.); > > Visual C++ gives the error 'daxpy_' identifier not found. > > > Do you know hot to solve this problem? Link against the BLAS library, as described

[R] Updating R-Software without complete new installation

2007-10-16 Thread Schmitt, Corinna
Hallo, as I see there is a new version for R available. Can anyone tell me how I can update my version 2.5.0 under Windows? The last times I just uninstalled the old version and installed the new one. Afterwards I had to install also all needed packages again. All in all it cost me half a day unti

Re: [R] Updating R-Software without complete new installation

2007-10-16 Thread Uwe Ligges
Please read the R for Windows FAQs, particularly "What's the best way to upgrade?" Uwe Ligges Schmitt, Corinna wrote: > Hallo, > > as I see there is a new version for R available. Can anyone tell me how > I can update my version 2.5.0 under Windows? The last times I just > uninstalled the old

Re: [R] Error: X11 cannot allocate additional graphics colours.

2007-10-16 Thread michael watson (IAH-C)
Thank you for all your responses. For the font problem, all I need is someone to tell me *which* font libraries I need to install. I can seek local help from my Sys Admin, only they will just ask "Which fonts would you like to install?" and I will be back at square one. Yesterday, I installed

Re: [R] Error: X11 cannot allocate additional graphics colours.

2007-10-16 Thread michael watson (IAH-C)
For the colours problem, this solved it. For some reason, the setting I had on the server was 256 colours. Once changed to "millions of colours" I can get n up to over 200 (much better, but still not ideal) Thanks Mick -Original Message- From: Marc Schwartz [mailto:[EMAIL PROTECTED] S

[R] simulation

2007-10-16 Thread Oarabile Molaodi
I am trying to write a function that will simulate observed counts X and Y as below, I want the function to be able give many replicates, can somebody advise? thanks Oarabile #alpha,n sdx and sdy are constant, and N is a vector of length n. unstructured<-function(n,N,alpha,sdx,sdy){ Vx<-rnorm(n

Re: [R] Updating R-Software without complete new installation

2007-10-16 Thread Vladimir Eremeev
Schmitt, Corinna wrote: > > as I see there is a new version for R available. Can anyone tell me how > I can update my version 2.5.0 under Windows? The last times I just > uninstalled the old version and installed the new one. Afterwards I had > to install also all needed packages again. All in a

[R] Chronological data manipulation question

2007-10-16 Thread Julien Barnier
Hi all, I currently work on a survey which contains biographical data stored in a chronological way, ie something like : id year variable 001 2000 0 001 2001 0 001 2002 1 001 2003 0 002 1996 0 002 1997 0 002 1998 1 002 1999

Re: [R] Create *png or *.jpeg plot under Linux

2007-10-16 Thread Alberto Monteiro
Marcel wrote: > > (...) I can't plot to *.png or *.jpeg files under > Linux (Ubuntu) with (...) > > png(file,width=200,height=200) or jpeg(file,width=200,height=200) > A few reasons: (1) You run R in an account that has no priviledge to write to the directory. Check if you can write anything, f

Re: [R] Create *png or *.jpeg plot under Linux

2007-10-16 Thread Bio7
I used this plotting command with try(jpeg..) to catch errors with the Rserve application under Windows as the OS. I removed the try() construct under Linux and then it worked as it should (i never came to the idea to remove it..). Thank you for your answer With kind regards Marcel -- View th

Re: [R] Create *png or *.jpeg plot under Linux

2007-10-16 Thread Bio7
Also thank you for your answer. It was the evil try() which i tried. And you are right about whitespaces in filenames! Also with kind regards Marcel -- View this message in context: http://www.nabble.com/Create-*png-or-*.jpeg-plot-under-Linux-tf4632271.html#a13230948 Sent from the R help mai

[R] Erinnerung - Empfehlung persoenlich fuer [EMAIL PROTECTED] - Bereits der 2. Hinweis

2007-10-16 Thread [EMAIL PROTECTED]
Hallo [EMAIL PROTECTED], dieses ist nun schon unsere 2. Mail an Sie, da wir nicht moechten, dass Ihnen die für Sie reservierten 2400,00 EUR verloren gehen. Ja tatsaechlich, dieser Betrag ist für Sie als Inhaber der Email r- [EMAIL PROTECTED] reserviert Greifen sie jetzt zu und holen sie sich j

[R] [R-pkgs] New package: sets

2007-10-16 Thread David Meyer
Dear useRs, The new 'sets' package made it to CRAN, supporting: o data structures for sets, fuzzy sets, multisets, and fuzzy multisets o the use of (most) R objects as elements o standard set operations (union, intersection, complement, Cartesian product, power set, ...) o support for several fu

Re: [R] Chronological data manipulation question

2007-10-16 Thread jim holtman
I don't know if this is any faster, but it has no loop. There are improvements that can be made if speed is too slow. Try it on your data: > x <- data.frame(id=c("001","001","001","001","002","002","002","002","002"), + year=c(2000,2001,2002,2003,1996,1997,1998,1999,2000), +

Re: [R] Distance matrix in SpDep-package

2007-10-16 Thread Roger Bivand
Elke Moons uhasselt.be> writes: > > Hello everybody, > > I would like to use the SpDep-package (especially the Local Moran index > analysis and the Getis-Ord statistics) in R for analysing my data. However, > I don't have x-y coordinates, but my data is in a distance matrix format. Is > it poss

Re: [R] cumulative frequency plots for factors

2007-10-16 Thread Jim Lemon
Dieter Vanderelst wrote: > Dear list, > > I have a data frame with a number of events (factor) and the times at which > they occurred (continuous variable): > > event time > A 10 > A 12 > B 15 > A 17 > C 13 > ... > > Is it possible in R to make a plot against time of the cumulative frequency >

[R] Newey-West corrections in SUR regression models

2007-10-16 Thread Richard Saba
Is anyone aware of a procedure to apply Newey-West corrections for autocorrelation to a SUR regression model? The SANDWICH package seems to be applicable only to LM or GLM models. Thanks, Richard Saba Department of Economics Auburn University Email: [EMAIL PROTECTED]

Re: [R] Linear regression and slope from 1

2007-10-16 Thread Strong
From: daniel guertin <[EMAIL PROTECTED]> Subject: [R] Linear regression and slope from 1 Date: Mon, 15 Oct 2007 23:47:40 + library(car) ?linear.hypothesis Hope this is what you wanted. > > Dear R-Users, > > I am new to R, so please excuse the ignorance. > > I have data: > x (2.14, 2.41, 1

[R] Help with repeated measures!

2007-10-16 Thread Andreas Nord
Hello all, I'm an R novice, recently trying to implement R in my research. Using the data frame below, I want to construct a repeated measures model, with energy expenditure (kjday) as dependent of treatment (code) using mass as a covariate. ind masskjday code 79 15.845.21

[R] help with nls and Hill equation

2007-10-16 Thread Lanre Okusanya
Hello all, I am having a problem with nls. I have such data as shown below, foo<- Dosevar 0 0.00 100 -1.318178 200 -1.562425 400 -3.579960 1200 -3.788662 however, when I call nls as shown below, >foo.nls<-nls(var~Emax*(Dose^hill)/((EC50^hill)+(Dose^hill)), + start

Re: [R] survreg's algorithm

2007-10-16 Thread Terry Therneau
Gad Abraham wrote: > Hi, > > I'm using survreg() from the survival package for parametric survival > regression (modelling inter-arrival times of patients to a waiting list > as exponentially distributed, with various regressors such as queue size > and season). > > Does anyone know which algo

[R] problem with RCurl 0.8-1 installation on Debian Etch

2007-10-16 Thread Christian Kohler
Dear R-Users, I am having some trouble getting an installation of RCurl 0.8-1 to work properly on a Debian (Etch) machine. The command 'R CMD INSTALL RCurl_0.8-1.tar.gz' yields the following error: Installing *source* package 'RCurl' ... checking for curl-config... no Cannot find curl-config E

[R] R-2.6.0 - packages installation through a proxy - not working

2007-10-16 Thread Liviu Andronic
Hello everyone, I run R on Gentoo Linux and this week I upgraded R from 2.5.0 to 2.6.0. With the new build, I have stumbled upon an unpleasant problem: I can no longer install packages from CRAN through a transparent proxy. With the previous version, I simply added to /usr/lib/R/etc/Renviron the f

Re: [R] R-2.6.0 - packages installation through a proxy - not working

2007-10-16 Thread Rainer M. Krug
Liviu Andronic wrote: > Hello everyone, > > I run R on Gentoo Linux and this week I upgraded R from 2.5.0 to > 2.6.0. With the new build, I have stumbled upon an unpleasant problem: > I can no longer install packages from CRAN through a transparent > proxy. With the previous version, I simply adde

Re: [R] help with nls and Hill equation

2007-10-16 Thread Christian Ritz
Hi! I would suggest trying out a few different starting values as a first unsystematic approach. For example changing hill=1 to hill=2 results in convergence: foo.nls<-nls(var~Emax*(Dose^hill)/((EC50^hill)+(Dose^hill)), start=list(Emax=-4,EC50=269,hill=2),trace=T,data=foo) Christian ___

[R] Comparison

2007-10-16 Thread Alessandra Trimarchi
Dear r-help mailing list, thanks for the advices on the last question,through them I've solved it. But now, I would know, how is possible to compare two(or more) cluster dendrograms, because for each cluster dendrogram coming from different data frame the height is measured with different uni

Re: [R] help with nls and Hill equation

2007-10-16 Thread Lanre Okusanya
Thanks. I am just not used to having such a huge difference when changing the initial condition by 1 point. it usually tends to be an issue when you are way off (especially since the hill converged at 1.69). Does it have something to do with the algorithm or is the hill just very finicky? Lanre

Re: [R] R-2.6.0 - packages installation through a proxy - not working

2007-10-16 Thread Liviu Andronic
On 10/16/07, Rainer M. Krug <[EMAIL PROTECTED]> wrote: > I always change the variables in the terminal window before I start R, i.e. > > export http_proxy=SERVER:3128 > export ftp_proxy=SERVER:3128 > > and then start R - I did it this morning, and it worked. I always start up Gentoo with these var

Re: [R] Bootstrapping Contrasts for Repeated Measures ANOVA

2007-10-16 Thread Daniel Lakeland
On Mon, Oct 15, 2007 at 11:19:35PM -0500, Alex Baugh wrote: > However, I don't know where to begin to write a program to do > contrasts with a resampling technique. select a random sample (with replacement) from the population with factor level 1, and a random sample from the population with fact

Re: [R] Data manipulation

2007-10-16 Thread Petr PIKAL
Hi "Klaus Friis Østergaard" <[EMAIL PROTECTED]> napsal dne 16.10.2007 10:34:15: > > 2007/10/15, Petr PIKAL <[EMAIL PROTECTED]>: > Hi > > > Well, let us put it another way. Do you want for each unique combination > of Hole and Feature to subtract a value from one data frame, let us call > it

Re: [R] R-2.6.0 - packages installation through a proxy - not working

2007-10-16 Thread Rainer M Krug
Liviu Andronic wrote: > On 10/16/07, Rainer M. Krug <[EMAIL PROTECTED]> wrote: >> I always change the variables in the terminal window before I start R, i.e. >> >> export http_proxy=SERVER:3128 >> export ftp_proxy=SERVER:3128 >> >> and then start R - I did it this morning, and it worked. > > I alw

Re: [R] problem with RCurl 0.8-1 installation on Debian Etch

2007-10-16 Thread Dirk Eddelbuettel
Hi Christian, On 16 October 2007 at 15:39, Christian Kohler wrote: | Dear R-Users, | | I am having some trouble getting an installation of RCurl 0.8-1 to work | properly on a Debian (Etch) machine. | | | The command 'R CMD INSTALL RCurl_0.8-1.tar.gz' yields the following error: | | Installin

Re: [R] Get the last 3 chars of a string

2007-10-16 Thread Thomas Lumley
On Mon, 15 Oct 2007, Gabor Grothendieck wrote: > Here is an alternative: > > sub(".*(..)$", "\\1", x) > For sufficiently small values of 3 ;) -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle __

Re: [R] ggplot2: ordering categorial data

2007-10-16 Thread hadley wickham
Hi Christoph, There's a couple of things you need to do. Firstly, you need to reorder the factor according to how you want the data sorted df$tld <- reorder_factor(df$tld, tapply(df$spam1, df$tld, mean)) is one way to do that. The reason that position dodge isn't working for you is because it

Re: [R] survreg's algorithm

2007-10-16 Thread Thomas Lumley
On Tue, 16 Oct 2007, Gad Abraham wrote: > Gad Abraham wrote: >> Hi, >> >> I'm using survreg() from the survival package for parametric survival >> regression (modelling inter-arrival times of patients to a waiting list >> as exponentially distributed, with various regressors such as queue size >>

Re: [R] Canberra distance

2007-10-16 Thread Jari Oksanen
Frédéric Chiroleu cirad.fr> writes: > > Hi, > > I misunderstand the definition of Canberra distance in R. > > On Internet and in function description pages of dist() from stats and > Dist() from amap, Canberra distance between vectors x and y, d(x,y), is : > > d(x,y) = sum(abs(x-y)/(x+y)) >

Re: [R] Get the last 3 chars of a string

2007-10-16 Thread Marc Schwartz
On Tue, 2007-10-16 at 07:49 -0700, Thomas Lumley wrote: > On Mon, 15 Oct 2007, Gabor Grothendieck wrote: > > > Here is an alternative: > > > > sub(".*(..)$", "\\1", x) > > > > For sufficiently small values of 3 ;) > all.equal(2., 3) [1] TRUE ;-) Marc __

Re: [R] help with nls and Hill equation

2007-10-16 Thread Ravi Varadhan
Another approach that usually works well is to use the option: algorithm = "port". This uses the "nl2sol" routine. foo.nls <- nls(var~Emax*(Dose^hill)/((EC50^hill)+(Dose^hill)), start=list(Emax=-4,EC50=269,hill=1), algorithm="port", trace=T,data=foo) This generally has more robust convergence

Re: [R] R-2.6.0 - packages installation through a proxy - not working

2007-10-16 Thread Scionforbai
I would start R with the command: http_proxy="http://SERVER:3128"; R and then from R I would try: install.packages("Rcmdr", dep = TRUE, method = "wget") provided that you have wget installed on your system (which I think). __ R-help@r-project.org mai

[R] library(car): Anova and repeated measures without between subjects factors

2007-10-16 Thread Ralf Goertz
Hi, sorry if this is explained somewhere but I didn't find anything. How can I use "Anova" from the car package to test a modell without between subject's factors? Suppose I have the following data mat.1 mat.2 mat.3 di ex 1 858588 1 1 2 909293 1 1 3 9797

[R] underdetermined system

2007-10-16 Thread yoooooo
Hi, sorry, I'm an idiot.. and I know I'm missing something stupid.. I thought if we solve an underdetermine system with QR, my soln is: min ||x|| (L2 sense) such that Ax = b then say i have: > w <- matrix(c(1, 5), ncol=2) > sw = 2 > qrW = qr(t(w) %*% w) > qr.coef(qrW, t(w) %*% sw) [,1]

[R] the new package "sets"

2007-10-16 Thread Jorge Manuel de Almeida Magalhães
Dear Sirs I can't try the package sets because I have a old mac system. Package sets needs R = 2.6. I need to group some variables into a set of new variables defined by a particular modality: Example: my.df = data.frame(var1=c(1,2,2,1,2,2,1,2), var2=c(2,2,1,1,2,2,1,1), var3=c(1,2,2,1,1,1,1,

Re: [R] R-2.6.0 - packages installation through a proxy - not working

2007-10-16 Thread Liviu Andronic
On 10/16/07, Scionforbai <[EMAIL PROTECTED]> wrote: > I would start R with the command: > > http_proxy="http://SERVER:3128"; R > > and then from R I would try: > > install.packages("Rcmdr", dep = TRUE, method = "wget") > install.packages("Rcmdr", dep = TRUE, method = "wget") --- Please select a CR

[R] Import from excel 2007

2007-10-16 Thread Arnold Akem
Hey Seniors, Really new to R, please has anyone imported a dataset from MS office excel 2007 into R yet? It seem to be giving me hard times which I did not expect as it use to go well with the previous versions. Thanks in advance. arnoldo -

[R] saving as PDF in R2.6.0 (MS Windows GUI)

2007-10-16 Thread Filippo Piro
I wonder why using the MS Windows GUI menu to save a graphic as PDF in R2.6.0 results in the following message: Error: invalid specification font furthermore: Warning messages: 1: font family not found in PostScript database 2: font family not found in PostScript database Filippo Piro

Re: [R] cumulative frequency plots for factors

2007-10-16 Thread Dieter Vanderelst
Hi, Henrique's solution is indeed very elegant. But after a while, I thought I needed more control over individual lines. Therefore, I switched to the more complex method you also suggest. I want to thank the both of you for the help. Regards, Dieter Jim Lemon wrote: > Dieter Vanderelst wrot

Re: [R] Import from excel 2007

2007-10-16 Thread Bert Gunter
Please read the Posting Guide and provide reproducible code. What do you mean by "import"? -- via RODBC?... as a delimited text file? ... using read.table(), scan(),... ??? Bert Gunter Genentech Nonclinical Statistics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Re: [R] R-2.6.0 - packages installation through a proxy - not working

2007-10-16 Thread Dirk Eddelbuettel
On 16 October 2007 at 16:37, Rainer M Krug wrote: | Liviu Andronic wrote: | > On 10/16/07, Rainer M. Krug <[EMAIL PROTECTED]> wrote: | >> I always change the variables in the terminal window before I start R, i.e. | >> | >> export http_proxy=SERVER:3128 | >> export ftp_proxy=SERVER:3128 | >> | >>

Re: [R] Import from excel 2007

2007-10-16 Thread Marc Schwartz
On Tue, 2007-10-16 at 14:38 +0100, Arnold Akem wrote: > Hey Seniors, > > Really new to R, please has anyone imported a dataset from MS office > excel 2007 into R yet? It seem to be giving me hard times which I did > not expect as it use to go well with the previous versions. > > Thanks

Re: [R] Need some help

2007-10-16 Thread azzza
You are right, I was a bit too vague. I am trying to simulate 1000 coin Tosses. Then to write a code for the number of heads/Tails.naturally, we would expect the proportion of heads to be 50% so the number of heads would be around 500. Secondly, I'm trying to look at the number of sign change

Re: [R] saving as PDF in R2.6.0 (MS Windows GUI)

2007-10-16 Thread Uwe Ligges
Several others wondered before and it has been fixed in R-patched. Uwe Ligges Filippo Piro wrote: > I wonder why using the MS Windows GUI menu to save a graphic as PDF in > R2.6.0 results in the following message: > > Error: invalid specification font > > furthermore: Warning messages: > 1:

Re: [R] Need some help

2007-10-16 Thread Marc Schwartz
You might want to do some more research on "Bernoulli Trials" and "Fair Coins", which would provide some enlightenment on why you would not "expect" 500 sign changes in 1,000 tosses and why you should, if the coin is "fair", expect to *approach* a 50/50 distribution of heads and tails in a large nu

[R] Simple plot of IR and option prices

2007-10-16 Thread James
Hi, I'm trying to construct what I think should be a fairly simple plot, yet I'm having a tremendously difficult time. I'm trying to create a very simple graph showing the effect of interest rates on option prices. I have three sets of option prices that I've calculated using rMetrics.

Re: [R] Import from excel 2007

2007-10-16 Thread Richard M. Heiberger
The best way to read or write Excel files is with the RExcel package. The development package available from http://sunsite.univie.ac.at/rcom/download/devel/RExcel.installer_1.80-14.zip reads both Excel 2003 and Excel 2007 files. In this development release, the installer is structured as an ord

[R] Adding axis lines to splom plots

2007-10-16 Thread Sarah Barry
Hi, I am trying to produce a 30x30 lattice grid. The 30 variables naturally fall into three groups of ten and I would like to add thicker axis lines around these to highlight this. However, I can only do this separately, so far, and I don't know how to superimpose the grid with the thicker l

Re: [R] Import from excel 2007

2007-10-16 Thread Scionforbai
> Such workarounds should normally be avoided. You forgot to mention: Excel should normally be avoided. Risk of scrambling data while exporting to a simple ascii formatted text file? Is it a joke? __ R-help@r-project.org mailing list https://stat.ethz.

Re: [R] Import from excel 2007

2007-10-16 Thread Marc Schwartz
On Tue, 2007-10-16 at 19:21 +0200, Scionforbai wrote: > > Such workarounds should normally be avoided. > > You forgot to mention: Excel should normally be avoided. > > Risk of scrambling data while exporting to a simple ascii formatted text file? > Is it a joke? No. Excel is notorious for this.

Re: [R] Need some help

2007-10-16 Thread azzza
Thats what is frustrating meI've done a lot of reading, but there doesnt seem to be much info on sign changes..I dont udnerstand why the poportion of sign changes is much less than 50%, despite the proportion of heads being equal to that of tails. Marc Schwartz wrote: > > You

Re: [R] simulation

2007-10-16 Thread Sandrine-et-Francois
Hi Oarabile, I'm not sure to full understand how you plan to use your function ... but it seems that do.call("rbind", ...) should address your concern. HTH, Best regards F - Original Message - From: "Oarabile Molaodi" <[EMAIL PROTECTED]> To: Sent: Tuesday, October 16, 2007 11:47 AM Subje

Re: [R] help with nls and Hill equation

2007-10-16 Thread Daniel Lakeland
On Tue, Oct 16, 2007 at 10:29:17AM -0400, Lanre Okusanya wrote: > Thanks. > I am just not used to having such a huge difference when changing the > initial condition by 1 point. it usually tends to be an issue when you > are way off (especially since the hill converged at 1.69). Does it > have some

[R] Bravington debug package with ESS

2007-10-16 Thread Sam McClatchie
System: Linux kernel 2.6.15 Ubuntu dapper R version 2.5.1 ESS 5.2.11 on Emacs 21.4.1 - Colleagues I'm not sure if R-help or ESS is the right list for this query, so please forgive me if you think this posting is to the wrong list. I'd like to use Mark Bravington's package

Re: [R] Need some help

2007-10-16 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of azzza > Sent: Tuesday, October 16, 2007 9:06 AM > To: r-help@r-project.org > Subject: Re: [R] Need some help > > > > You are right, I was a bit too vague. I am trying to simulate > 1000 coin > Tosse

[R] data structure for plsr

2007-10-16 Thread Bricklemyer, Ross S
All, I am working with NIR spectral data and it was great to find that the example in ?plsr also used spectral data. Unfortunately, I am having difficulty figuring out how the "yarn" dataset is structured to allow for the plsr model to read: library(pls) data(yard) yarn.oscorespls <- mvr(den

Re: [R] Need some help

2007-10-16 Thread jim holtman
If what you are asking for is to see how many times it crosses the axis when 'accumulating' the values of the top (+1, -1), then the following will do it - this is for 1000 and shows there are 32 crossings of the axis. > x <- sample(c(-1,1), 1000, TRUE) > plot(cumsum(x), type='l') > # now if you a

Re: [R] data structure for plsr

2007-10-16 Thread jim holtman
try: str(yarn) to see what the structure is. On 10/16/07, Bricklemyer, Ross S <[EMAIL PROTECTED]> wrote: > All, > > I am working with NIR spectral data and it was great to find that the example > in ?plsr also used spectral data. Unfortunately, I am having difficulty > figuring out how the "y

Re: [R] Need some help

2007-10-16 Thread roger koenker
You should be reading Feller v1 (p 86, 3rd ed) to see that the number of zero crossings in this process is proportional to sqrt(n) not n. url:www.econ.uiuc.edu/~rogerRoger Koenker email[EMAIL PROTECTED]Department of Economics vox: 217-333-4558Un

Re: [R] data structure for plsr

2007-10-16 Thread Bricklemyer, Ross S
Jim, I tried str(yarn). I received the following output: 'data.frame': 28 obs. of 3 variables: $ NIR: num [1:28, 1:268] 3.07 3.07 3.08 3.08 3.10 ... ..- attr(*, "dimnames")=List of 2 .. ..$ : NULL .. ..$ : NULL $ density: num 100.0 80.2 79.5 60.8 60.0 ... $ train : logi TR

Re: [R] Import from excel 2007

2007-10-16 Thread Scionforbai
I just wonder: why should R and its community try to support such an awful program, with its protected formats and unmantained features/bugs? I mean, from both philosophical and technical point of view: R is free software and should rather try to be 'viral' than to compete. It already has the stren

Re: [R] Need some help

2007-10-16 Thread Daniel Lakeland
On Tue, Oct 16, 2007 at 02:06:47PM -0400, jim holtman wrote: > If what you are asking for is to see how many times it crosses the > axis when 'accumulating' the values of the top (+1, -1), then the > following will do it - this is for 1000 and shows there are 32 > crossings of the axis. I think wh

Re: [R] detrending a time series

2007-10-16 Thread rdporto
Chris, if you really want to use the stl() function, one possible solution is to do my.ts=ts(my.ts,start=1800,frequency=2). Rogerio --- Original Message --- From: Christoph Scherber Date: Wed, 10 Oct 2007 16:16:39 +0200 Dear R users, I am trying to ´detect´ the trend in an artificial time

Re: [R] Import from excel 2007

2007-10-16 Thread Bert Gunter
R's developers have made the right decision. Like it or not, my company colleagues and "customers" provide me most data in Excel. I want to use R to analyze/plot/etc the data, and sometimes to provide them R applications to do the analyses themselves instead of the current Excel analyses (sic) th

Re: [R] Import from excel 2007

2007-10-16 Thread Alberto Monteiro
Scionforbai wrote: > > I just wonder: why should R and its community try to support > such an awful program, with its protected formats and unmantained > features/bugs? > By such logic, why should R be ported to Windows? :-) Short answer: because some of the data you want to use is writen in Excel

Re: [R] Need some help

2007-10-16 Thread azzza
ok, so suppose a coin is tossed 1000 times. Each time head occurs, we win a dollar, otherwise we lose a dollar. Let S(n) be our accumulated winnings after n tosses. For instance, if the sequence HHHTT occurs in the first five tosses, then S(5) = $1.00 wheras if the sequence H occurs, S(5) =

Re: [R] underdetermined system

2007-10-16 Thread Ravi Varadhan
QR is good for overdetermined LS problems, and I don't think that it can be used for "minimum norm" solution of underdetrmined LS problems. You need LAPACK's Fortran routine DGELS. I am not sure if this currently available in R. Ravi.

Re: [R] Adding axis lines to splom plots

2007-10-16 Thread Deepayan Sarkar
On 10/16/07, Sarah Barry <[EMAIL PROTECTED]> wrote: > Hi, > > I am trying to produce a 30x30 lattice grid. The 30 variables naturally > fall into three groups of ten and I would like to add thicker axis lines > around these to highlight this. However, I can only do this separately, > so far, and

Re: [R] underdetermined system

2007-10-16 Thread yoooooo
Turns out someone asked this before ;) http://tolstoy.newcastle.edu.au/R/e2/devel/07/04/2981.html Ravi Varadhan wrote: > > QR is good for overdetermined LS problems, and I don't think that it can > be > used for "minimum norm" solution of underdetrmined LS problems. You need > LAPACK's Fortra

Re: [R] library(car): Anova and repeated measures without between subjects factors

2007-10-16 Thread John Fox
Dear Ralf, Unfortunately, Anova.mlm(), and indeed Anova() more generally, won't handle a model with only a constant. As you point out, this isn't reasonable for repeated-measures ANOVA, where it should be possible to have only within-subjects factors. When I have a chance, I'll see what I can do t

Re: [R] underdetermined system

2007-10-16 Thread Charles C. Berry
On Tue, 16 Oct 2007, Ravi Varadhan wrote: > QR is good for overdetermined LS problems, and I don't think that it can be > used for "minimum norm" solution of underdetrmined LS problems. You need > LAPACK's Fortran routine DGELS. I am not sure if this currently available > in R. It is in include

Re: [R] Need some help

2007-10-16 Thread azzza
Ok, so n= the toss number, and s(n) is the accumulated winnings after n tosses. Now, each time we have a heads, we win a dollar, and each time we have a tails, we lose a dollar. So, s(n) is th sign changes in 1000 tosses. In the beginning, S(0) must be 0, and S(-1) must be zero too. ok, so if on

Re: [R] Need some help

2007-10-16 Thread Marc Schwartz
On Tue, 2007-10-16 at 11:53 -0700, azzza wrote: > > > ok, so suppose a coin is tossed 1000 times. Each time head occurs, we win a > dollar, otherwise we lose a dollar. Let S(n) be our accumulated winnings > after n tosses. For instance, if the sequence HHHTT occurs in the first five > tosses, th

Re: [R] underdetermined system

2007-10-16 Thread Ravi Varadhan
Here is a solution using SVD: w <- matrix(c(1, 5), ncol=2) sw <- 2 w.svd <- svd(w) sw %*% w.svd$u %*% diag(1/w.svd$d, length(w.svd$d)) %*% t(w.svd$v) > sw %*% w.svd$u %*% diag(1/w.svd$d, length(w.svd$d)) %*% t(w.svd$v) [,1] [,2] [1,] 0.07692308 0.3846154 > This, of course, has a

[R] Mutual Information on continuous variables

2007-10-16 Thread Wan Kyu Kim
I am looking for a function for MI (mutual information) for continuous variables X, Y. I prefer not to discretize X,Y as it leaves the problems of optimal bin number etc. Can any one give a pointer to calculate mutual information using Gausian kernel estimator for two continuous variables ? wan

Re: [R] Need some help

2007-10-16 Thread azzza
Thank you guyz. your codes gave me the results I was looking for. And thanks for the reference suggestion. Lastly, how do I code the frequency of heads? Daniel Lakeland wrote: > > On Tue, Oct 16, 2007 at 02:06:47PM -0400, jim holtman wrote: >> If what you are asking for is to see how many ti

Re: [R] Import from excel 2007

2007-10-16 Thread Rolf Turner
On 17/10/2007, at 7:52 AM, Alberto Monteiro wrote: > Scionforbai wrote: >> >> I just wonder: why should R and its community try to support >> such an awful program, with its protected formats and unmantained >> features/bugs? >> > By such logic, why should R be ported to Windows? :-) > > Short an

Re: [R] Need some help

2007-10-16 Thread azzza
THANKYOU guyz! yes, Jim's code was right (it was similar to someone elses)I somehow missed his reply! Yes, that was exactly what i was looking for. lastly, how do i find the frequency of heads perhaps? Marc Schwartz wrote: > > On Tue, 2007-10-16 at 11:53 -0700, azzza wrote: >> >> >> ok

[R] univariate impulse responses

2007-10-16 Thread Martin Ivanov
Dear R users, I need to calculate the univariate impulse response function for a series of data. Unfortunately the vars package does not support univariate analysis. If I try to evaluate a single series like this: VAR(y=xres,p=1,type="none",ic="AIC") the result is Error in VAR(y = xres, p = 1,

Re: [R] Need some help

2007-10-16 Thread jim holtman
sum(toss == 1) /length(toss) # assuming heads == 1 On 10/16/07, azzza <[EMAIL PROTECTED]> wrote: > > > THANKYOU guyz! yes, Jim's code was right (it was similar to someone > elses)I somehow missed his reply! > Yes, that was exactly what i was looking for. lastly, how do i find the > frequency o

Re: [R] underdetermined system

2007-10-16 Thread Ravi Varadhan
Here is a more general R function to solve "any" linear system (under/over determined): ls.min <- function(x, y) { # solves: x %*% b = y d <- svd(x) # min-norm solution b.min <- d$v %*% diag(1/d$d, length(d$d)) %*% t(d$u) %*% y return(b.min) } > # underdetermined case > x <- matrix(c(2, -1, 4,

Re: [R] Need some help

2007-10-16 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of azzza > Sent: Tuesday, October 16, 2007 12:49 PM > To: r-help@r-project.org > Subject: Re: [R] Need some help > > > > THANKYOU guyz! yes, Jim's code was right (it was similar to someone > elses)I

Re: [R] Import from excel 2007

2007-10-16 Thread hadley wickham
On 10/16/07, Marc Schwartz <[EMAIL PROTECTED]> wrote: > On Tue, 2007-10-16 at 14:38 +0100, Arnold Akem wrote: > > Hey Seniors, > > > > Really new to R, please has anyone imported a dataset from MS office > > excel 2007 into R yet? It seem to be giving me hard times which I did > > not expect as i

[R] Calculating confidence in an estimate including number of trials?

2007-10-16 Thread Zembower, Kevin
[Yes, this is related to a homework problem, but is not the problems itself.] In my mathematical statistics class, we've just learned about properties of estimators, and I can now solve manually problems like this: A sample of size n = 16 is drawn from a normal distribution where sigma = 10 but m

[R] Updating R-Software without complete new installation

2007-10-16 Thread John C Frain
-- Forwarded message -- From: John C Frain <[EMAIL PROTECTED]> Date: 16 Oct 2007 21:28 Subject: Re: [R] Updating R-Software without complete new installation To: Vladimir Eremeev <[EMAIL PROTECTED]> A word of warning. There is a danger that some package that you depend on may not

Re: [R] Calculating confidence in an estimate including number of trials?

2007-10-16 Thread Daniel Lakeland
On Tue, Oct 16, 2007 at 04:30:48PM -0400, Zembower, Kevin wrote: > Now I'd like to know how to use R to solve this type of problem. In all > my other problems using normal curves, I used dnorm or pnorm, but > neither of these includes anything regarding the number of trials. pnorm can be used lik

Re: [R] R-2.6.0 - packages installation through a proxy - not working

2007-10-16 Thread Liviu Andronic
On 10/16/07, Dirk Eddelbuettel <[EMAIL PROTECTED]> wrote: > options(download.file.method="wget") > > in your Rprofile and you should be fine for all subsequent file operations. I added # # Set download options options(download.file.method="wget") to /usr/lib/R/etc/Rprofile.site. It does n

Re: [R] Calculating confidence in an estimate including numberof trials?

2007-10-16 Thread Zembower, Kevin
Daniel, thanks for your suggestion. So, it's just done like this: > pnorm(21, mean=20, sd=10/4) - pnorm(19, mean=20, sd=10/4) [1] 0.3108435 > # OR > pnorm(21, mean=20, sd=10/sqrt(16)) - pnorm(19, mean=20, sd=10/sqrt(16)) [1] 0.3108435 > Thanks, again. -Kevin -Original Message- From: [EMA

[R] try / tryCatch for download.file( ) within a for loop when URL does not exist

2007-10-16 Thread Vishal Belsare
I am trying to download a bunch of files from a server, for which I am using download.file( ) within a for loop. The script is working fine except until download.file hits a URL which has no file, at which point it exits. I want to change this behavior to simple log the failure and maintain state w

  1   2   >