[R] text file imported incorrectly

2008-09-04 Thread Weiyang Lim
Dear R-users, When I tried to import a text file (tab delimited) which has 2000+ rows with the following command (With the importData in S, it works though), x - read.table(textfile, sep= \t, skip=5, stringAsFactors=F) I received the following warning message: Error in scan(file, what, nmax,

[R] Maximum likelihood estimation

2008-09-04 Thread toh
Hi R-experts, I'm new to R in mle. I tried to do the following but just couldn't get it right. Hope someone can point out the mistakes. thanks a lot. t - c(1:90) y - c(5,10,15,20,26,34,36,43,47,49,80,84,108,157,171,183,191,200,204,211,217,226,230,

Re: [R] Binary Tree Testing in ape package (a bug?)

2008-09-04 Thread Christoph Heibl
If I am right informed, 'is.binary.tree' cannot test for root polytomies. Consider this example: tree.hiv - read.tree(text=((rat,mouse,(human,chimp)), kangaroo);) is.binary.tree(tree.hiv)# will yield 'FALSE' For further questions you might be better advised to use the

Re: [R] ggplot2: line plot with gaps in time axis

2008-09-04 Thread ONKELINX, Thierry
Brian, The easiest way is to create the entire timeseries and then set the missing values to NA. The NA values will lead to the gaps you want. HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en

Re: [R] text file imported incorrectly

2008-09-04 Thread Prof Brian Ripley
Please do read the help page (as you were asked to do before posting). See the 'quote' argument. This is also covered in the 'R Data Import/Export Manual'. On Thu, 4 Sep 2008, Weiyang Lim wrote: Dear R-users, When I tried to import a text file (tab delimited) which has 2000+ rows with the

Re: [R] CV.Tree

2008-09-04 Thread Prof Brian Ripley
See MASS (the book) for examples. BTW, R _is_ case sensitive. On Wed, 3 Sep 2008, Warren Schlechte wrote: I am using the tree package. One option is the cv.tree, which is supposed to run cross-validations on your tree models. Is there somewhere I can find some documentation on this

Re: [R] license for a university

2008-09-04 Thread Barry Rowlingson
2008/9/4 Ted Byers [EMAIL PROTECTED]: Erin, I trust you know what you risk when you assume. ;-) There IS a license, but it basically lets you copy or distribute it, or, in your case, install on as many machines as you wish. It is the GNU GENERAL PUBLIC LICENSE. Like most open source

Re: [R] R update

2008-09-04 Thread Williams, Robin
Not sure if you can do it from within R, but if not surely you can just go to the website www.r-project.org Download and install the latest version and remove older versions if you wish. Robin Williams Met Office summer intern - Health Forecasting [EMAIL PROTECTED] -Original

Re: [R] test if all predictors in a glm object are factors

2008-09-04 Thread Prof Brian Ripley
On Wed, 3 Sep 2008, Marc Schwartz wrote: on 09/03/2008 04:56 PM Michael Friendly wrote: I'm trying to develop some graphic methods for glm objects, but they only apply for models where all predictors are discrete factors. How can I test for this in a Is an ordered factor a 'discrete

[R] Coefficient of skewness

2008-09-04 Thread Williams, Robin
Hi, Is there a function in R to calculate the coefficient of skewness of some data? I had expected there to be one, but can find no information about it. Thanks for any pointers. Robin Williams Met Office summer intern - Health Forecasting [EMAIL PROTECTED] [[alternative HTML

Re: [R] text file imported incorrectly

2008-09-04 Thread Weiyang Lim
Thanks, Prof Ripley. I did read about the quote argument in the 'R Data Import/Export Manual'. But unfortunately, I did not really understand what it means and did not adjust that argument. But now after adjusting for it, it works for me. Thanks. Best Regards, wy -Original Message-

Re: [R] Coefficient of skewness

2008-09-04 Thread ONKELINX, Thierry
Dear Robin, RSiteSearch(skewness, restrict = functions) gave me 222 hits. There are several functions that calculate skewness. HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research

Re: [R] restricted bootstrap

2008-09-04 Thread Prof Brian Ripley
I see nothing here to do with the 'bootstrap', which is sampling with replacement. Do you know what you mean exactly by 'randomly sample'? In general the way to so this is to sample randomly (uniformly, whatever) and reject samples that do not meet your restriction. For some restrictions

Re: [R] Coefficient of skewness

2008-09-04 Thread Prof Brian Ripley
It exists in many packages: e1071 was one of the earliest. Other packages include GLDEX, HyperbolicDist, QuantPsyc, TSA, agricolae, fUtilities, modeest, moments, npde, s20x It is also a common exercise in basic R programming courses. On Thu, 4 Sep 2008, Williams, Robin wrote: Hi, Is there

[R] Any function to calculate returns

2008-09-04 Thread Weiyang Lim
Hi, Sorry if this may be a simple question. Is there any function to calculate returns (percentage or non-percentage) directly like the function getReturns() in S Finmetrics? Thanks. Best Regards, wy ** The information provided in this

Re: [R] Free SQL Database with R

2008-09-04 Thread Chibisi Chima-Okereke
Thanks for that, looks like pretty much what I'm after. Kind Regards Chibisi On Wed, Sep 3, 2008 at 9:17 PM, Iain Gallagher [EMAIL PROTECTED] wrote: Hi Chibisi I'm sort of jumping into this thread but from your description of charts / plotting below I thought you might like to take a

Re: [R] cluster a distance(analogue)-object using agnes(cluster)

2008-09-04 Thread Martin Maechler
B == Birgitle [EMAIL PROTECTED] on Tue, 2 Sep 2008 03:02:31 -0700 (PDT) writes: B I try to perform a clustering using an existing dissimilarity matrix that I B calculated using distance (analogue) B I tried two different things. One of them worked and one not and I don`t B

Re: [R] Maximum likelihood estimation

2008-09-04 Thread Prof Brian Ripley
From ?optim fn: A function to be minimized (or maximized), with first argument the vector of parameters over which minimization is to take place. It should return a scalar result. I think you intended to optimize over c(a,b,p, lambda), so you need to specify them as

Re: [R] nls.control()

2008-09-04 Thread Prof Brian Ripley
On Wed, 3 Sep 2008, Ranney, Steven wrote: and I'm trying to fit a simple Von Bertalanffy growth curve with program: VonB=nls(TL~Linf*(1-exp(-k*(age-t0))), data=box5.4, start=list(Linf=1000, k=0.1, t0=0.1), trace=TRUE) ... Everything works as it should right up until the confint(VonB)

Re: [R] nls convergence trouble

2008-09-04 Thread Benoit Boulinguiez
Hi, I agree with you that Excel is not the best tool for fittings, that's why I try to handle R. But I need to use this specific model (LgmAltFormula) and not a polynomial expression with the different parameters even if your method produced correct fitting. The parameters a and b are the

[R] printing name of object inside lapply

2008-09-04 Thread Steve Powell
Dear list members, I am trying, within a lapply command, to print the name of the objects in list or data frame. This is so that I can use odfWeave to print out a report with a section for each object, including the object names. I tried e.g. a=b=c=1:5 lis=data.frame(a,b,c) lapply( lis,

Re: [R] printing name of object inside lapply

2008-09-04 Thread Prof Brian Ripley
On Thu, 4 Sep 2008, Steve Powell wrote: Dear list members, I am trying, within a lapply command, to print the name of the objects in list or data frame. This is so that I can use odfWeave to print out a report with a section for each object, including the object names. I tried e.g. a=b=c=1:5

Re: [R] nls convergence trouble

2008-09-04 Thread Petr PIKAL
Well, the model you try to fit is almost independent of b try plot(Qe,fff1(364,0.0126)) points(Qe,fff1(364,1), col=2) So you can quite freely choose b without any substantial improvement to fit. I am not an expert in nonlinear fitting but seems to me that your data does not follow your

[R] read.table error

2008-09-04 Thread Steve Murray
Dear all, I have a tab-delimited text (.txt) file which I'm trying to read into R. This file is of column format - there are in fact 3 columns and 259201 rows (including the column headers). I've been using the following commands, but receive an error each time which prevents the data from

Re: [R] read.table error

2008-09-04 Thread Prof Brian Ripley
On Thu, 4 Sep 2008, Steve Murray wrote: Dear all, I have a tab-delimited text (.txt) file which I'm trying to read into R. This file is of column format - there are in fact 3 columns and 259201 rows (including the column headers). I've been using the following commands, but receive an

Re: [R] restricted bootstrap

2008-09-04 Thread Grant Gillis
Hello Professor Ripely, Sorry for not being clear. I posted after a long day of struggling. Also my toy distance matrix should have been symmetrical. Simply put I have spatially autocorrelated data collected from many points. I would like to do a linear regression on these data. To deal with

[R] Projecting Survival Curve into the Future

2008-09-04 Thread Alan Cox
Hello, I have a survivor curve that shows account cancellations during the past 3.5 months.  Fortunately for our business, but unfortunately for my analysis, the survivor curve doesn't yet pass through 50%.  Is there a safe way to extend the survivor curve and estimate at what time we'll hit

Re: [R] read.table error

2008-09-04 Thread Steve Murray
Thanks Prof. Ripley! I knew it would be something simple - I'd missed the \t from the read.table command! I won't be doing that again...!! Thanks again, Steve __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

[R] Correct for heteroscedasticity using car package

2008-09-04 Thread Carrasco-Torrecilla, Roman R
Dear all, Sorry if this is too obvious. I am trying to fit my multiple regression model using lm() Before starting model simplification using step() I checked whether the model presented heteroscedasticity with ncv.test() from the CAR package. It presents it. I want to correct for it, I used

Re: [R] Projecting Survival Curve into the Future

2008-09-04 Thread Richard . Cotton
I have a survivor curve that shows account cancellations during the past 3.5 months. Â Fortunately for our business, but unfortunately for my analysis, the survivor curve doesn't yet pass through 50%. Â Is there a safe way to extend the survivor curve and estimate at what time we'll hit

Re: [R] nls convergence trouble

2008-09-04 Thread Christian Ritz
Hi Benoit, another way of making Petr's point is by looking at the profile log likelihood function for b; that is, only estimating the a parameter for a grid of b values: ## Defining mean function for fixed b lgma - function(b){ function(C0, m, V, a){ (V + b * m * a + C0 * V * b - ((C0 *

Re: [R] printing name of object inside lapply

2008-09-04 Thread Steve Powell
Thanks Prof Ripley! How obvious in retrospect! Prof Brian Ripley wrote: On Thu, 4 Sep 2008, Steve Powell wrote: Dear list members, I am trying, within a lapply command, to print the name of the objects in list or data frame. This is so that I can use odfWeave to print out a report with a

[R] Adding a legend to R graph device with several plots (no to individual plots!)

2008-09-04 Thread Nelson Villoria
Dear Users, I already posted this question: it either went unnoticed, or it is to basic (if this is so, please sent me a hint). I would like to know if there is a way to add a common legend to an arrangement of plots. In the example below, I get four plots in my device. each one has a density for

Re: [R] Projecting Survival Curve into the Future

2008-09-04 Thread Robert A LaBudde
You might consider a probit analysis using ln(Time) as the dose. At 09:24 AM 9/4/2008, [EMAIL PROTECTED] wrote: I have a survivor curve that shows account cancellations during the past 3.5 months. Â Fortunately for our business, but unfortunately for my analysis, the survivor curve doesn't

Re: [R] Adding a legend to R graph device with several plots (no to individual plots!)

2008-09-04 Thread Duncan Murdoch
On 9/4/2008 9:35 AM, Nelson Villoria wrote: Dear Users, I already posted this question: it either went unnoticed, or it is to basic (if this is so, please sent me a hint). I would like to know if there is a way to add a common legend to an arrangement of plots. In the example below, I get four

Re: [R] Projecting Survival Curve into the Future

2008-09-04 Thread Prof Brian Ripley
On Thu, 4 Sep 2008, [EMAIL PROTECTED] wrote: I have a survivor curve that shows account cancellations during the past 3.5 months. Â Fortunately for our business, but unfortunately for my analysis, the survivor curve doesn't yet pass through 50%. Â Is there a safe way to extend the survivor

Re: [R] Installing rgl

2008-09-04 Thread Kevin E. Thorpe
Duncan Murdoch wrote: On 03/09/2008 4:34 PM, Kevin E. Thorpe wrote: Hello. I'm having trouble installing rgl. I have a theory as to the problem. First, the error message and session info. install.packages(rgl) trying URL 'http://probability.ca/cran/src/contrib/rgl_0.81.tar.gz' Content

Re: [R] how to reduce stress value in isoMDS?

2008-09-04 Thread stephen sefick
no I mean maybe use a higher dimension solution- the other thing you may wish to check out is package vegan which has an mds function and very good viginettes, and is my favorite package for doing ordination analysis (metaMDS uses isoMDS). hope this helps On Wed, Sep 3, 2008 at 9:03 PM, 陈武

Re: [R] Correct for heteroscedasticity using car package

2008-09-04 Thread John Fox
Dear Roman, You can use the coefficient-covariance matrix returned by hccm() for calculating corrected standard errors for the coefficients. Alternatively, if you know the pattern of heteroscedasticity [as you probably do if you used ncv.test()], you could try to correct for it by a

[R] A ternary graph's scales

2008-09-04 Thread Marcin Kozak
Hi all, I am drawing a ternary graph. Everything is fine with both ternaryplot (package vcd) and triangle.plot (package ade4), but I want to present scales in neither percents nor from 0 to 1 (this is actually the only option I found in both functions). I want the scales to be in a natural scale

Re: [R] Correct for heteroscedasticity using car package

2008-09-04 Thread Achim Zeileis
On Thu, 4 Sep 2008, Carrasco-Torrecilla, Roman R wrote: Dear all, Sorry if this is too obvious. I am trying to fit my multiple regression model using lm() Before starting model simplification using step() I checked whether the model presented heteroscedasticity with ncv.test() from the CAR

[R] 3 Courses*** R/Splus Fundamentals and Programming Techniques: September 2008 at 3 locations by XLSolutions Corp

2008-09-04 Thread [EMAIL PROTECTED]
rXLSolutions Corporation (www.xlsolutions-corp.com) is proud to announce our*** R/Splus Fundamentals and Programming Techniques***course at 3 USA locations for September 2008. (1) R/Splus Fundamentals and Programming Techniques http://www.xlsolutions-corp.com/Rfund.htm * San Francisco

Re: [R] nls convergence trouble

2008-09-04 Thread Gabor Grothendieck
# 1. Supplying the derivatives results in convergence: lgmg - function(a, b, C0, m, V) { + e - expression((V + b * m * a + C0 * V * b - ((C0 * V * b)^2 + 2 * + C0 * b * V^2 - 2 * C0 * V * m * a * b^2 + V^2 + 2 * V * m * + a * b + (b * m * a)^2))/(2 * b * m)) + val - eval(e) + attr(val,

[R] pass data to log-likelihood function

2008-09-04 Thread Jinsong Zhao
Hi there, When I do bootstrap on a maximum likelihood estimation, I try the following code, however, I get error: Error in minuslogl(alpha = 0, beta = 0) : object x not found It seems that mle() only get data from workspace, other than the boot.fun(). My question is how to pass the data to

Re: [R] pass data to log-likelihood function

2008-09-04 Thread Duncan Murdoch
On 9/4/2008 10:54 AM, Jinsong Zhao wrote: Hi there, When I do bootstrap on a maximum likelihood estimation, I try the following code, however, I get error: Error in minuslogl(alpha = 0, beta = 0) : object x not found It seems that mle() only get data from workspace, other than the boot.fun().

[R] Stepwise

2008-09-04 Thread Williams, Robin
Hi, Is there any facility in R to perform a stepwise process on a model, which will remove any highly-correlated explanatory variables? I am told there is in SPSS. I have a large number of variables (some correlated), which I would like to just chuck in to a model and perform stepwise and see what

[R] help on jarque test

2008-09-04 Thread giov
Hi all, I used the function jarque.test (in the moments package) on my data set and I obtained something like this: Jarque-Bera Normality Test data: x JB = 4.8381, p-value = 0.089 alternative hypothesis: greater or Jarque-Bera Normality Test data: x JB = 2.6018, p-value =

[R] for 1:length and removing rows

2008-09-04 Thread Markus Mühlbacher
Hello everyone, I have a problem using a for-loop to go through a matrix. I want to remove all rows with a sum of 0. What I do is basically: for(i in 1:length(data)) { if(sum(add(data[i,]) == 0) { data - data[-i,] } } I get a error message: Error in `[.data.frame`(data, i) :

[R] saving an object

2008-09-04 Thread Rajasekaramya
Hi there, I have a dataset stored in an object which has very huge volume of rows.I want to reuse it for comparing with other datasets.I dont want it to reload every time i run the script.Is there a way of saving a particular loaded object in the workspace and reusing it. Kindly help me.

Re: [R] saving an object

2008-09-04 Thread Williams, Robin
?save I assume you can connect to it from within the script, presumably by supplying the path of the object to the appropriate argument in your script. I'm no expert though. HTH, Robin Williams Met Office summer intern - Health Forecasting [EMAIL PROTECTED] -Original Message-

Re: [R] Stepwise

2008-09-04 Thread Peter Flom
Robin Williams wrote Is there any facility in R to perform a stepwise process on a model, which will remove any highly-correlated explanatory variables? I am told there is in SPSS. I have a large number of variables (some correlated), which I would like to just chuck in to a model and perform

Re: [R] for 1:length and removing rows

2008-09-04 Thread Ted Harding
On 04-Sep-08 15:33:06, Markus Mühlbacher wrote: Hello everyone, I have a problem using a for-loop to go through a matrix. I want to remove all rows with a sum of 0. What I do is basically: for(i in 1:length(data)) { if(sum(add(data[i,]) == 0) { data - data[-i,] } } I

[R] table and colnames

2008-09-04 Thread Trubisz, Joseph
I have a table statement that returns the following: [10.839,10.841] (10.841,10.843] (10.843,10.846] (10.846,10.848] (10.848,10.85] 0 0 0 0 1 (10.85,10.852] (10.852,10.854] (10.854,10.857] (10.857,10.859] (10.859,10.861]

Re: [R] A ternary graph's scales

2008-09-04 Thread Greg Snow
There is also the tri function in the cwhtool package, triax.plot in the plotrix package, and triplot in the TeachingDemos package (I think it is between this plot and progress bars as to what functionality is reproduced in the most packages). One of the others may do what you want, or be

Re: [R] table and colnames

2008-09-04 Thread Henrique Dallazuanna
Try this: v - as.numeric(gsub(]|\\), , unlist(lapply(strsplit(names(tb), ,), [, 2 Where tb is your table On Thu, Sep 4, 2008 at 10:20 AM, Trubisz, Joseph [EMAIL PROTECTED] wrote: I have a table statement that returns the following: [10.839,10.841] (10.841,10.843] (10.843,10.846]

Re: [R] table and colnames

2008-09-04 Thread jim holtman
Here is one way: y - levels(cut(x,5)) y [1] (0.0124,0.209] (0.209,0.405] (0.405,0.601] (0.601,0.797] (0.797,0.993] sapply(y, function(x) sub(.*,(.*)], \\1, x)) (0.0124,0.209] (0.209,0.405] (0.405,0.601] (0.601,0.797] (0.797,0.993] 0.2090.4050.6010.797

Re: [R] A ternary graph's scales

2008-09-04 Thread Marcin Kozak
Thank you, Greg. After all I noticed that in ternaryplot it can be easily made by setting a 'scale' parameter. Thanks, Marcin On Thu, Sep 4, 2008 at 6:00 PM, Greg Snow [EMAIL PROTECTED] wrote: There is also the tri function in the cwhtool package, triax.plot in the plotrix package, and

[R] Plotting using 'if' statements

2008-09-04 Thread Steve Murray
Dear all, I have a dataset of four columns, and I wish to plot (as a scatter graph) the values of the third column where the values are greater than zero, and the fourth column. I tried doing this via the plot command itself, but got into a bit of a mess (resulting in errors!). My

Re: [R] table and colnames

2008-09-04 Thread Gabor Grothendieck
See http://gsubfn.googlecode.com for more on the gsubfn package. Below we use strapply to pick out every string of digits and decimal points converting each to numeric returning a list of pairs and rbinding that list into a matrix. x - c([10.839,10.841], (10.841,10.843], (10.843,10.846],

Re: [R] Plotting using 'if' statements

2008-09-04 Thread Henrique Dallazuanna
Try this: plot(January[January[,3] 0, 3:4]) On Thu, Sep 4, 2008 at 1:28 PM, Steve Murray [EMAIL PROTECTED] wrote: Dear all, I have a dataset of four columns, and I wish to plot (as a scatter graph) the values of the third column where the values are greater than zero, and the fourth

Re: [R] saving an object

2008-09-04 Thread Henrik Bengtsson
Alternatively you can use saveObject() and loadObject() of R.utils - that will not hardwire the name of the loaded object avoiding name conflicts, e.g. library(R.utils); foo - 1:10; saveObject(foo, file=foo.RData); bar - loadObject(foo.RData); /HB On Thu, Sep 4, 2008 at 8:44 AM, Williams, Robin

Re: [R] Plotting using 'if' statements

2008-09-04 Thread Steve Murray
Ah that's great, thank you very much. As a follow-on, in the same format, how would I plot where column 3 is greater than 0 *but also less than 2*? Once again, any help is much appreciated. Thanks, Steve Date: Thu, 4 Sep 2008 13:39:12 -0300 From: [EMAIL

Re: [R] Plotting using 'if' statements

2008-09-04 Thread Henrique Dallazuanna
Use '': plot(January[January[,3] 0 January[,3] 2, 3:4]) On Thu, Sep 4, 2008 at 1:47 PM, Steve Murray [EMAIL PROTECTED] wrote: Ah that's great, thank you very much. As a follow-on, in the same format, how would I plot where column 3 is greater than 0 *but also less than 2*? Once again,

[R] R base 2.7.2 packaged for Mandriva 2008.1 x86_64: anyone interested?

2008-09-04 Thread Corrado
I have packaged R base 2.7.2 for Mandriva 2008.1 x86_64 who should I send it to so that it can be made available to everybody? It is my first attempt and it works well on my computer, but it will need some testing. Best, -- Corrado Topi Global Climate Change Biodiversity Indicators

[R] Interpolation Function f(y)

2008-09-04 Thread ermimi
Hello friends!!! I have a list of values called y. The list is y=c(221.0, 212.0, 206.0, 202.7, 198.4, 195.1, 192.2, 189.7, 187.6, 185.8); y is f(x) and x=c(10,20,30,40,50,60,70,80,90,100). I only have x and y. I don´t know f(x). I would like interpolate f(x) to obtain other values as f(15),

Re: [R] Interpolation Function f(y)

2008-09-04 Thread Henrique Dallazuanna
I think that you can use the splinefun function: f - splinefun(x, y) f(15) On Thu, Sep 4, 2008 at 1:52 PM, ermimi [EMAIL PROTECTED] wrote: Hello friends!!! I have a list of values called y. The list is y=c(221.0, 212.0, 206.0, 202.7, 198.4, 195.1, 192.2, 189.7, 187.6, 185.8); y is f(x)

Re: [R] Interpolation Function f(y)

2008-09-04 Thread ermimi
Thank you very much, You have helped me to resolve the problem. Thank you!! A greetings, Luismi Henrique Dallazuanna wrote: I think that you can use the splinefun function: f - splinefun(x, y) f(15) On Thu, Sep 4, 2008 at 1:52 PM, ermimi [EMAIL PROTECTED] wrote: Hello

[R] Hazard Rate Confidence Intervals

2008-09-04 Thread Alan Cox
Hello, Is it possible to create confidence intervals for hazard rates?  I'm creating two muhaz objects: haz1 - muhaz(NumDaysCustomer[cRV==true],status[cRV==true]) haz2 - muhaz(NumDaysCustomer[cRV==false],status[cRV==false]) and plotting them.  There are many, many more observations in

Re: [R] help on jarque test

2008-09-04 Thread Ben Bolker
giov biowoman at libero.it writes: Hi all, I used the function jarque.test (in the moments package) on my data set and I obtained something like this: Jarque-Bera Normality Test data: x JB = 4.8381, p-value = 0.089 alternative hypothesis: greater or Jarque-Bera

[R] Error with update.packages()

2008-09-04 Thread Brant Inman
R-helpers: I just updated from R 7.0 to R 7.2.2 today. I am using MAC OS X version 10.5.4 on a Macbook to run R. sessionInfo() R version 2.7.2 (2008-08-25) i386-apple-darwin8.11.1 locale: en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 attached base

Re: [R] Stepwise

2008-09-04 Thread Ben Bolker
Peter Flom peterf at brainscope.com writes: Robin Williams wrote Is there any facility in R to perform a stepwise process on a model, which will remove any highly-correlated explanatory variables? I am told there is in SPSS. I have a large number of variables (some correlated), which I

[R] combning rows

2008-09-04 Thread kayj
I do have a txt file where each row is a record and the first element of each record is an id for an individual. I am looking into combing the records into one row if the id is the same and save as a txt file. Notice that the rows may not have the same length in the result file that I want to

[R] Error in table lookup

2008-09-04 Thread PDXRugger
I am trying to lookup a value in 1 of 10 loaded two column-data sets (Bins) by displaying the value of the second column based on the value of the first. For instance in Bin1_Acres Bin1_parprobBin1_TAZ [1,] 0.0004420.978 356 [2,] 0.0004530.954

Re: [R] Stepwise

2008-09-04 Thread Frank E Harrell Jr
Also consider the redun function in the Hmisc package, which does not use the response variable but uses flexible nonlinear additive models to predict each predictor variable from all the others, using a stepwise procedure in a formal redundancy analysis. Frank Ben Bolker wrote: Peter Flom

Re: [R] Error in table lookup

2008-09-04 Thread jim holtman
Your IF statement (if (x = 3:6)) does not work as you probably expect it since it does not test for the range. You probably want to use cut to convert a value to a bucket in a range: x - 3.5 cut(x, breaks=seq(-3,5,.2), labels=FALSE) [1] 33 seq(-3,5,.2) [1] -3.0 -2.8 -2.6 -2.4 -2.2 -2.0 -1.8

Re: [R] combning rows

2008-09-04 Thread jim holtman
Read your data in, parse off the ID, split the records (using 'split') and then combine the like values. Since you did not read the posting guide, it is hard to give explicit help. On Thu, Sep 4, 2008 at 1:42 PM, kayj [EMAIL PROTECTED] wrote: I do have a txt file where each row is a record

[R] Possible R graphics devices

2008-09-04 Thread Jeffrey Horner
Hello all, I've been working on a new R Graphics device that targets Adobe's Shockwave Flash format (SWF for short). It uses http://www.libming.org/ on the backend. Here are some example outputs so far: http://160.129.129.41/~hornerj/plots/ Once you click on the above, choose a directory

[R] Plotting the complex fft in 3D?

2008-09-04 Thread Oliver Bandel
Hello, I'm new to R (using it since about two weeks), but absolutely a fan of it from the beginning on. :-) Best tool for working with data I found. :-) I tried using the fft() and other funcitons for analysing time series. What I would be glad to have, would be a convenient way to display

Re: [R] [R-SIG-Mac] Error with update.packages()

2008-09-04 Thread Prof Brian Ripley
Try another mirror: this is not the first time we've seen problems at www.ibiblio.org. On Thu, 4 Sep 2008, Brant Inman wrote: R-helpers: I just updated from R 7.0 to R 7.2.2 today. I am using MAC OS X version 10.5.4 on a Macbook to run R. sessionInfo() R

Re: [R] (with subject)

2008-09-04 Thread Dr Eberhard W Lisse
Dirk, Gabor, thanks for your advice, I have now tried to study these vignettes, but I must say, as an aging Gynecologist, I am facing an enormous learning curve :-)-O. This works nicely: rawData - data.frame(x = c(2008-03-01, 2008-03-21, 2008-03-23, 2008-04-08, 2008-04-20, 2008-05-10,

Re: [R] Plotting the complex fft in 3D?

2008-09-04 Thread Duncan Murdoch
Oliver Bandel wrote: Hello, I'm new to R (using it since about two weeks), but absolutely a fan of it from the beginning on. :-) Best tool for working with data I found. :-) I tried using the fft() and other funcitons for analysing time series. What I would be glad to have, would be a

Re: [R] Plotting using 'if' statements

2008-09-04 Thread Steve Murray
Thanks again Henrique - that's really useful to know! _ Discover Bird's Eye View now with Multimap from Live Search __ R-help@r-project.org mailing list

[R] adding NA to subset

2008-09-04 Thread Sherri Heck
Hi All- I have a data set (spdco2) spdco2 [,1] [,2] [,3] [1,]1 5.4 382.4212 [2,]2 5.1 383.0315 [3,]3 4.8 383.9520 [4,]4 4.7 384.4376 [5,]5 4.7 384.5929 [6,]6 4.4 384.8864 [7,]7 4.1 385.2156 [8,]8 3.8 385.2919 [9,]9 3.7 385.5925 [10,] 10

Re: [R] [R-SIG-Mac] Error with update.packages()

2008-09-04 Thread Brant Inman
Thank you for your suggestion. I did as you suggested and switched from USA (NC) to USA (IA). Again, the packages seemed to download OK but this time a single error message appeared: -- ...snip... == downloaded 168 Kb trying URL

Re: [R] adding NA to subset

2008-09-04 Thread Jorge Ivan Velez
Dear Sherri, Perhaps: spdco2=matrix(scan(),ncol=3,byrow=TRUE) 1 5.4 382.4212 2 5.1 383.0315 3 4.8 383.9520 4 4.7 384.4376 5 4.7 384.5929 6 4.4 384.8864 7 4.1 385.2156 8 3.8 385.2919 9 3.7 385.5925 10 3.9 385.6801 spdco2[,2]-ifelse(spdco2[,2]=4.7,spdco2[,2],NA) spdco2

Re: [R] adding NA to subset

2008-09-04 Thread Duncan Murdoch
Sherri Heck wrote: Hi All- I have a data set (spdco2) spdco2 [,1] [,2] [,3] [1,]1 5.4 382.4212 [2,]2 5.1 383.0315 [3,]3 4.8 383.9520 [4,]4 4.7 384.4376 [5,]5 4.7 384.5929 [6,]6 4.4 384.8864 [7,]7 4.1 385.2156 [8,]8 3.8 385.2919 [9,]

Re: [R] adding NA to subset

2008-09-04 Thread Henrique Dallazuanna
Try this: is.na(spdco2[,2]) - which(spdco2[,2] 4.7) spdco2 On Thu, Sep 4, 2008 at 4:21 PM, Sherri Heck [EMAIL PROTECTED] wrote: Hi All- I have a data set (spdco2) spdco2 [,1] [,2] [,3] [1,]1 5.4 382.4212 [2,]2 5.1 383.0315 [3,]3 4.8 383.9520 [4,]4 4.7

Re: [R] adding NA to subset

2008-09-04 Thread Sherri Heck
Fantastic! Each suggestion worked beautifully. Thanks so much. Henrique Dallazuanna wrote: Try this: is.na http://is.na(spdco2[,2]) - which(spdco2[,2] 4.7) spdco2 On Thu, Sep 4, 2008 at 4:21 PM, Sherri Heck [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi All- I have a

Re: [R] (with subject)

2008-09-04 Thread Felipe Carrillo
Is this what you want? library(ggplot2) rawData - data.frame(Date = c(2008-03-01, 2008-03-21, 2008-03-23, 2008-04-08, 2008-04-20, 2008-05-10, 2008-06-20), y = c(4, 6,8, 5, 7, 2 ,1)) rawData$Date - as.Date(rawData$Date)

[R] showing the image

2008-09-04 Thread rostam shahname
Hi everyone, I have a matrix containing color values of an image same as following, [1,] #44 #44 #434343 #404040 #3D3D3D #3D3D3D #3E3E3E [2,] #414141 #414141 #414141 #404040 #3F3F3F #3F3F3F #3F3F3F [3,] #3E3E3E #3E3E3E #3F3F3F #404040 #404040 #404040 #404040 [4,] #3E3E3E #3D3D3D #3E3E3E

Re: [R] Possible R graphics devices

2008-09-04 Thread stephen sefick
I think being able to say lable your points with a third column of data would be cool (which I am sure is already do-able), and also to be able to hover over a point and find out the value. On a huge wishlist that I don't have a clue how to implement- a zoom window function close to kaliedagraphs

Re: [R] Plotting the complex fft in 3D?

2008-09-04 Thread Oliver Bandel
Zitat von Duncan Murdoch [EMAIL PROTECTED]: Oliver Bandel wrote: Hello, I'm new to R (using it since about two weeks), but absolutely a fan of it from the beginning on. :-) Best tool for working with data I found. :-) I tried using the fft() and other funcitons for analysing

[R] isoMDS and dist

2008-09-04 Thread Carolyn A. Pucko
I am starting with a matrix in which rows are vegetation plots and columns are various characteristics including ID# and elevation. I removed elevation and ID columns to avoid having those characteristics influence the distances between points which I calculated using the dist command.

[R] using complete.cases() with nested factors

2008-09-04 Thread Andrew Barr
Hello, This maybe a newbie question. I have a dataframe that looks like the sample at the bottom of the email. I have monthly precipitation data from several sites over several years. For each site, I need to extract years that have a complete series of 12 monthly precipitation values, while

Re: [R] Plotting the complex fft in 3D?

2008-09-04 Thread Duncan Murdoch
On 04/09/2008 4:44 PM, Oliver Bandel wrote: Zitat von Duncan Murdoch [EMAIL PROTECTED]: Oliver Bandel wrote: Hello, I'm new to R (using it since about two weeks), but absolutely a fan of it from the beginning on. :-) Best tool for working with data I found. :-) I tried using the fft() and

[R] Building a time series.

2008-09-04 Thread rkevinburton
I have a need to build a time series and there are a couple of aspects about the time series object that are confusing me. First it seems that ts.union is not doing what I would expect. For example: x0 - rep(0,10) x1 - rep(1,10) xt0 - ts(x0, frequency=10) xt1 - ts(x1, frequency=10) st2 -

Re: [R] using complete.cases() with nested factors

2008-09-04 Thread Ken Knoblauch
Andrew Barr wabarr at gmail.com writes: This maybe a newbie question. I have a dataframe that looks like the sample at the bottom of the email. I have monthly precipitation data from several sites over several years. For each site, I need to extract years that have a complete series of

Re: [R] showing the image

2008-09-04 Thread Greg Snow
Here is one approach: tmp - scan(what='') 1: #44 #44 #434343 #404040 #3D3D3D #3D3D3D #3E3E3E 8: #414141 #414141 #414141 #404040 #3F3F3F #3F3F3F #3F3F3F 15: #3E3E3E #3E3E3E #3F3F3F #404040 #404040 #404040 #404040 22: #3E3E3E #3D3D3D #3E3E3E #404040 #414141 #414141 #404040 29: #3E3E3E

Re: [R] Plotting the complex fft in 3D?

2008-09-04 Thread Oliver Bandel
Zitat von Duncan Murdoch [EMAIL PROTECTED]: On 04/09/2008 4:44 PM, Oliver Bandel wrote: Zitat von Duncan Murdoch [EMAIL PROTECTED]: Oliver Bandel wrote: Hello, [...] plot3d doesn't support that directly, but you could plot with type='n', then use segments3d to add the lines.

Re: [R] Building a time series.

2008-09-04 Thread Achim Zeileis
On Thu, 4 Sep 2008, [EMAIL PROTECTED] wrote: I have a need to build a time series and there are a couple of aspects about the time series object that are confusing me. First it seems that ts.union is not doing what I would expect. For example: x0 - rep(0,10) x1 - rep(1,10) xt0 - ts(x0,

  1   2   >