[R] How to set directory Rscript runs in/Sweave output directory

2008-07-28 Thread Paul.Rustomji
Hello I am using Sweave to generate some pdf reports using R on a Windows platform and would like to control the output directory that the generated .tex file goes to. Basically I use the following commands in a batch file: set outdir=c:/output/1234 Rscript -e

Re: [R] graphing regression coefficients and standard errors

2008-07-28 Thread Mark Difford
Hi Murali, I am interested in plotting my regression analysis results(regression coefficients and standard errors obtained through OLS and Tobit models) in the form of graphs. plot(obj$lm) will give you a set of diagnostic plots. What you seem to be after is ?termplot. Also look at John

Re: [R] Transfer Function Modeling

2008-07-28 Thread Felix Andrews
Package dynlm allows easy specification of linear models (using lm as usual) involving time lags and differences. I can't say much more without knowing details of your model. -Felix On Sun, Jul 27, 2008 at 2:39 PM, Ashish Kumar [EMAIL PROTECTED] wrote: Hi, I would like to know how to build

Re: [R] Color of box frame in Legend (Was: Matrix barplot)

2008-07-28 Thread Andreas Tille
On Sun, 27 Jul 2008, S Ellison wrote: Looking at the legend() source the filled box line colour is hardcoded : if (mfill) { if (plot) { fill - rep(fill, length.out = n.leg) rect2(left = xt, top = yt + ybox/2, dx = xbox, dy = ybox, col = fill,

Re: [R] Help with a loop

2008-07-28 Thread Patrick Burns
You are right to be dissatisfied with your code. I suspect you will get more response if you say what the code is supposed to do, and give a smaller example of what the answer should be. Patrick Burns [EMAIL PROTECTED] +44 (0)20 8525 0696 http://www.burns-stat.com (home of S Poetry and A Guide

[R] I can not see help.start() in Ubuntu.

2008-07-28 Thread xiaopeng hu
How to conquer this? Thanks [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide

Re: [R] Converting english words to numeric equivalents

2008-07-28 Thread Barry Rowlingson
2008/7/28 Rolf Turner [EMAIL PROTECTED]: On 28/07/2008, at 12:32 PM, oscar Linares wrote: Hello, I am trying to convert english words to numeric equivalents, e.g., abc to 123. Is there a function or library or package for doing this in R? If not, can it be done easily in R? Your question

Re: [R] Percentile Estimation From Kernel Density Estimate

2008-07-28 Thread Karl Ove Hufthammer
[EMAIL PROTECTED]: Has anyone developed a defensible method of estimating percentiles from a univariate kernel density estimate?  I am working on a problem in which the density estimate is of interest, but I would also like to estimate the value of the variable for which the distribution was,

Re: [R] Converting english words to numeric equivalents

2008-07-28 Thread baptiste auguie
Here is my attempt at this (taking a specific understanding of the ill- defined equivalence relation), unletter - function(word){ word.broken - strsplit(word, NULL) set.of.numbers - sapply(word.broken[[1]], function(let) which(let == letters)) paste(set.of.numbers,

Re: [R] S4 : setGeneric for classical methods

2008-07-28 Thread Martin Maechler
CG == Christophe Genolini [EMAIL PROTECTED] on Sun, 27 Jul 2008 09:27:34 +0200 writes: CG Martin Maechler [EMAIL PROTECTED] a écrit : CG == Christophe Genolini [EMAIL PROTECTED] on Sat, 26 Jul 2008 12:12:12 +0200 writes: CG Martin Maechler [EMAIL PROTECTED] a

Re: [R] Converting english words to numeric equivalents

2008-07-28 Thread Ted Harding
On 28-Jul-08 09:29:22, baptiste auguie wrote: Here is my attempt at this (taking a specific understanding of the ill- defined equivalence relation), unletter - function(word){ word.broken - strsplit(word, NULL) set.of.numbers - sapply(word.broken[[1]], function(let)

Re: [R] Converting english words to numeric equivalents

2008-07-28 Thread baptiste auguie
As you point out, my proposed function does not verify an equivalence, and it is not restricted to english words. I'm probably too keen to see questions that call for an answer with relaxed assumptions (understand, that i can manage). Cheers, baptiste On 28 Jul 2008, at 10:47,

Re: [R] Converting english words to numeric equivalents

2008-07-28 Thread Hans-Joerg Bibiko
How about this? unletter - function(word) { gsub('-64',' ',paste(sprintf(%02d,utf8ToInt(tolower(word)) - 96),collapse='')) } unletter(abc) [1] 010203 unletter(Aw) [1] 0123 unletter(I walk to school) [1] 09 23011211 2015 190308151512 --Hans __

[R] axis.break on Date-x-axis in lattice xyplot

2008-07-28 Thread Henning Wildhagen
Dear list, i am using the following code to produce  a lattice xyplot, but the axis.break-function is seemingly not executed. Date-seq(as.Date(2006-08-29), as.Date(2007-08-28), by=2 weeks) Period- var1-rnorm(27, 9000, 3000) var2-rnorm(27, 5,25000) var3-rnorm(27,

Re: [R] Converting english words to numeric equivalents

2008-07-28 Thread Hans-Joerg Bibiko
On 28 Jul 2008, at 12:23, Hans-Joerg Bibiko wrote: How about this? unletter - function(word) { gsub('-64',' ',paste(sprintf(%02d,utf8ToInt(tolower(word)) - 96),collapse='')) } unletter(abc) [1] 010203 unletter(Aw) [1] 0123 unletter(I walk to school) [1] 09 23011211 2015 190308151512 I

[R] Using stop ( ) from a Text Editor

2008-07-28 Thread Paulo Cardoso
When using stop clause with a condition, its documented that If a condition object is supplied it should be the only argument, and further arguments will be ignored, with a warning. This will not be the case when running codes from Winedit or TINN? When I do something like:

Re: [R] axis.break on Date-x-axis in lattice xyplot

2008-07-28 Thread Ben Bolker
Henning Wildhagen HWildhagen at gmx.de writes: Dear list, i am using the following code to produce  a lattice xyplot, but the axis.break-function is seemingly not executed. axis.break (from plotrix) won't work at all on lattice graphics -- you can look to see what it does and try to

Re: [R] axis.break on Date-x-axis in lattice xyplot

2008-07-28 Thread Jim Lemon
On Mon, 2008-07-28 at 12:19 +0200, Henning Wildhagen wrote: Dear list, i am using the following code to produce a lattice xyplot, but the axis.break-function is seemingly not executed. Date-seq(as.Date(2006-08-29), as.Date(2007-08-28), by=2 weeks) Period- var1-rnorm(27, 9000,

Re: [R] Using stop ( ) from a Text Editor

2008-07-28 Thread jim holtman
If you are using Tinn-R, then I am assuming that you are using the 'send selection' which basically minics the keyboard. On the keyboard, after a 'stop' you can type in the next command without any problems. Here is a script I was using with Tinn-R: x - 1 stop('error') cat('continue

Re: [R] Using stop ( ) from a Text Editor

2008-07-28 Thread Prof Brian Ripley
On Mon, 28 Jul 2008, Paulo Cardoso wrote: When using stop clause with a condition, its documented that If a condition object is supplied it should be the only argument, and further arguments will be ignored, with a warning. I see no condition object in your example. This will not be the

[R] parametric bootstrap

2008-07-28 Thread laila khalfan
Hi I am using the boot function in boot package. I am facing a problem in getting the values of bias and st.error in the output. r-36 n-40 shape-2 theta11-exp(1) # (=2.718282) theta21-exp(.5) #( =1.648721) m0- function(Ti,Tj) #a function that generates the MLestimates {

Re: [R] Using stop ( ) from a Text Editor

2008-07-28 Thread Paulo Cardoso
I see no condition object in your example Isn't if(length(content[content%in%folders])!=4) a condition? stop() breaks execution of a block of code that source()d -- maybe that is what you are looking for? Yes I don't know what you mean by 'TINN' and 'Winedit' (what exact program, how are

[R] Rv: Chi-square parameter estimation

2008-07-28 Thread Julio Rojas
Hi. I have made 100 experiments of an M/M/1 queue, and for each one I have calculated both, mean and variance of the queue size. Now, a professor has told me that variance is usually chi-squared distributed. Is there a way in R that I can find the parameter that best fits a chi-square to the

Re: [R] product of successive rows

2008-07-28 Thread jim holtman
Does this do what you want: x - matrix(1:36,6) x [,1] [,2] [,3] [,4] [,5] [,6] [1,]17 13 19 25 31 [2,]28 14 20 26 32 [3,]39 15 21 27 33 [4,]4 10 16 22 28 34 [5,]5 11 17 23 29 35 [6,]6 12 18 24 30 36

Re: [R] Color of box frame in Legend (Was: Matrix barplot)

2008-07-28 Thread Nutter, Benjamin
Try sourcing in the 'new.legend' function below. It's the legend function with a new argument called 'box.col'. The argument will change the color of the box surrounding the legend. If I understand what it is you are looking for, this should work. Also, I didn't see a way to change the axis bar

[R] speeding up loop and dealing wtih memory problems

2008-07-28 Thread Denise Xifara
Dear All and Mark, Given a dataset that I have called dat, I was hoping to speed up the following loop: for(i in 1:835353){ for(j in 1:86){ if (is.na(dat[i,j])==TRUE){dat[i,j]-0 }}} Actually I am also having a memory problem. I get the following: Error: cannot allocate vector of size 3.2 Mb

Re: [R] speeding up loop and dealing wtih memory problems

2008-07-28 Thread David Hajage
Is it what you want ? x - matrix(c(1:3, NA, NA, 4, 1:2, NA), 3, 3) x [,1] [,2] [,3] [1,]1 NA1 [2,]2 NA2 [3,]34 NA x[is.na(x)] - 0 x [,1] [,2] [,3] [1,]101 [2,]202 [3,]340 2008/7/28 Denise Xifara [EMAIL PROTECTED]

Re: [R] speeding up loop and dealing wtih memory problems

2008-07-28 Thread ONKELINX, Thierry
Dear Denise, It looks like you want to replace all NA with 0 in the dataset? The code below should do that trick without loops. And it will be rather fast. dat[is.na(dat)] - 0 dat - matrix(rbinom(40, 1, 0.75), ncol = 4, nrow = 10) dat[dat == 0] - NA dat [,1] [,2] [,3] [,4] [1,]1

Re: [R] speeding up loop and dealing wtih memory problems

2008-07-28 Thread jim holtman
If your matrix is 835353x86, then if it is numeric, then it will take about 550MB for a single copy. You should therefore have at least 2GB (so you can have a couple of copies as part of some processing) of real memory on your system. If you want to replace NAs with zero, then this is how you

Re: [R] product of successive rows

2008-07-28 Thread Patrizio Frederic
this works too: n = 6 # number of rows m = 4 # number of coloumns nm = n*m mat = matrix(1:nm,n) # your matrix pf = function(Col){ ind = rep(1:(n/2),each=2) out = tapply(Col,ind,prod) out } # pf performs forall vecotr x: x[i]*x[i-1],

Re: [R] speeding up loop and dealing wtih memory problems

2008-07-28 Thread Prof Brian Ripley
We were not told this was a matrix, rather a 'dataset'. If it is matrix, logical indexing via is.na(x) is pretty good, although it will create an index equal in size to the dataset (but logical). If 'dataset' means a data frame, you will use less memory using a for() loop over columns, e.g.

[R] RODBC to query an Oracle table

2008-07-28 Thread Megan J Bellamy
Hello all, I am having trouble running a count function in R using RODBC to query a table I created in Oracle. It may very well be that my SQL coding is incorrect; I just started learning it. But if someone could point me in the right direction or tell me if I am going about this the correct

Re: [R] writing the plots

2008-07-28 Thread stephen sefick
?pdf and copy and write whatever notes you want i a note pad On Mon, Jul 28, 2008 at 10:54 AM, Rajasekaramya [EMAIL PROTECTED]wrote: hi there, I want to write the plots in the pdfs and the details about the graph in a seperate notepad. plot(as.numeric(lapply(resultgenes,length)), main=

Re: [R] RODBC to query an Oracle table

2008-07-28 Thread Marc Schwartz
on 07/28/2008 09:44 AM Megan J Bellamy wrote: Hello all, I am having trouble running a count function in R using RODBC to query a table I created in Oracle. It may very well be that my SQL coding is incorrect; I just started learning it. But if someone could point me in the right direction or

Re: [R] how to export .xls file with colorful cells?

2008-07-28 Thread Kevin Wright
Xin Meng, Ignore all the you didn't tell us your operating system comments--I will show you a simple, although very tedious way to do what you want that is totally free of any operating system limitations. Began by formatting a very simple Excel file with colored cells, then save the file as a

[R] Help with yaImpute

2008-07-28 Thread Wesley Roberts
Dear fellow R-users I am trying to do some imputation using K-NN with the yaImpute library. All seems to be going well until I try to use AsciiGridImpute. All my data are correctly formatted and I am able to run and view the results of yai. Below is my code:

[R] Converting from char to POSIX:

2008-07-28 Thread Agustin Lobo
Given char vector delme2: str(delme2) chr [1:1065] 30-1-08 8:48:21 30-1-08 8:55:17 30-1-08 9:00:22 ... I do: delme3 - strptime(delme2,format=%d-%m-%y %H:%M:%S) But then: str(delme3) POSIXlt[1:9], format: 2008-01-30 08:48:21 2008-01-30 08:55:17 ... length(delme3) [1] 9 whie

[R] how to add notes to the graph?

2008-07-28 Thread rlearner309
Hi, I have a simple graph: x - c(1,2,3) plot(x, pch=16,type=b) I would like to add some notes just beside these 3 dots, and the notes are stored in a vector: a - c(12,54,84) So the result will be: there should be a 12 below the first dot (or next to it, but not replacing the solid dot), a

Re: [R] how to add notes to the graph?

2008-07-28 Thread Dieter Menne
rlearner309 unixunix99 at gmail.com writes: x - c(1,2,3) plot(x, pch=16,type=b) I would like to add some notes just beside these 3 dots, and the notes are stored in a vector: a - c(12,54,84) So the result will be: there should be a 12 below the first dot (or next to it, but not

[R] Bootstrapping

2008-07-28 Thread laila khalfan
HiI would like to use the parametric bootstrap confidence intervals. The problem is that I am using a step stress model based on a gamma distributed data. So, first I need to generate a spacial data and then find the MLE`s then I must find the bootstrap confidence interval.I dont know how to

Re: [R] RODBC to query an Oracle table

2008-07-28 Thread Prof Brian Ripley
It's your R syntax that is faulty: Use (not ') to delimit the R string which contains single quotes for use by SQL. On Mon, 28 Jul 2008, Megan J Bellamy wrote: Hello all, I am having trouble running a count function in R using RODBC to query a table I created in Oracle. It may very well be

Re: [R] Converting from char to POSIX:

2008-07-28 Thread Prof Brian Ripley
On Mon, 28 Jul 2008, Agustin Lobo wrote: Given char vector delme2: str(delme2) chr [1:1065] 30-1-08 8:48:21 30-1-08 8:55:17 30-1-08 9:00:22 ... I do: delme3 - strptime(delme2,format=%d-%m-%y %H:%M:%S) But then: str(delme3) POSIXlt[1:9], format: 2008-01-30 08:48:21 2008-01-30 08:55:17

Re: [R] RODBC to query an Oracle table

2008-07-28 Thread Jim Porzak
Hi Megan, Marc's hint is the R way, which is needed with your original SELECT. OTOH, it may be more efficient to move the WHERE clause into the SELECT. Something like select plotnum, sampyear, sptype from density where sampyear=1995 AND plotnum=1 AND sptype IN ('S', 'H') should work

Re: [R] Color of box frame in Legend (Was: Matrix barplot)

2008-07-28 Thread Prof Brian Ripley
The current default for the box/frame colour is not black (it is par(fg)), but otherwise I've committed something very similar to the R-devel version of R earlier today. On Mon, 28 Jul 2008, Nutter, Benjamin wrote: Try sourcing in the 'new.legend' function below. It's the legend function

[R] [R-pkgs] randomSurvivalForest 3.5.0 now available

2008-07-28 Thread Udaya B. Kogalur
Please find release 3.5.0 of the CRAN package randomSurvivalForest now posted on CRAN. Thank you. [EMAIL PROTECTED] Udaya B. Kogalur, Ph.D. Kogalur Shear Corporation 5425 Nestleway Drive, Suite L1 Clemmons, NC 27012

[R] RStem with portuguese language

2008-07-28 Thread Paulo Cortez
Greetings, I have R 2.7.1 in MacOs and I believe UTF encoding is already installed. At least: Sys.getenv() shows several variables, including: LANG pt_PT.UTF-8 I installed the Rstem and tm packages and when I try the following code: wordStem(c(aberração,aberrações), language=portuguese)

[R] multiv

2008-07-28 Thread Somesan, Ileana
Hello, I want to install the package multiv which is not maintained any more (found in the archive: multiv_1.1-6.tar.gz from 16 July 2003). I have installed an older version of R 1.4.1 on my Windows Vista in order to match the older package. As no binary is distributed, is it necessary

[R] rollapply() opertation on ts matrix

2008-07-28 Thread rcoder
Hi everyone, Is there a way to perform a rollapply operation on a time series data matrix and preserve the time frame? Currently, when I apply rollapply in its standart form, the date column is no longer present in the o/p matrix. Thanks, rcoder -- View this message in context:

Re: [R] in axis() suppressing axis line but keeping tick marks

2008-07-28 Thread Prof Brian Ripley
I'm pretty sure that this is not Paul's design and he usually doesn't want to touch base graphics. I've added arguments lwd.ticks and col.ticks in R-devel. The simplest way to suppress the axis line become axis(..., lwd=0, lwd.ticks=1). On Mon, 16 Jun 2008, Peter Dalgaard wrote: Andrew

[R] Overlay of simple plots

2008-07-28 Thread Phillip R. Hunt
I am trying to create a graph that puts three x-y plots (age vs rate for three categories ) on a single plot. SAS does this with the overlay function. I cannot find in the R documentation a method for doing this. Any help would be appreciated. Thanks, Phill Phillip R. Hunt, Sc.D. 24

[R] Question about the SSOAP package

2008-07-28 Thread Aiste Aistike
Hello, I need to retrieve data from the internet to R using SOAP protocol. I found that SSOAP package (http://www.omegahat.org/SSOAP/) should do the work. However, I cannot install it properly. It just does not work. I am using R 2.7.1 (this was the only version on which other required packages

[R] Case statements in R

2008-07-28 Thread Wade Wall
Hi all, I am trying to convert geometric means in a matrix to cover classes. My values are as such: perc-c(0,0.025136418, 0.316227766, 1.414213562,3.16227766, 7.071067812, 15.8113883, 35.35533906, 61.23724357, 84.40971508, 97.46794345) cover-c(0,1,2,3,4,5,6,7,8,9,10) This is what I am trying

Re: [R] Case statements in R

2008-07-28 Thread Roland Rau
Hi, maybe the following code helps to achieve what you want? It seems to me it is basically a 'recode' question. set.seed(1234) # not neccessary but this ensures we have the same #results random.values - runif(n=30, min=0, max=100) newgrouping - cut(x=random.values, breaks=c(0,0.1, 1, 2, 5, 10,

Re: [R] Using PrettyR to produce LaTeX output

2008-07-28 Thread jcarmichael
This is EXACTLY what I needed. I suppose the only issue was that I needed to isolate the numeric output of PrettyR::describe. Thanks very much! Gabor Grothendieck wrote: Using the built in BOD data frame: library(prettyR) str(describe(BOD)) # note Numeric component BOD.describe.df

Re: [R] Using PrettyR to produce LaTeX output

2008-07-28 Thread jcarmichael
Thank you all for your input! I was able to create my descriptive table as well as a few other things I was having trouble with. Thanks again! J. jcarmichael wrote: Hello everyone. I am new to R, so please bear with me. I am trying to find an easy way to export descriptive statistics

Re: [R] RStem with portuguese language

2008-07-28 Thread Duncan Temple Lang
Hi Paulo. My development version has that warning turned off. However, the Rstem package predates the encoding in R, AFAIR. So when I call wordStem() with a string which has an Encoding() of UTF-8, the resulting string has Encoding() unknown. I'll take a look and add see if I can add support

Re: [R] Overlay of simple plots

2008-07-28 Thread stephen sefick
?lines On Mon, Jul 28, 2008 at 12:57 PM, Phillip R. Hunt [EMAIL PROTECTED]wrote: I am trying to create a graph that puts three x-y plots (age vs rate for three categories ) on a single plot. SAS does this with the overlay function. I cannot find in the R documentation a method for doing

Re: [R] Case statements in R

2008-07-28 Thread Stefan Evert
And you may want to consider using the 'cut' function. In your case, something like veg_mean - cut(veg_mean, breaks=c(0,.1,1,2,5,10,25,50,75,95,100), right=FALSE) should do the trick (see ?cut for more options). Best, Stefan On 28 Jul 2008, at 19:52, Henrik Bengtsson wrote: Use ''

Re: [R] Help with a loop

2008-07-28 Thread Sofia Martinez
HI the code is suppose to generate a random value selected uniformly as a time interval in seconds (that's the dT) from the range given fromdtmin-969 dtmax-9884. Once that value is selected the program will generate the interval (ts1, ts2, and so on. for each sampling without getting out of

Re: [R] Case statements in R

2008-07-28 Thread Ted Harding
On 28-Jul-08 17:52:31, Henrik Bengtsson wrote: Use '' for vectors and '' for scalars. Ditto applies to the OR operator(s). /Henrik What's wrong with using for scalars? Surely it gives the correct answer? Maybe it's simply a bit slower, or something? Ted. On Mon, Jul 28, 2008 at 10:36 AM,

[R] Negative Binomial Regression

2008-07-28 Thread jcarmichael
Hello. I am attempting to duplicate a negative binomial regression in R. SAS uses generalized estimating equations for model fitting in the GENMOD procedure. proc genmod data=mydata (where=(gender='F')); by agegroup; class id gender type; model count = var1 var2 var3 /dist=NB link=log

[R] Legality Question about R's Open Source GNU GPL License

2008-07-28 Thread zerfetzen
Hi, I use R at home, and am interested in using it at my work company (which is in the Fortune 100). I began the request, and our legal team has given some gruff about the open source license. Not boring you with the details here, but I used some info on gnu.org as a rebuttal, and someone at

Re: [R] Case statements in R

2008-07-28 Thread David Katz
See ?cut for creating a factor based on ranges of values. Regards, Wade Wall wrote: Hi all, I am trying to convert geometric means in a matrix to cover classes. My values are as such: perc-c(0,0.025136418, 0.316227766, 1.414213562,3.16227766, 7.071067812, 15.8113883, 35.35533906,

[R] Fill in NA values in vector with previous character/factor

2008-07-28 Thread Owen Jones
I have a vector of data (species names) interspersed with NA values and I want a function to fill in the blanks, replacing NA values with whatever the last species name was. For example the vector: A,B,NA,NA,C,NA,NA,NA,NA,D,NA,NA. should evaluate to: A B B B C C C C C D D D I tried to

[R] Is there way to multiple plots on gap.plot?

2008-07-28 Thread Arthur Roberts
Hi, all, Does anyone now of a way to put multiple plots on gap.plot? Much appreciated, Art __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html

Re: [R] Case statements in R

2008-07-28 Thread Henrik Bengtsson
Hi. On Mon, Jul 28, 2008 at 11:21 AM, Ted Harding [EMAIL PROTECTED] wrote: On 28-Jul-08 17:52:31, Henrik Bengtsson wrote: Use '' for vectors and '' for scalars. Ditto applies to the OR operator(s). /Henrik What's wrong with using for scalars? Surely it gives the correct answer? Maybe

Re: [R] Legality Question about R's Open Source GNU GPL License

2008-07-28 Thread Jim Porzak
All this is included in the distribution in doc folder: 1. see FAQ: 2.11 Can I use R for commercial purposes? 2. Specific GNU License is in file COPYING HTH, Jim Porzak Responsys, Inc. San Francisco, CA http://www.linkedin.com/in/jimporzak On Mon, Jul 28, 2008 at 11:32 AM, zerfetzen [EMAIL

Re: [R] Legality Question about R's Open Source GNU GPL License

2008-07-28 Thread Patrick Burns
I'll leave it to someone else to answer the question that you asked, but I don't mind answering the question that you didn't ask: Are there alternatives ways of getting R into the company? Yes. There are now some commercially supported versions of R -- see 'What is R-plus?' in the R-FAQ for a

Re: [R] Fill in NA values in vector with previous character/factor

2008-07-28 Thread Gabor Grothendieck
Try this: library(zoo) x - c(A,B,NA,NA,C,NA,NA,NA,NA,D,NA,NA) na.locf(x) On Mon, Jul 28, 2008 at 2:10 PM, Owen Jones [EMAIL PROTECTED] wrote: I have a vector of data (species names) interspersed with NA values and I want a function to fill in the blanks, replacing NA values with whatever

Re: [R] Fill in NA values in vector with previous character/factor

2008-07-28 Thread Dimitris Rizopoulos
try function na.locf() from package 'zoo', i.e., library(zoo) x - c(A,B,NA,NA,C,NA,NA,NA,NA,D,NA,NA) na.locf(x) I hope it helps. Best, Dimitris Dimitris Rizopoulos Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium

Re: [R] Legality Question about R's Open Source GNU GPL License

2008-07-28 Thread Duncan Murdoch
On 7/28/2008 2:32 PM, zerfetzen wrote: Hi, I use R at home, and am interested in using it at my work company (which is in the Fortune 100). I began the request, and our legal team has given some gruff about the open source license. Not boring you with the details here, but I used some info on

Re: [R] Is there way to multiple plots on gap.plot?

2008-07-28 Thread Yasir Kaheil
yeah, just use points twogrp-c(rnorm(5)+4,rnorm(5)+20,rnorm(5)+5,rnorm(5)+22) gpcol-c(2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5) gap.plot(twogrp,gap=c(8,12),xlab=Index,ylab=Group values, main=Plot gap on Y axis,col=gpcol) twogrp2-c(rnorm(5)+4,rnorm(5)+20,rnorm(5)+5,rnorm(5)+22) points(twogrp2,

Re: [R] Fill in NA values in vector with previous character/factor

2008-07-28 Thread Yasir Kaheil
maybe this is easiest way to do it: x-c(A,B,NA,NA,C,NA,NA,NA,NA,D,NA,NA); x[is.na(x)]- D; x thanks y Owen Jones-3 wrote: I have a vector of data (species names) interspersed with NA values and I want a function to fill in the blanks, replacing NA values with whatever the last

[R] How to unsubscribe?

2008-07-28 Thread Endre Domiczi
Hello, I am going to be on vacation and would like to temporary unsubscribe from the list. Sending unsubscribe didn't help. Could you please guide me on the appropriate step? Thanks a lot in advance! Best regards, Endre -- Endre Domiczi, CEO Sevana Oy, http://www.sevana.fi Email : [EMAIL

Re: [R] Legality Question about R's Open Source GNU GPL License

2008-07-28 Thread Roland Rau
Jim Porzak wrote: All this is included in the distribution in doc folder: 1. see FAQ: 2.11 Can I use R for commercial purposes? 2. Specific GNU License is in file COPYING Furthermore, the start-up message of R can (hopefully) help you in your case. It mentions to type in license() or

Re: [R] Legality Question about R's Open Source GNU GPL License

2008-07-28 Thread Marc Schwartz
on 07/28/2008 01:32 PM zerfetzen wrote: Hi, I use R at home, and am interested in using it at my work company (which is in the Fortune 100). I began the request, and our legal team has given some gruff about the open source license. Not boring you with the details here, but I used some info on

Re: [R] Case statements in R

2008-07-28 Thread Patrick Burns
(Ted Harding) wrote: On 28-Jul-08 17:52:31, Henrik Bengtsson wrote: Use '' for vectors and '' for scalars. Ditto applies to the OR operator(s). /Henrik What's wrong with using for scalars? Surely it gives the correct answer? Maybe it's simply a bit slower, or something? A

Re: [R] How to unsubscribe?

2008-07-28 Thread Marc Schwartz
on 07/28/2008 02:36 PM Endre Domiczi wrote: Hello, I am going to be on vacation and would like to temporary unsubscribe from the list. Sending unsubscribe didn't help. Could you please guide me on the appropriate step? Thanks a lot in advance! Best regards, Endre Go here:

Re: [R] Fill in NA values in vector with previous character/factor

2008-07-28 Thread Bert Gunter
Just for the record, a less efficient but certainly simple and maybe adequate way for you to do it in standard R (no zoo package required) is: for(i in seq_along(x)[-1])if(is.na(x[i])) x[i] - x[i-1] I tried timing it on my not so fancy Windows desktop for a vector of 10,000 values, but it was

Re: [R] Legality Question about R's Open Source GNU GPL License

2008-07-28 Thread zerfetzen
Thanks to each of you for your excellent input. I have copied the file and will read it tonight. I haven't run into any heat from IT, but if I do, it will be in the near future. The exact legal issue was touched upon. There was a concern that anything associated with R (my code, etc.) would

[R] loop does not work

2008-07-28 Thread aude Valade
Hi, I am new to R and am trying to do a loop but it seems not to run after one turn. What I want to do is subset my dataframe (extract one station and one day) to calculate and store the maxima that can then be plotted. I have an error message at the end of each loop: Error: unexpected '}' in }

Re: [R] loop does not work

2008-07-28 Thread Sarah Goslee
You are missing a right paren in this line: while (jlength(days) { A text editor that does syntax highlighting is a great deal of help for these sorts of things. Sarah -- Sarah Goslee http://www.functionaldiversity.org __

Re: [R] Fill in NA values in vector with previous character/factor

2008-07-28 Thread Christos Hatzis
Just for the fun of it, here is a recursive solution to the same problem... rna - function(z) { y - c(NA, head(z, -1)) z - ifelse(is.na(z), y, z) if (any(is.na(z))) Recall(z) else z } x [1] A B NA NA C NA NA NA NA D NA NA rna(x) [1] A B B B C C C C C D D D

Re: [R] multiv

2008-07-28 Thread Mark Difford
Hi Ileana, See this thread: http://www.nabble.com/R-package-install-td18636993.html HTH, Mark. Somesan, Ileana wrote: Hello, I want to install the package multiv which is not maintained any more (found in the archive: multiv_1.1-6.tar.gz from 16 July 2003). I have installed an older

[R] [--OT] was: Re: Legality Question about R's Open Source GNU GPL License

2008-07-28 Thread Ted Harding
This all got very serious, though I've read it with interest. Zerfetzen's original post reminded me of something which happened around the time Y2K was becoming an issue, bringing up a similar issue from 2000 years earlier. Admin etc. does not change over time ... I've copied the email exchange

Re: [R] RODBC to query an Oracle table

2008-07-28 Thread David Scott
On Mon, 28 Jul 2008, Megan J Bellamy wrote: Hello all, I am having trouble running a count function in R using RODBC to query a table I created in Oracle. It may very well be that my SQL coding is incorrect; I just started learning it. But if someone could point me in the right direction or

Re: [R] Link functions in SEM

2008-07-28 Thread John Fox
Dear Jeroen, It's true that the sem() function only handles quantitative endogenous variables, but you could use it along with functions in the polycor package to fit models with ordered or dichotomous observed variables. There's an example of a confirmatory factor analysis model with ordinal

Re: [R] help with durbin.watson

2008-07-28 Thread John Fox
Dear Tom, It is in principle possible for residuals to be autocorrelated even when the series for the response variable is not. Moreover, the DW test should be appropriate for the model you fit. On the other hand, a DW statistic of 0 suggests perfect positive autocorrelation, and so I would

[R] rollapply() opertation on time series

2008-07-28 Thread rcoder
rcoder wrote: Hi everyone, Is there a way to perform a rollapply operation on a time series data matrix and preserve the time frame? Currently, when I apply rollapply in its standart form, the date column is no longer present in the o/p matrix. Thanks, rcoder -- View this

Re: [R] Mixed model question.

2008-07-28 Thread Douglas Bates
On Sun, Jul 27, 2008 at 9:06 PM, Rolf Turner [EMAIL PROTECTED] wrote: I continue to struggle with mixed models. The square zero version of the problem that I am trying to deal with is as follows: A number (240) of students are measured (tested; for reading comprehension) on 6 separate

[R] Rf_error crashes entire program.

2008-07-28 Thread Andrew Redd
I'm having a problem with the error and warning functions. I've tried this on multiple machine so I'm fairly sure it's not machine dependent and I've tried it on the latest versions 2.6.0-2.7.1. Whenever my program gets to an error or warning it crashes the entire program rather than throwing

Re: [R] rollapply() opertation on time series

2008-07-28 Thread Gabor Grothendieck
rollapply along an index: library(zoo) z - zoo(matrix(101:110, 5), 201:205) tt - time(z) zz - zoo(seq_along(tt), tt) out - rollapply(zz, 3, function(ix) list(z[ix,])) str(out) # list of zoo objects On Mon, Jul 28, 2008 at 5:03 PM, rcoder [EMAIL PROTECTED] wrote: rcoder wrote: Hi everyone,

Re: [R] Rf_error crashes entire program.

2008-07-28 Thread Duncan Murdoch
On 28/07/2008 6:41 PM, Andrew Redd wrote: I'm having a problem with the error and warning functions. I've tried this on multiple machine so I'm fairly sure it's not machine dependent and I've tried it on the latest versions 2.6.0-2.7.1. Whenever my program gets to an error or warning it

Re: [R] rollapply() opertation on time series

2008-07-28 Thread Gabor Grothendieck
And then lapply over out. On Mon, Jul 28, 2008 at 6:41 PM, Gabor Grothendieck [EMAIL PROTECTED] wrote: rollapply along an index: library(zoo) z - zoo(matrix(101:110, 5), 201:205) tt - time(z) zz - zoo(seq_along(tt), tt) out - rollapply(zz, 3, function(ix) list(z[ix,])) str(out) # list of

Re: [R] Mixed model question.

2008-07-28 Thread Rolf Turner
Thanks for the response. I ***think*** I'm making a bit of progress On 29/07/2008, at 10:14 AM, Douglas Bates wrote: On Sun, Jul 27, 2008 at 9:06 PM, Rolf Turner [EMAIL PROTECTED] wrote: snip What I *don't* understand is the correlation structure of the estimates

Re: [R] Is there a way to avoid loading dependendent packages?

2008-07-28 Thread Duncan Murdoch
On 28/07/2008 6:42 PM, [EMAIL PROTECTED] wrote: Hello R help list I have been using the smoothScatter function within the geneplotter package to make some graphs using a Sweave Rnw script called via Rscript in a DOS/Windows batch file. The Rscript will ultimately be called by a web service

Re: [R] Is there a way to avoid loading dependendent packages?

2008-07-28 Thread Henrik Bengtsson
On Mon, Jul 28, 2008 at 4:29 PM, Duncan Murdoch [EMAIL PROTECTED] wrote: On 28/07/2008 6:42 PM, [EMAIL PROTECTED] wrote: Hello R help list I have been using the smoothScatter function within the geneplotter package to make some graphs using a Sweave Rnw script called via Rscript in a

Re: [R] 64-bit R on Mac OS X 10.5.4

2008-07-28 Thread joseph
Hi Matt Installation of Bioconductor packages works fine with biocLite. When I tried to install an R package, RMySQL, I got an error related to tcltk: options(pkgType=source) install.packages(pkgs =RMySQL,type =source, lib =/Library/Frameworks/R.framework/Versions/2.8/Resources/RLib64)

[R] wave model semivariogram

2008-07-28 Thread Alessandro
Hey All, I have a question about Wave model in R. I have a wave model shape, but I don't know the code in R to fit my semivariogram with wave model. Thanks alessandro [[alternative HTML version deleted]] __ R-help@r-project.org

Re: [R] Rf_error crashes entire program.

2008-07-28 Thread Andrew Redd
Switching all of my printfs to Rprintf fixed the problem the errors now proceed correctly. I was unable to reproduce the error, but now that is irrelevant, at least to me. Thanks for the help. -Andrew [[alternative HTML version deleted]] __

  1   2   >