Re: [R] error while using shapiro.test()

2011-09-30 Thread R. Michael Weylandt
Mr McHaggis, I'm not sure what " i'm having issues when it comes to reading my data in rows rather than columns " means, but here's some thoughts on your problem: ExData <- structure(list(Noun = c(21L, 26L, 31L, 37L, 22L, 12L, 22L, 12L, 27L, 20L, 21L, 29L, 16L, 23L, 29L, 33L, 29L, 24L, 28L, 32L,

Re: [R] Returning vector of values shared across 3 vectors?

2011-09-30 Thread R. Michael Weylandt
Try this: shared <- vec3[ (vec3 %in% vec1) & (vec3 %in% vec2)] Michael On Sat, Oct 1, 2011 at 2:00 AM, Chris Conner wrote: > Help-Rs, > > I've got three vectors representing participants: > > vec1 <- > c(4,5,6,7,8,9,10,11,12,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,

Re: [R] Entering data into a multi-way array?

2011-09-30 Thread R. Michael Weylandt
You might want to describe how your data is kept now so we can help with the loading process, but in general, 4D arrays are loaded with the same basic principles as 2D arrays (matrices). If you are new to this kind of work in R, it sounds like you might want to check out the Bioconductor lists for

[R] Returning vector of values shared across 3 vectors?

2011-09-30 Thread Chris Conner
Help-Rs,   I've got three vectors representing participants:   vec1 <- c(4,5,6,7,8,9,10,11,12,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81) vec2 <- c (1,2,3,4,5,6,7,8,9,10,11,12,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60

[R] Help with cast/reshape

2011-09-30 Thread Dana Sevak
I realize that this is terribly basic, but I just don't seem to see it at this moment, so I would very much appreciate your help. How shall I transform this dataframe: > df1   Name Index Value 1    a 1   0.1 2    a 2   0.2 3    a 3   0.3 4    a 4   0.4 5    b 1   2.1 6    b 

[R] Entering data into a multi-way array?

2011-09-30 Thread Victoria_Stuart
Hello: I am a novice R user, but I have been working my way through the manuals / tutorials, ... I have R / Deducer up and running, and know the basics. I want to analyze a microarray (gene expression) dataset. I need to input the data into R as a multidimensional (multi-way) array, something on

[R] Is the output of survfit.coxph survival or baseline survival?

2011-09-30 Thread koshihaku
Dear all, I am confused with the output of survfit.coxph. Someone said that the survival given by summary(survfit.coxph) is the baseline survival S_0, but some said that is the survival S=S_0^exp{beta*x}. Which one is correct? By the way, if I use "newdata=" in the survfit, does that mean the su

[R] manual R en español

2011-09-30 Thread LUIS JARAMILLO
[[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 commented, minimal, self-contained, r

Re: [R] Hi

2011-09-30 Thread Francois Pepin
Hi Jiang, where did you get that definition of the Benjamini-Hochberg correction? That is simply not how it works. You can take a look at the original paper, it is available online (http://www.math.tau.ac.il/~ybenja/MyPapers/benjamini_hochberg1995.pdf). You can also look at the p.adjust functi

[R] error while using shapiro.test()

2011-09-30 Thread spicymchaggis101
hey all, I'm just getting used to R and i'm having issues when it comes to reading my data in rows rather than columns. any good advice would be much appreciated ! here is the error: > data1 <- read.table(file.choose(),header=T) > x1 <- c(data1[1,1:5]) > shapiro.test(x1) Error in sort.int(x, na.l

[R] Data simulation for ANOVA decomposition into sums of squares

2011-09-30 Thread Josh B
Dear listserv, Please consider the following dataset: x <- matrix(nrow = 8, ncol = 2) colnames(matrix) <- c("classification", "soluble_fiber") x[1:4,1] <- "bagel" x[5:8,1] <- "donut" How would I simulate a dataset for a one-way fixed-effect ANOVA (where "classification" is the treatment variabl

[R] Regarding the optimize function

2011-09-30 Thread stat999
have a piecewise function which takes a constant value for x greater than some point. It looks like this: y<-function(x,a){ if (xhttp://r.789695.n4.nabble.com/Regarding-the-optimize-function-tp3861257p3861257.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] object ".trPaths" not found

2011-09-30 Thread sakaton
I had the same problem on Windows and I was only a "regular administrator". However, going to properties of the Rprofile.site and setting the file's all privileges for regular users fixed the problem. Tinn R was able to confiure the environment permanently. -- View this message in context: http

Re: [R] Odd gridding pattern when plotting

2011-09-30 Thread Balko, Justin
Thanks, that kind of helps. However, some of my previous code uses functions like heatmap.2 which has multiple images (legend/color key) as well as the actual heatmap. Employing useRaster=TRUE here only applies to the heatmap and not the legend. Not a huge deal. Is there anyway to set an opt

Re: [R] need help with contourplot figure

2011-09-30 Thread David Winsemius
On Sep 30, 2011, at 2:10 PM, Mike Gibson wrote: I can't figure out how to add tick marks on both my X and Y axis. For example, my X axis ranges from 0 to 1 and there are both a tick mark and a number label at the X-axis values of 0.2,0.4,0.6. and 0.8. I want to add tick marks to the fi

Re: [R] coxreg vs coxph: time-dependent treatment

2011-09-30 Thread Göran Broström
2011/9/12 Göran Broström > Dear Ehsan, > > the cluster option is not implemented in 'eha', although you obviously get > no error if trying > I'll fix this. Thanks for the report. (So, use 'coxph' with cluster). > > Actually, there is nothing to fix; the cluster function works like the ident

[R] Hi

2011-09-30 Thread chunjiang he
Hi, There is a question that I am confused. I have a set of data like this: hsa-miR-205--GATA30.797882767 1.08E-13 hsa-miR-205--ITGB4 0.750217593 1.85E-11 hsa-miR-187--PGF0.797604155 3.24E-11 hsa-miR-205--SERPINB5 0.744124886 3.28E-11 hsa-miR-205--PBX1 0.734487224 7.89E-11 hsa-mi

Re: [R] Testing for arguments in a function

2011-09-30 Thread Paul Johnson
Just for the record, following Bill Dunlap's advice, I think this is the best answer to the question as originally posed is. myfun <- function(vec, i=stop("'i' must be supplied")){ vec[i] } > myfun(1:40,10) [1] 10 > myfun(1:10) Error in myfun(1:10) : 'i' must be supplied > -- Paul E. Johnson P

Re: [R] is member

2011-09-30 Thread William Dunlap
Someone already suggested that you use match(), which does what I think you want. Read its help file for details. > A <- seq(1,113,4) > match(c(9, 17, 18), A) [1] 3 5 NA Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com From: Alaios [mailto:ala...@yahoo.com] Sent: Friday, September 30, 20

Re: [R] is member

2011-09-30 Thread Alaios
Thanks a lot! This works. Now I want to do the opposite let's say that I have one sequence for example check in image http://imageshack.us/photo/my-images/4/unleduso.png/ column A (this is a seq(1,113,4) and I want when I get the number 9 to say that this is the third number in the seq (1,113,4

Re: [R] Covariance-Variance Matrix and For Loops

2011-09-30 Thread R. Michael Weylandt
I don't have access to older versions of R right now, but if you have a recent install you are probably running 2.13.1 or 2.13.0. Can you run the following: X <- list(a= rnorm(5), b= rnorm(5)) sapply(X, min) ? sapply calls simplify2array() so if this works take a look at the code for sapply (j

Re: [R] isotope superscripts ggplot2

2011-09-30 Thread Brian Diggs
On 9/30/2011 8:31 AM, Durant, James T. (ATSDR/DTEM/PRMSB) wrote: Happy Friday fellow R users. I need some help - I am trying to make a graph using ggplot 2 of some lead isotope ratios. Normally, the isotope mass number appears as a superscript before the chemical symbol. However, I cannot fig

Re: [R] How to use a function inside a regression formula

2011-09-30 Thread Duncan Murdoch
On 30/09/2011 2:07 PM, Jim Cheng wrote: Hi, How do I use a function inside a regression formula? When I tried to use min() function inside a regression formula, I ran into errors. Here are the commands to reproduce the error: mydata<- read.csv(url("http://www.ats.ucla.edu/stat/r/dae/binary.

[R] need help with contourplot figure

2011-09-30 Thread Mike Gibson
I can't figure out how to add tick marks on both my X and Y axis. For example, my X axis ranges from 0 to 1 and there are both a tick mark and a number label at the X-axis values of 0.2,0.4,0.6. and 0.8. I want to add tick marks to the figure at every 0.1 value. This will help a viewer deter

[R] POT package return levels

2011-09-30 Thread nhomeier
This may be a simple misunderstanding on my part, but I need help understanding what POT is plotting. I'm trying to analyze a few different datasets. If my dataset covers 500 years, but I have 60 points above my threshold, what should be plotted as the (empirical) return period for the largest valu

Re: [R] Covariance-Variance Matrix and For Loops

2011-09-30 Thread sf1979
Thank you Michael. I think my initial problem may have been due to a 'clerical error' upriver, so I appreciate you taking the time to give me this help. Unfortunately, my version of R does not contain simplify2array() and does not find it in help (?simplify2array) - which is strange because I jus

[R] How to use a function inside a regression formula

2011-09-30 Thread Jim Cheng
Hi, How do I use a function inside a regression formula? When I tried to use min() function inside a regression formula, I ran into errors. Here are the commands to reproduce the error: mydata <- read.csv(url("http://www.ats.ucla.edu/stat/r/dae/binary.csv";)) attach(mydata) names(mydata) m

Re: [R] trouble in installing package "matching".

2011-09-30 Thread Brian Diggs
On 9/29/2011 8:14 PM, Jp zhu wrote: I am a new R user. I trying to install a package all Matching but failed. Here is the error msg. install.packages("Matching", dependencies=TRUE) Installing package(s) into ‘C:/Users/jzhu/Documents/R/win-library/2.13’ (as ‘lib’ is unspecified) --- Please selec

Re: [R] Odd gridding pattern when plotting

2011-09-30 Thread David L Carlson
>From ?image " Images for large z on a regular grid are more efficient with useRaster enabled and can prevent rare anti-aliasing artifacts, but may not be supported by all graphics devices. " Adding useRaster=TRUE to the two image() calls gets rid of the white grid lines. -Original Message--

Re: [R] need help on forest plot with ggplot

2011-09-30 Thread Brian Diggs
On 9/29/2011 8:11 PM, wirichada wrote: Dear R users, I am trying to do the forest plot follow the function given on web. However, the order of the tests has been sorted alphabetically. I would prefer keeping the order as data frame input so that I can group and compare (from the graph) the targe

Re: [R] isotope superscripts ggplot2

2011-09-30 Thread Barry Rowlingson
On Fri, Sep 30, 2011 at 4:31 PM, Durant, James T. (ATSDR/DTEM/PRMSB) wrote: > Happy Friday fellow R users. > > I need some help - I am trying to make a graph using ggplot 2 of some lead > isotope ratios. Normally, the isotope mass number appears as a  superscript > before the chemical symbol. Ho

Re: [R] efficient coding with foreach and bigmemory

2011-09-30 Thread Jay Emerson
First, we strongly recommend 64-bit R. Otherwise, you may not be able to scale up as far as you would like. Second, as I think you realize, with big objects you may have to do things in chunks. I generally recommend working a column at a time rather than in blocks of rows if possible (better per

Re: [R] is member

2011-09-30 Thread William Dunlap
is.element(myvector, seq(1,800,4)) or, if you like typing percent signs, myvector %in% seq(1,800,4) Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Alaios > Sent: Fr

Re: [R] Interaction plot type=o

2011-09-30 Thread David Winsemius
On Sep 30, 2011, at 2:16 AM, Petr PIKAL wrote: David, thank you for your reply I tried this attach(mtcars) interaction.plot(cyl, gear, mpg, type="o", pch=5:8, lty=1 ) but I got this error: Error in match.arg(type) : 'arg' should be one of "l", "p", "b" and in ?interaction.plot, "o" it is no

[R] ggplot2 - extracting values of smooth

2011-09-30 Thread dM/
Suppose that I'm working on Hadley's diamond dataset and I want to review the relationship between price, colour and carat. I might run the following: library(ggplot2) #plot scatter and add some hex binning q<-qplot(carat,price,data=diamonds, geom=c("hex"), main="Variability of

[R] Odd gridding pattern when plotting

2011-09-30 Thread Balko, Justin
Hi, I'm no longer on the subscribing list, but was hoping to get my question posted.  Please inform if this is ok, although I am guessing you wont post with the image below.  If so, let me know and I will resend without the image. Thanks Hi, I just upgraded my system and my version of R all a

[R] Wind roses with circular package

2011-09-30 Thread Adrienne Wootten
R-listers, My colleagues and I are working on wind roses using station information and we have a question regarding the plotting of rings of the wind rose (see attached for example). What we would like to do is to add an extra frequency ring to the wind rose, so it goes up to 15% for instance and

Re: [R] Implementing Silverman's Negative Reflection

2011-09-30 Thread sreblam
Thank you for the "obvious" help - I already saw this thread. But I thought this described the "standard" reflection method (which I managed to implement). In my case, I want to achieve a NEGATIVE reflection which is *not* the same as the method where you simply reflect the data, estimate the de

[R] Advice on approach to weighting survey

2011-09-30 Thread Farley, Robert
I'm about to add weights to a bus on-board survey dataset with ~150 variables and ~28,000 records. My intention is to weight (for each bus "run") by boarding stop and alighting stop. I've seen the Rake function of the Survey package, but it seems that converting to a "svydesign" might be exces

Re: [R] is member

2011-09-30 Thread Sarah Goslee
> 5 %in% seq(1,800,4) [1] TRUE > 4 %in% seq(1,800,4) [1] FALSE or > is.element(5, seq(1,800,4)) [1] TRUE > is.element(4, seq(1,800,4)) [1] FALSE Sarah On Fri, Sep 30, 2011 at 12:25 PM, Alaios wrote: > Dear all, > I have a vector with number that some of them are part of the > > seq(1,800,4).

Re: [R] is member

2011-09-30 Thread David Winsemius
On Sep 30, 2011, at 12:25 PM, Alaios wrote: Dear all, I have a vector with number that some of them are part of the seq(1,800,4). How can I check which of the numbers belong to the seq(1,800,4) LEt's say that is called myvector the vector with the numbers. Is there in R something like this

Re: [R] simplest pgfSweave example results in error

2011-09-30 Thread Yihui Xie
The error message was: ! LaTeX Error: File `test-003.tikz' not found. So I'm wondering how your StatET tried to compile the tex file, especially what was its working directory. Anyway, I recommend you to turn off the compilation to PDF in pgfSweave() so that it only generates the tex file, and t

[R] is member

2011-09-30 Thread Alaios
Dear all, I have a vector with number that some of them are part of the   seq(1,800,4). How can I check which of the numbers belong to the seq(1,800,4)   LEt's say that is called myvector the vector with the numbers. Is there in R something like this? is.member(myvector,seq(1,800,4))   I would like

Re: [R] integrate two lines to one

2011-09-30 Thread R. Michael Weylandt
On first glance it seems like it should work, perhaps a minimal working example would help. Also, if logictoReduce is a boolean vector, you probably don't need to test for equality with TRUE; if that test seems necessary (i.e., if Overloads <- Overloads[logictoReduce] doesn't work) that may be tie

[R] isotope superscripts ggplot2

2011-09-30 Thread Durant, James T. (ATSDR/DTEM/PRMSB)
Happy Friday fellow R users. I need some help - I am trying to make a graph using ggplot 2 of some lead isotope ratios. Normally, the isotope mass number appears as a superscript before the chemical symbol. However, I cannot figure out how to do this ggplot2's axis labels. The closest I have c

Re: [R] Implementing Silverman's Negative Reflection

2011-09-30 Thread David Winsemius
On Sep 30, 2011, at 10:14 AM, Duncan Murdoch wrote: On 30/09/2011 10:00 AM, David Winsemius wrote: On Sep 30, 2011, at 4:50 AM, sreblam wrote: > Hi! > I'm trying to implement in R in an easy way the negative reflection > method > described in Silverman (1986) on p.31, ie I have a non-n

[R] two simple questions about MCMCpoissonChange

2011-09-30 Thread Stefano Sofia
Dear R users, two quick questions about MCMCpoissonChange of the MCMCpack: 1. my data is stored into a vector (e.g. my_data), and as input for MCMCpoissonChange I need either a formula or a data frame. If I simply transform my vector to a data frame with data.frame(my_data), it does not work. If

Re: [R] Implementing Silverman's Negative Reflection

2011-09-30 Thread David Winsemius
On Sep 30, 2011, at 10:14 AM, Duncan Murdoch wrote: On 30/09/2011 10:00 AM, David Winsemius wrote: On Sep 30, 2011, at 4:50 AM, sreblam wrote: > Hi! > I'm trying to implement in R in an easy way the negative reflection > method > described in Silverman (1986) on p.31, ie I have a non-n

[R] integrate two lines to one

2011-09-30 Thread Alaios
Dear all, I would like to put these two lines together logictoReduce<-((Overloads-1)%%FreqN)==(SpanIndex-1) #0...3 refer to sub spans 1 to 4 Overloads<-Overloads[logictoReduce==TRUE] and do it like this Overloads<-Overloads[((Overloads-1)%%FreqN)==(SpanIndex-1)] which does not seem to work.

[R] Warning messages upon new package loading

2011-09-30 Thread Sébastien Bihorel
Dear R-users, The following warning messages are displayed when I require a new package that I am currently developing. Everything seems to work just fine though, so I am wondering how to get rid of the warnings. Warning messages: 1: Class "frame" is defined (with package slot 'kiwixposepreprod')

Re: [R] How to analyse this type of data...?

2011-09-30 Thread ONKELINX, Thierry
Dear Luc, IMHO a multinomial mixed model is appropriate for your data. It allows you to model tree species with bird id and period as covariates. Have a look at the vignette of the MCMCglmm package. You will find an example on hornets. Best regards, Thierry PS R-sig-mixed models is a better l

Re: [R] random effects

2011-09-30 Thread Rich Shepard
On Fri, 30 Sep 2011, Rosario Garcia Gil wrote: I have a data set with fixed and random effects, therefore I am using the lme function: Rosario, Allow me to recommend reading "Mixed Effects Models and Extentions in Ecology with R" by Zuur, et al. There are (potentially) serious limitations

Re: [R] julian day form POSIXt object

2011-09-30 Thread David Winsemius
On Sep 30, 2011, at 4:47 AM, maxbre wrote: here is an alternative long and winded solution to the problem sticking on the julian function of chron package test$year <- as.integer(as.character(test$date, "%Y")) test$month <- as.integer(as.character(test$date, "%m")) test$day <- as.integer(as.

Re: [R] Implementing Silverman's Negative Reflection

2011-09-30 Thread Duncan Murdoch
On 30/09/2011 10:00 AM, David Winsemius wrote: On Sep 30, 2011, at 4:50 AM, sreblam wrote: > Hi! > I'm trying to implement in R in an easy way the negative reflection > method > described in Silverman (1986) on p.31, ie I have a non-negative > dataset and > would like to estimate the densi

Re: [R] Implementing Silverman's Negative Reflection

2011-09-30 Thread David Winsemius
On Sep 30, 2011, at 4:50 AM, sreblam wrote: Hi! I'm trying to implement in R in an easy way the negative reflection method described in Silverman (1986) on p.31, ie I have a non-negative dataset and would like to estimate the density by applying a reflection method where the reflected po

Re: [R] Covariance-Variance Matrix and For Loops

2011-09-30 Thread R. Michael Weylandt
Without seeing cvm1_list, I can't guarantee this will work, but consider this: testList = list(rnorm(500), rnorm(500), rnorm(500), rnorm(500), rnorm(500)) testMat = simplify2array(testList) covTest = cov(testMat) Running your code works on my testList, so I can't help there without a reproducible

Re: [R] Understanding the workflow between sweave, R and Latex

2011-09-30 Thread syrvn
Hi Duncan, I use Eclipse and StatET plus TexClipse and Sweave which comes with the StatET package. So fore me it is basically one click as well to produce the pdf from the .Rnw file. I installed the MacTex live 2011 version on my computer and thought it might actually be easy to find out how and

Re: [R] Supporting R/Membership

2011-09-30 Thread jaropis
If there is an ONLINE mechanism, I will donate. j Joshua Wiley wrote: > Dear R Users, > > I know issues like this have come up in the past. I am wondering how > many people would be interested in an online mechanism for donating to > the R Foundation or for becoming supporting members. Right

Re: [R] Permutations of configurations on multiple columns

2011-09-30 Thread Metronome123
Michael Weylandt wrote: > > I'm not entirely sure how these two objects are related. Perhaps give a > little more information on the transform and we can help with > implementation... > Ok, I have got 2 matrices [P,I] and [I,E]. testcontents [P,I]: structure(list(P = structure(c(1L, 1L, 1L, 2L

[R] random effects

2011-09-30 Thread Rosario Garcia Gil
Hello I have a data set with fixed and random effects, therefore I am using the lme function: lm(y ~ xfixed, random=~1|xrandom, data) After this I want to get the F-values for both the fixed and random predictors. I can easily get the F-value and df for the xfixed predictors (anova()), but ho

Re: [R] the significance of BEKK estimation

2011-09-30 Thread bilelsan
Hi zoe, it's easy in a spreadsheet to calculate the p-value; estimates/stand.error = 1.96>5%<-1.96 for the asymmetry you must use: model=mGJR.est(eps1=#1, eps2=#2, order=c(1,1,1)) mvBEKK.diag(model) cheers -- View this message in context: http://r.789695.n4.nabble.com/the-significance-of-BEKK-e

Re: [R] remove elements from matrix

2011-09-30 Thread Ulrich Staudinger
Am 30.09.2011 11:30, schrieb Alaios: Dear all, I have a numeric vector that contains indices. I also have two matrices of [1,m] dimension and of [m,n] dimension. I want for every indexto remove the current element from the [1,m] vector an the row from the [m,n] matrix. How I can do that efficie

[R] Covariance-Variance Matrix and For Loops

2011-09-30 Thread sf1979
Hello, I am very new to R (as my Subject probably indicates). I want to do something that should, I think, be very simple. I have five vectors in a list and I want to construct a covariance matrix out of them. Given a 5X5 matrix cvm1, and the list of vectors, cvm1_list, I thought the following w

Re: [R] Overlapping plot in lattice

2011-09-30 Thread Gabor Grothendieck
On Fri, Sep 30, 2011 at 3:01 AM, Kang Min wrote: > Hi all, > > I was wondering if there's an equivalent to par(new=T) of the plot > function in lattice. I'm plotting an xyplot, and I would like to > highlight one point by plotting that one point again using a different > symbol. > > For example, w

Re: [R] Understanding the workflow between sweave, R and Latex

2011-09-30 Thread Duncan Murdoch
On 30/09/2011 8:03 AM, syrvn wrote: Let's say I have written the following tiny .Rnw file: _ \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{Sweave} \usepackage{tikz} \usepackage{pgf} \begin{document} <<>>= sessionInfo() @ \end{doc

[R] How to analyse this type of data...?

2011-09-30 Thread _Luc_
We have data on habitat use of a bird species (30 radio-tracked individuals). We followed each bird every day for ~45 min for 6 weeks. We recorded a number of things, each minute (a device would beep every minute and we would write down a number of variables). I recorded for example at what kind of

[R] Understanding the workflow between sweave, R and Latex

2011-09-30 Thread syrvn
Let's say I have written the following tiny .Rnw file: _ \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{Sweave} \usepackage{tikz} \usepackage{pgf} \begin{document} <<>>= sessionInfo() @ \end{document} ___

Re: [R] last observation carried forward +1

2011-09-30 Thread Gabor Grothendieck
On Fri, Sep 30, 2011 at 5:43 AM, Jan Wijffels wrote: > Hi R-helpers > > I'm looking for a vectorised function which does missing value replacement > as in last observation carried forward in the zoo package but instead of a > locf, I would like the locf function to add +1 to each time a missing va

Re: [R] julian day form POSIXt object

2011-09-30 Thread Gabor Grothendieck
On Fri, Sep 30, 2011 at 4:47 AM, maxbre wrote: > here is an alternative long and winded solution to the problem sticking on > the julian function of chron package > > test$year <- as.integer(as.character(test$date, "%Y")) > test$month <- as.integer(as.character(test$date, "%m")) > test$day <- as.i

Re: [R] Supporting R/Membership

2011-09-30 Thread John Fox
Dear Joshua and others, Please excuse the slow response, but I wanted to consult other R Foundation members before answering. The R Foundation is coincidentally discussing fund-raising and the use of funds that are raised by the Foundation. There are costs associated with keeping R going, such

Re: [R] Overlapping plot in lattice

2011-09-30 Thread Dennis Murphy
Hi: One way is to create a vector of pch values that you can pass into xyplot, e.g., dd <- data.frame(x = 1:10, y = 1:10, pch = c(rep(1, 5), 16, rep(1, 4))) library('lattice') xyplot(y ~ x, data = dd, pch = dd$pch, col = 1) HTH, Dennis On Fri, Sep 30, 2011 at 12:01 AM, Kang Min wrote: > Hi all

Re: [R] different results aov vs. lm

2011-09-30 Thread Prof Brian Ripley
On Fri, 30 Sep 2011, Martin Batholdy wrote: Hi, I currently running regression models on an experimental dataset. The model contains one independent continuous variable and two independent experimental conditions (one with two factors, the other with three factors) and several covariates.

Re: [R] remove elements from matrix

2011-09-30 Thread Jannis
Try this. As you did not supply a reproducible example my code is untested: 1.m.vector[index.vector] <- NULL or new.1.m.vector <- 1.m.vector[- index.vector] Someting equivalent is possible for the matrix. HTH Jannis On 09/30/2011 11:30 AM, Alaios wrote: Dear all, I have a numeric vector th

[R] Stop the process

2011-09-30 Thread arunkumar1111
Hi I'm creating a sweave (Rnw) from R and running the r code inside the sweave and then creating report from sweave file using R. If any error occurs in the running R code inside the sweeve file. it should stop entire R process itself Please help me to solve this -- View this message in cont

Re: [R] julian day form POSIXt object

2011-09-30 Thread maxbre
here is an alternative long and winded solution to the problem sticking on the julian function of chron package test$year <- as.integer(as.character(test$date, "%Y")) test$month <- as.integer(as.character(test$date, "%m")) test$day <- as.integer(as.character(test$date, "%d")) test$hour <- as.integ

[R] problem with getdata

2011-09-30 Thread ATANU
i want to use getdata function in sampling package. but if in the vector of index i write only 1( thats what i need) it gives the entire dataframe.(but instead of 1 if i give 2 or 3 it extracts the information corresponding to those indices).can anyone please help me? -- View this message in con

[R] All subsets vector autoregression with exogenous variables

2011-09-30 Thread Loz
Hi, I am trying to fit all subsets for a vector autoregression with exogenous variables. I have been looking at the 'leaps' function but I not sure how to get it to work when lags for each variable are included in the model. I would be really appreciative if someone could provide some links to e

Re: [R] julian day form POSIXt object

2011-09-30 Thread maxbre
sorry, I managed to find the solution at last (by reading the help but sometime is really difficult!) Class "POSIXlt" is a named list of vectors representing yday 0–365: day of the year. another lesson learned bye -- View this message in context: http://r.789695.n4.nabble.com/julian-day-for

Re: [R] Envfit, inconsistant result?

2011-09-30 Thread rodrock
Thanks a lot ! At the end I found that the problem was in the data input. Once I normilized the data input to use the chord distance as measure of dissimilarity gaps_flor_norm<-decostand(gaps_flor, "norm"), then I run the nMDS several times comparing them through procrustes plot(procrustes(gap_f

[R] Implementing Silverman's Negative Reflection

2011-09-30 Thread sreblam
Hi! I'm trying to implement in R in an easy way the negative reflection method described in Silverman (1986) on p.31, ie I have a non-negative dataset and would like to estimate the density by applying a reflection method where the reflected points have weight -1. I thought there should be a way to

[R] Overlapping plot in lattice

2011-09-30 Thread Kang Min
Hi all, I was wondering if there's an equivalent to par(new=T) of the plot function in lattice. I'm plotting an xyplot, and I would like to highlight one point by plotting that one point again using a different symbol. For example, where 6 is highlighted: plot(1:10, xlim=c(0,10), ylim=c(0,10)) pa

[R] last observation carried forward +1

2011-09-30 Thread Jan Wijffels
Hi R-helpers I'm looking for a vectorised function which does missing value replacement as in last observation carried forward in the zoo package but instead of a locf, I would like the locf function to add +1 to each time a missing value occurred. See below for an example. > require(zoo) > x <-

[R] hazard rates in conditional frailty models

2011-09-30 Thread Juan Fernandez
Dear list, I ran a conditional frailty model with an interaction term (see below). To interpret the interaction term, I would like to produce plots that reflect how does a moderator variable (“ecogr”) shape the effect of the other interacted variable (“elderly”). condfrailty.gamma.em <-coxph(

Re: [R] For loop for subset - repeating same over and over?

2011-09-30 Thread Dennis Murphy
Hi: This would be a lot easier to check with a reproducible example, but here's a simplified version of your problem: testd <- data.frame(gps = rep(c("ADHALP","ADLCON","ADLARC","BDALAT","BDPARC"), each = 15), trt = rep(LETTERS[1:3], each = 5),

[R] different results aov vs. lm

2011-09-30 Thread Martin Batholdy
Hi, I currently running regression models on an experimental dataset. The model contains one independent continuous variable and two independent experimental conditions (one with two factors, the other with three factors) and several covariates. Now I get different results for a covariate in t

[R] remove elements from matrix

2011-09-30 Thread Alaios
Dear all, I have a numeric vector that contains indices. I also have two matrices of [1,m] dimension and of [m,n] dimension. I want for every indexto remove the current element from the [1,m] vector an the row from the [m,n] matrix. How I can do that efficiently in R? So to say not have a for loo

Re: [R] rm.outlier produces a list

2011-09-30 Thread Uwe Ligges
On 29.09.2011 22:38, Ben qant wrote: Hello, Why does rm.outlier produce a list for me? I know its something about my data because I can't make a mock up that reproduces the issue. Any ideas? My data goes in as a matrix and comes out as a list: class(dat) [1] "matrix" str(dat) would be mo

Re: [R] For loop for subset - repeating same over and over?

2011-09-30 Thread peter dalgaard
On Sep 30, 2011, at 08:32 , Mario Valle wrote: > Not reproducible. > Could you please attach the dataset > > QInflAvgbyPlot > > Otherwise I don't see anything obviously wrong here. > Ciao! >mario > > On 30-Sep-11 01:37, kelseyann wrote: >> SiteSpp<- >> c("ADHAL

[R] R 2.13.2 is released

2011-09-30 Thread Peter Dalgaard
The byte pixies have rolled up R-2.13.2.tar.gz at 9:00 this morning. This is intended to be the final release of the 2.13 series, for the benefit of those apprehensive of putting 2.14.x into production use. The run-in for 2.14.0 starts on Monday, with a planned release on Oct 31 (The Great Pum

Re: [R] String manipulation with regexpr, got to be a better way

2011-09-30 Thread Eik Vettorazzi
Hi Chris, why not using routines for dates dates <- c("09/10/2003", "10/22/2005") format(strptime(dates,format="%m/%d/%Y"),"%Y") or take just the last 4 chars from dates gsub(".*([0-9]{4})$","\\1",dates) cheers Am 29.09.2011 16:23, schrieb Chris Conner: > Help-Rs, > > I'm doing some string man

Re: [R] simplest pgfSweave example results in error

2011-09-30 Thread syrvn
Hi, yes, I had a look at pgfSweave package and realised that it uses texi2dvi to compile the pdf file. I tried so much last night again that I am not entirely sure whether it is the same Rnw file or not. I just deleted everything and created a new R-project including a tiny example. I also inclu

Re: [R] How to Code Random Nested Variables within Two-way Fixed Model in lmer or lme

2011-09-30 Thread Helios de Rosario
Dave, your situation is clearer now. You wrote (see the full context at the end of the message): > From this, you will see that I have 4 control sites and 7 treatment > sites that are measured each week. All 13 locations have different > names, and Location is a random varaible. Is Location n