Re: [R] Creating frequency table using conditions in a for-loop

2012-06-06 Thread Özgür Asar
Hi, Where you attached the file? You can share your problem here as well. Ozgur -- View this message in context: http://r.789695.n4.nabble.com/Creating-frequency-table-using-conditions-in-a-for-loop-tp4632630p4632638.html Sent from the R help mailing list archive at Nabble.com. __

[R] - detecting outliers

2012-06-06 Thread Joachim Audenaert
Hello all, I am estimating parameters for regression functions on experimental data. Functional response of Rogers type II. I would like to know which points of my dataset are outliers. What is the best method to do this with R? I found a method via R help, but would like to know if there are b

Re: [R] conditional statement to replace values in dataframe with NA

2012-06-06 Thread Daisy Englert Duursma
Thanks, problem solved. On Thu, Jun 7, 2012 at 1:58 PM, Daisy Englert Duursma wrote: > Hello and thanks for helping. > > #some data > L3 <- LETTERS[1:3] > dat1 <- data.frame(cbind(x=1, y=rep(1:3,2), fac=sample(L3, 6, replace=TRUE))) > > > #When x==1 and y==1 I want to replace the 1 values with NA

Re: [R] conditional statement to replace values in dataframe with NA

2012-06-06 Thread Bert Gunter
Actually, recycling makes the rep(NA,2) business unnecessary. Simply: dat1[dat1$x==1 & dat1$y==1,1:2] <- rep(NA,2) ##or with(dat1,{dat1[x==1 & y==1,1:2] <- NA;dat1}) will do it. -- Bert On Wed, Jun 6, 2012 at 10:21 PM, Bert Gunter wrote: > Have you read "An Intro to R?" If not,please do so

Re: [R] conditional statement to replace values in dataframe with NA

2012-06-06 Thread Bert Gunter
Have you read "An Intro to R?" If not,please do so before posting further. The way you are going about things makes me think you haven't, but ... This **is** a slightly tricky application of indexing, if I understand you correctly. Here are two essentially identical ways to do it, but the second i

[R] factor coercion with read.csv or read.table

2012-06-06 Thread eric
How do I fix this error ? I tried coercion to a vector but that didn't work. msci <-read.csv("..MSCIexUS.csv", header=TRUE) head(msci) Date index 1 Dec 31, 1969100 2 Jan 30, 1970 97.655 3 Feb 27, 1970 96.154 4 Mar 31, 1970 95.857 5 Apr 30, 1970 85.564 6 May 29, 1970 79.005 > str(m

Re: [R] [R-sig-ME] interpretation of main effect when interaction term being significant (ex. lme)

2012-06-06 Thread arun
HI Dave, My comment was based  on: " >The main question with this test was if the interaction term is significant >(i.e. growth rate). However, my question is could I also look at the p-values >of the main effects to  >say if body mass increase significant with body mass?" Here, the result sho

[R] na.pass option in ccf function

2012-06-06 Thread Dario Mavec
Hi everyone, I have been working with the ccf function recently, and in particular to do my calculations I have been using "na.action = na.pass". I noticed that the help documentation mentions that with this option the computed estimate may not be a valid autocorrelation sequence and was wond

[R] ellipse

2012-06-06 Thread a.lugu...@gmail.com
Hi, I would like to draw elliptic confidence interval. I know I can use a package ellpise, but can I do it in this way: I want to draw an ellipse countour i.e. all points in R^2 such that t(x*-x)%*%A%*%(x*-x)<=c, for some x* in R^2 and constant c. A is 2x2 matrix. -- View this message in context

[R] Creating frequency table using conditions in a for-loop

2012-06-06 Thread Faz Jones
Hi, I have attached a word document to explain the problem i am having creating a for-loop in R with conditions to create a frequency table. I am new to R so any help would be greatly appreciated. Thanks Jones __ R-help@r-project.org mailing list https:

[R] Predict in the package R2BayesX

2012-06-06 Thread niandra
Hi all I'm using the function bayesx to estimate a simple model, for example: library(R2BayesX) ## generate some data set.seed(111) n <- 200 ## regressor dat <- data.frame(x = runif(n, -3, 3)) ## response dat$y <- with(dat, 1.5 + sin(x) + rnorm(n, sd = 0.6)) ## estimate models with ## bayesx

Re: [R] Delete rows from dataset

2012-06-06 Thread Rui Barradas
Hello, Try fun <- function(x){ one <- which(x$score == 1) # rows to remove if(length(one) == 1) x else if(length(one) > 1) x[-one[-sample(seq_along(one), 1)], ] # all but a randomly sampled row } res <- lapply(split(data.frame(dat), dat[,

Re: [R] Combine subsets by factor level

2012-06-06 Thread arun
Hi, So it might be in this format.  Same code works.  dat6<-data.frame(patient=c(c(1:3)[rep(c(1,1,1,2,2,3,3,3,3))],rep(c(4:10),rep(3,7))), var=c("cycle0","cycle1","cycle2","cycle5","cycle12")[rep(c(1,2,3,1,5,1,2,3,4,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3))],value=c(rnorm(30,1,0.5))) > dat

Re: [R] how to remove part of the string

2012-06-06 Thread Martin Schilling
Dear Bill, If you're not bound to gsub(), you could simply take substring() as follows: string <- "LTA4H||Leukotriene A4 hydrolase" substring(string, 1,5) This one works quite well and it could also be complemented with nchar() to "cut" strings with different lengths like substring(string, 1,

Re: [R] R2BayesX (command bayesx) doesn't work

2012-06-06 Thread niandra
I thought was a problem of the command bayesx and not an installation problem. Now, i don't now why, it works. -- View this message in context: http://r.789695.n4.nabble.com/R2BayesX-command-bayesx-doesn-t-work-tp4632541p4632600.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] non ascill characters in plots. no alternative but plotmath?

2012-06-06 Thread David Winsemius
On Jun 6, 2012, at 7:23 PM, Paul Johnson wrote: A student entered some data with text characters like epsilon and alpha. On her Windows system, the Greek letters did not display properly in a plot. There were some ordinary ASCII instead. I asked her to send me the code so I could test. For

[R] conditional statement to replace values in dataframe with NA

2012-06-06 Thread Daisy Englert Duursma
Hello and thanks for helping. #some data L3 <- LETTERS[1:3] dat1 <- data.frame(cbind(x=1, y=rep(1:3,2), fac=sample(L3, 6, replace=TRUE))) #When x==1 and y==1 I want to replace the 1 values with NA #I can select the rows I want: dat2<-subset(dat1,x==1 & y==1) #replace the 1 with NA dat2$x<-rep(N

Re: [R] Sobel's test for mediation and lme4/nlme

2012-06-06 Thread Özgür Asar
Why posting the same message three times? Ozgur -- View this message in context: http://r.789695.n4.nabble.com/Sobel-s-test-for-mediation-and-lme4-nlme-tp4632586p4632625.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project

Re: [R] regression methods for rare events?

2012-06-06 Thread Duncan Mackay
Hi Xavier Try VGAM package see Extremes (2007) 10:1–19 DOI 10.1007/s10687-007-0032-4 Vector generalized linear and additive extreme value models Thomas W. Yee Alec G. Stephenson It just happens that I had the pdf open Regards Duncan Duncan Mackay Department of Agronomy and Soil Science Uni

Re: [R] Removing Double Quotations After Using Cbind

2012-06-06 Thread Jeff Newmiller
Arrays must all be the same type. Data frame columns may be of differing types. Try to avoid creating a matrix and converting it to a data frame. a<- data.frame(name=c(2,2,"X"), value=c(,1:3,2:4), as.is=TRUE) str(a) --- Jeff

[R] non ascill characters in plots. no alternative but plotmath?

2012-06-06 Thread Paul Johnson
A student entered some data with text characters like epsilon and alpha. On her Windows system, the Greek letters did not display properly in a plot. There were some ordinary ASCII instead. I asked her to send me the code so I could test. For me, the plot looks ok on the screen. Format1 <- c(3

Re: [R] Do YOU know an equation for splines (ns)?

2012-06-06 Thread Spencer Graves
I agree with Bill and Bert: "predict" is the proper tool for making predictions. Pinheiro and Bates (2000) Mixed-Effects Models in S and S-Plus (Springer) includes several entries in the index for "predictions". Please note, however, that there are a few lines of code in that book the

Re: [R] Removing Double Quotations After Using Cbind

2012-06-06 Thread David Winsemius
On Jun 6, 2012, at 3:51 PM, Joshua Budman wrote: Hi, I am trying to process genomics data and the presence of both characters and integers in an array is giving issues. That is probably because you do not understand that it there is even one character in an array, then that is what ALL the

Re: [R] package zoo, function na.spline with option maxgap -> Error: attempt to apply non-function?

2012-06-06 Thread Gabor Grothendieck
On Wed, Jun 6, 2012 at 4:40 PM, May Katharina wrote: > On Jun 6, 2012, at 10:19 , Gabor Grothendieck wrote: > >> On Wed, Jun 6, 2012 at 3:55 PM, May Katharina >> wrote: >>> Hello, >>> >>> I'm trying to use na.spline (package zoo) to fill some missing data in a >>> time series. >>> this works fin

Re: [R] Error in installing packages

2012-06-06 Thread Martin Morgan
On 06/06/2012 01:41 PM, Andreia Leite wrote: Yes it's windows (vista). It's not a specific package. I've tried more than a CRAN mirror and the message it's always date (the list with the packages simply doesn't appear). What proxy settings should I verify specifically (sorry I don't know a lot on

[R] Proxy Setting

2012-06-06 Thread Gurubaramurugeshan, Arun
Hi, I am trying to download data off of this web site http://www.eia.gov/oil_gas/petroleum/data_publications/wrgp/mogas_history.html I used to set the proxy following code to set the proxy Sys.setenv(wget="http://username:password@"proxy server":port") I used the following code to download the d

Re: [R] how to remove part of the string

2012-06-06 Thread andrija djurovic
Hi. Rui already gave you a solution. Beside that you can, also, use substr function in this concrete example: substr("LTA4H||Leukotriene A4 hydrolase", 1, 5) This can be adjusted to rest of your data also, but you haven't provided enough information. Andrija On Wed, Jun 6, 2012 at 11:27 PM, Rui

Re: [R] how to remove part of the string

2012-06-06 Thread Rui Barradas
Hello, Try txt <- "LTA4H||Leukotriene A4 hydrolase" pattern <- "\\|\\|.*$" gsub(pattern, "", txt) Hope this helps, Rui Barradas Em 06-06-2012 21:45, Bill Hyman escreveu: Dear all, Does any one know how to remove part of the string? For example, "LTA4H||Leukotriene A4 hydrolase" is a gene

Re: [R] How to label certain values on a curve?

2012-06-06 Thread Ted Harding
On the subject of identify() [perhaps I should change thread]: '?identify' clearly states: Value: If 'pos' is 'FALSE', an integer vector containing the indices of the identified points, in the order they were identified. However, I find that the result is not in the order of identifica

Re: [R] how to remove part of the string

2012-06-06 Thread andrija djurovic
Hi. You can do something like this: gsub("\\|\\|Leukotriene A4 hydrolase","","LTA4H||Leukotriene A4 hydrolase") Andrija On Wed, Jun 6, 2012 at 10:45 PM, Bill Hyman wrote: > Dear all, > > Does any one know how to remove part of the string? > > For example, "LTA4H||Leukotriene A4 hydrolase" is a

Re: [R] Removing Double Quotations After Using Cbind

2012-06-06 Thread andrija djurovic
Hi. Try: as.data.frame(cbind(a[,1],a[,2])) Andrija On Wed, Jun 6, 2012 at 9:51 PM, Joshua Budman wrote: > Hi, > I am trying to process genomics data and the presence of both > characters and integers in an array is giving issues. The following is > an example: > > a<-array(c(2,2,"X",1:3,2:4),

Re: [R] Combine subsets by factor level

2012-06-06 Thread Lib Gray
They do not; each patient only has rows for the cycles it has. Some have only one, some have more than ten. On Jun 6, 2012 2:24 PM, "arun" wrote: > Hi, > > Try this: > > library(reshape) > > dat4<-data.frame(patient=rep(c(1:10), > > rep(3,10)),var=rep(c("cycle0","cycle1","cycle2"),rep(1,3)),value

[R] how to remove part of the string

2012-06-06 Thread Bill Hyman
Dear all, Does any one know how to remove part of the string? For example, "LTA4H||Leukotriene A4 hydrolase" is a gene name plus gene description. I hope to remove "||Leukotriene A4 hydrolase". What would be the R code to do that using gsub()? Many thanks! Bill ___

Re: [R] Error in installing packages

2012-06-06 Thread Andreia Leite
Yes it's windows (vista). It's not a specific package. I've tried more than a CRAN mirror and the message it's always date (the list with the packages simply doesn't appear). What proxy settings should I verify specifically (sorry I don't know a lot on informatics)? I've installed a few packages be

[R] Removing Double Quotations After Using Cbind

2012-06-06 Thread Joshua Budman
Hi, I am trying to process genomics data and the presence of both characters and integers in an array is giving issues. The following is an example: > a<-array(c(2,2,"X",1:3,2:4),dim=c(3,3)) > b<-cbind(a[,1],a[,2]) With the output being: [,1] [,2] [1,] "2" "1" [2,] "2" "2" [3,] "X" "

Re: [R] Do YOU know an equation for splines (ns)?

2012-06-06 Thread William Dunlap
Do you have to include the grouping variable, plotF, in your newdata argument? E.g., after fitting the model with rcn10G<-groupedData(N ~ day | plotF, data=rcn10) fit10 <- lme( N~ns(day, 3), data = rcn10G) try checking the predictions when you've include plotF in newdata: par(mfrow=c(2,1))

[R] Process XML files

2012-06-06 Thread Santosh
Hello experts, Sorry for posting the SPlus related question here.. I have not found any solution yet after some attempts and hence, sending it to a wider spectrum of users! I was successful in processing files uing R's XML librariy. Thank you, Rxperts! I know there are libraries like XML and SPXM

Re: [R] package zoo, function na.spline with option maxgap -> Error: attempt to apply non-function?

2012-06-06 Thread May Katharina
On Jun 6, 2012, at 10:19 , Gabor Grothendieck wrote: > On Wed, Jun 6, 2012 at 3:55 PM, May Katharina > wrote: >> Hello, >> >> I'm trying to use na.spline (package zoo) to fill some missing data in a >> time series. >> this works fine, however, if I apply the 'maxgap' argument, I always get the

Re: [R] Do YOU know an equation for splines (ns)?

2012-06-06 Thread Bert Gunter
Ah ... Iirc believe the problem is that you need to explicitly generate the spline basis and then the predicted values via predict.ns and feed that to predict.lme; i.e. splineBas <- with(rcn10,ns(day,3)) newvals <- data.frame( predict(splineBas, num)) ## then once you've fitted your model: lines

Re: [R] package zoo, function na.spline with option maxgap -> Error: attempt to apply non-function?

2012-06-06 Thread Gabor Grothendieck
On Wed, Jun 6, 2012 at 3:55 PM, May Katharina wrote: > Hello, > > I'm trying to use na.spline (package zoo) to fill some missing data in a time > series. > this works fine, however, if I apply the 'maxgap' argument, I always get the > error: > <-- > Error in na.spline.vec(x., coredata(object

[R] heatmap.2 clustering and adding add.expr

2012-06-06 Thread Tanu Soni
Hi , I am trying to plot a heatmap with a correlation matrix and trying to highlight significant correlations . i am using my matrix d874n has 78 columns ex2<-corAndPvalue(data.matrix(d874n),use = "pairwise.complete.obs") ##creating a matrix of true false using p values sig<-ex2$p<0.05 nx=78 ny=7

Re: [R] package zoo, function na.spline with option maxgap -> Error: attempt to apply non-function?

2012-06-06 Thread R. Michael Weylandt
Thanks for the great reproducible example -- I can confirm on the devel version of zoo. I'd venture it's a buglet in that maxgap gets passed (by way of dots) to na.spline --> na.spline.zoo --> na.spline.default --> na.spline.vec --> to both .fill_short_gaps (good) and spline (bad) which is where t

[R] package zoo, function na.spline with option maxgap -> Error: attempt to apply non-function?

2012-06-06 Thread May Katharina
Hello, I'm trying to use na.spline (package zoo) to fill some missing data in a time series. this works fine, however, if I apply the 'maxgap' argument, I always get the error: <-- Error in na.spline.vec(x., coredata(object.), xout = xout., ...) : attempt to apply non-function --> I c

[R] Sobel's test for mediation and lme4/nlme

2012-06-06 Thread G B
Hello, Any advice or pointers for implementing Sobel's test for mediation in 2-level model setting? For fitting the hierarchical models, I am using "lme4" but could also revert to "nlme" since it is a relatively simple varying intercept model and the two yield identical estimates. I apologize for t

Re: [R] Trouble with Functions

2012-06-06 Thread dougmcintosh
Haha no, TextWrangler. And that was definitely it...I think what was happening is that when I opened the text version of the book it opened in Notepad, which was probably opened the txt file in RTF. Then I copied and pasted the function code into TextWrangler and didn't even think about Smart Quot

[R] Sobel's test for mediation and lme4/nlme

2012-06-06 Thread G B
Hello, Any advice or pointers for implementing Sobel's test for mediation in 2-level model setting? For fitting the hierarchical models, I am using "lme4" but could also revert to "nlme" since it is a relatively simple varying intercept model and they yield identical estimates. I apologize for this

Re: [R] Combine subsets by factor level

2012-06-06 Thread arun
Hi, Try this: library(reshape) dat4<-data.frame(patient=rep(c(1:10), rep(3,10)),var=rep(c("cycle0","cycle1","cycle2"),rep(1,3)),value=c(rnorm(15,1,0.5),NA,rnorm(5,1,0.5),NA,rnorm(8,1,0.5))) > dat5<-cast(dat4,patient~var,value="value") > dat5    patient    cycle0    cycle1    cycle2 1    1

Re: [R] Combine subsets by factor level

2012-06-06 Thread Lib Gray
Yes, except that patients have different cycle numbers. Such as, one might have cycle 1,2,3, and another has 1,4,12. On Jun 6, 2012 12:54 PM, "arun" wrote: > Hi Iglucia, > > I am not sure how your dataset looks like. Does it look similar to this: > > > dat4<-data.frame(patient=rep(c(1:10), > rep

Re: [R] Chi square value of anova(binomialglmnull, binomglmmod, test="Chisq")

2012-06-06 Thread lincoln
Thank you all, This was exactly the sort of help I hoped to get. -- View this message in context: http://r.789695.n4.nabble.com/Chi-square-value-of-anova-binomialglmnull-binomglmmod-test-Chisq-tp4632293p4632568.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] Do YOU know an equation for splines (ns)?

2012-06-06 Thread Ranae
I have not been able to get "predict" (or most functions) to run well with grouped data in nlme. I may not have it coded right, but this is what it looks like: http://r.789695.n4.nabble.com/file/n4632567/spline.txt spline.txt library(nlme) library(splines) rootCN<-read.table("spline.txt", head

Re: [R] Combine subsets by factor level

2012-06-06 Thread arun
Hi Iglucia, I am not sure how your dataset looks like.  Does it look similar to this: > dat4<-data.frame(patient=rep(c(1:10), > rep(3,10)),var=rep(c("cycle0","cycle1","cycle2"),rep(1,3)),value=c(rnorm(15,1,0.5),NA,rnorm(5,1,0.5),NA,rnorm(8,1,0.5))) > dat4    patient    var value 1    1 c

Re: [R] ARCH modelling/MA process

2012-06-06 Thread KelseyStroud
To specify what I want to do, I want to forecast the volatility of the series bases on the previous volatility. The prices are now daily returns, they are logged and differentiated. I have also looked at generating two dates, use calenderdate and one compdate for use in the model. In compdate, frid

Re: [R] Main effects and interactions in mixed linear models

2012-06-06 Thread arun
Hi Ron, When the interaction is significant, I will not look at the significance of main effects as the main effect significance are irrelevant.  Then the comparisons could be made between the simple effect means. A.K.  - Original Message - From: Ron Stone To: r-help@r-project.or

[R] Sobel's test for mediation and lme4/nlme

2012-06-06 Thread G B
Hello, Any advice or pointers for implementing Sobel's test for mediation in 2-level model setting? For fitting the hierarchical models, I am using "lme4" but could also revert to "nlme" since it is a relatively simple varying intercept model and they yield identical estimates. I apologize for this

Re: [R] How to label certain values on a curve?

2012-06-06 Thread Wendy Han
This is exactly what I need. Thanks a lot! Best, Wendy On Wed, Jun 6, 2012 at 11:38 AM, R. Michael Weylandt < michael.weyla...@gmail.com> wrote: > Take a look at the identify() function. > > Best, > Michael > > On Wed, Jun 6, 2012 at 11:23 AM, Wendy Han wrote: > > Hi all, > > > > I have drawn

Re: [R] Trouble with Functions

2012-06-06 Thread Peter Ehlers
On 2012-06-05 17:00, dougmcintosh wrote: FYI - here are the errors (I can get rid of the first one by removing the progress parameter - which I understand controls whether a progress bar is displayed). The second one stops at the gsub call. Maybe if someone could give me a properly formatted exa

Re: [R] ggplot2: legend for geom_rug() ..?

2012-06-06 Thread John Kane
What is X2? code not running at the moment John Kane Kingston ON Canada > -Original Message- > From: bsmith030...@gmail.com > Sent: Wed, 6 Jun 2012 11:52:25 -0400 > To: r-help@r-project.org > Subject: [R] ggplot2: legend for geom_rug() ..? > > Hi, > > I was trying to make another le

Re: [R] ggplot incorrect legend

2012-06-06 Thread John Kane
Try making FuelTypeNum into a factor like this: p <- ggplot(data=tempTable, aes(x=Bands8, y=AvailableMWNewFormat, fill=as.factor(FuelTypeNum))) + geom_bar(position="stack", stat="identity")+ coord_flip() p John Kane Kingston ON Canada > -Original Message- > From: ja..

Re: [R] extracting values from txt file that follow user-supplied quote

2012-06-06 Thread Bert Gunter
I think 1 gb is small enough that this can be easily and efficiently done in R. The key is: regular expressions are your friend. I shall assume that the text file has been read into R as a single character string, named "mystring" . The code below could easily be modifed to work on a a vector of s

Re: [R] R2BayesX (command bayesx) doesn't work

2012-06-06 Thread Prof Brian Ripley
On 06/06/2012 16:13, niandra wrote: Hi all, I have a problem with the library R2BayesX, when i try to use the command bayesx i get this error: dyld: Library not loaded: /usr/local/lib/libreadline.5.2.dylib Referenced from: /Library/Frameworks/R.framework/Versions/2.15/Resources/library/BayesX

Re: [R] how to ignore NA with "NA" or "NULL"

2012-06-06 Thread Rui Barradas
Hello, Why don't you test an all(is.na(x)) condition? If TRUE, return(NA), not NULL. Rui Barradas Em 06-06-2012 16:42, jeff6868 escreveu: Thanks again for your help jeff. Sorry if I'm not very clear. It's programmingly speaking hard to explain, and even to explain in english as I'm French. B

Re: [R] extracting values from txt file that follow user-supplied quote

2012-06-06 Thread Rainer Schuermann
R may not be the best tool for this. Did you look at gawk? It is also available for Windows: http://gnuwin32.sourceforge.net/packages/gawk.htm Once gawk has written a new file that only contains the lines / data you want, you could use R for the next steps. You also can run gawk from within R wi

Re: [R] Main effects and interactions in mixed linear models

2012-06-06 Thread Bert Gunter
Ron: There are some misunderstandings in your message. See inline below. However, this is fundamentally not an R question -- it's about "what to do" not how to do it in R. So I suggest you post on a statistical list like stats.stackexchange.com. But as you have already noted, beware, you are lik

Re: [R] error calling Winbugs using R2WinBugs to run a multi-level model

2012-06-06 Thread Uwe Ligges
On 06.06.2012 16:51, ilai wrote: Untested because I don't have (use) winbugs and you didn't provide dat*. But consider a<- 4 ; f<- 6 list('a','f') list(a,f) list(a=a,f=f) My guess is you wanted sp.data to be a named list, not a list of names... That's also OK, from ?bugs.data: data: eithe

Re: [R] Error in installing packages

2012-06-06 Thread Uwe Ligges
On 06.06.2012 17:14, Andreia Leite wrote: Dear list, I'm trying to install a package but every time I select the option form the menu this error message appears: utils:::menuInstallPkgs() Error in read.dcf(file = tmpf) : Line starting ' Have you checked proxy settings? Is this Windows?

Re: [R] How to calculate chi sqaure value from statistical value and degrees of freedom?

2012-06-06 Thread Rui Barradas
Hello, You are computing the lower tail value, for chi-squared tests it's probably the upper tail you want. p.val1 <- 1 - pchisq(Stat, df) p.val2 <- pchisq(Stat, df, lower.tail=FALSE) p.val1 == p.val2 Hope this helps, Rui Barradas Em 06-06-2012 02:31, Manish Gupta escreveu: Hi, My input i

[R] extracting values from txt file that follow user-supplied quote

2012-06-06 Thread emorway
useRs- I'm attempting to scan a more than 1Gb text file and read and store the values that follow a specific key-phrase that is repeated multiple time throughout the file. A snippet of the text file I'm trying to read is attached. The text file is a dumping ground for various aspects of the per

Re: [R] How to label certain values on a curve?

2012-06-06 Thread R. Michael Weylandt
Take a look at the identify() function. Best, Michael On Wed, Jun 6, 2012 at 11:23 AM, Wendy Han wrote: > Hi all, > > I have drawn a curve in R and observed some interesting values, I wonder if > there is any method to mark certain values on this curve, so that I > can manually choose the point

Re: [R] Source code for simple Forward step wise regression .

2012-06-06 Thread Sarah Goslee
I'm sorry, but I don't understand your question. What is the R problem you are trying to solve? Sarah On Wed, Jun 6, 2012 at 10:51 AM, Shilpi Harpavat (PDF) wrote: > Hi , > > I want to implement a simple forward stepwise regression in java which > fits a linear model with no  term and then add t

Re: [R] ggplot incorrect legend

2012-06-06 Thread jcrosbie
Thank you for your help. I would expect FuelTypeNum to make up the legend. But in the legend there is an extra value of called '3' and in the chart there is an extra FuelTypeNum. code: ggplot(data=tempTable, aes(x=Bands8, y=AvailableMWNewFormat, fill=FuelTypeNum)) + geom_bar(position="stack"

[R] How to label certain values on a curve?

2012-06-06 Thread Wendy Han
Hi all, I have drawn a curve in R and observed some interesting values, I wonder if there is any method to mark certain values on this curve, so that I can manually choose the point and know the exact value of this point simultaneously? I appreciate your suggestions and advice! Thanks a lot! Wend

[R] Error in installing packages

2012-06-06 Thread Andreia Leite
Dear list, I'm trying to install a package but every time I select the option form the menu this error message appears: > utils:::menuInstallPkgs() Error in read.dcf(file = tmpf) : Line starting 'http://r.789695.n4.nabble.com/Error-in-installing-packages-tp4632543.html Sent from the R help mai

[R] R2BayesX (command bayesx) doesn't work

2012-06-06 Thread niandra
Hi all, I have a problem with the library R2BayesX, when i try to use the command bayesx i get this error: dyld: Library not loaded: /usr/local/lib/libreadline.5.2.dylib Referenced from: /Library/Frameworks/R.framework/Versions/2.15/Resources/library/BayesXsrc/libs/i386/BayesX Reason: image no

Re: [R] Fourier descriptors created in a loop

2012-06-06 Thread aledanda
Thanks for your email, in fact the problem was in the nested loop!! By removing it and adding at the end i = i + 1 I solved the problem, all the rest stays the same. Best -- View this message in context: http://r.789695.n4.nabble.com/Fourier-descriptors-created-in-a-loop-tp4632414p4632539.html

[R] Main effects and interactions in mixed linear models

2012-06-06 Thread Ron Stone
Dear all, This question may be too basic quesition for this list, but if someone has time to answer I will be happy. I have tried to find out, but haven't found a consice answer. As an example I use "Pinheiro, J. C. & Bates, D. M. 2000. Mixed-effects models in S and S-PLUS. Springer, New York." p

[R] Source code for simple Forward step wise regression .

2012-06-06 Thread Shilpi Harpavat (PDF)
Hi , I want to implement a simple forward stepwise regression in java which fits a linear model with no term and then add terms one by one .What would be the best algorithm to use along with Criterion for what terms to keep /Drop and when to Stop. Any help appreciated. Thanks -- *The informatio

Re: [R] Fourier descriptors created in a loop

2012-06-06 Thread David Winsemius
On Jun 6, 2012, at 11:46 AM, David Winsemius wrote: On Jun 6, 2012, at 5:13 AM, aledanda wrote: Hi David, Thank you for your reply. /Somehow I'm guessing that this will involve load an unnamed package. Yep: ?create.fourier.descriptor No documentation for ‘create.fourier.descriptor’ in spe

[R] ggplot2: legend for geom_rug() ..?

2012-06-06 Thread Brian Smith
Hi, I was trying to make another legend for the rug plot. Sample code: library(ggplo2) ids <- paste('id_',1:3,sep='') before <- sample(9) after <- sample(1:10,9) dat <- as.matrix(cbind(before,after)) rownames(dat) <- rep(ids,3) position <- c(rep(10,3),rep(13,3),rep(19,3)) mdat <- cbind(melt(dat

Re: [R] Fourier descriptors created in a loop

2012-06-06 Thread David Winsemius
On Jun 6, 2012, at 5:13 AM, aledanda wrote: Hi David, Thank you for your reply. /Somehow I'm guessing that this will involve load an unnamed package. Yep: ?create.fourier.descriptor No documentation for ‘create.fourier.descriptor’ in specified packages and libraries: you could try ‘??create

Re: [R] Chi square value of anova(binomialglmnull, binomglmmod, test="Chisq")

2012-06-06 Thread Marc Schwartz
On Jun 6, 2012, at 9:36 AM, peter dalgaard wrote: > > On Jun 6, 2012, at 10:59 , lincoln wrote: > >> >> David Winsemius wrote >>> >>> This is making me think you really have multiple observation on the >>> same individuals (and that persons make transitions from one state to >>> another as

Re: [R] Piecewise Lasso Regression

2012-06-06 Thread Vito Muggeo (UniPa)
dear Lucas, If you are interested in selecting the number of breakpoints here a possible remedy: 1. Fit a segmented model with a large number of breakpoints via the arguments psi=NA and stop.if.error=FALSE in seg.control() (see the example below) 2. extract the "model matrix" relevant to th

Re: [R] how to ignore NA with "NA" or "NULL"

2012-06-06 Thread jeff6868
Thanks again for your help jeff. Sorry if I'm not very clear. It's programmingly speaking hard to explain, and even to explain in english as I'm French. But i'll try again. Well your proposition removes the error, but it's not the result I'm expecting. You've removed NULL data.frames, but I need t

[R] Problem with tune function in e1071 package

2012-06-06 Thread Guido Leoni
Dear list I'm classifying some data with e1071package but when I try to tune my parameters I retrieve this error Error in do.call(method, c(list(train.x[train.ind[[sample]], ], y = train.y[train.ind[[sample]]]), : 'what' must be a character string or a function below are my command training<

Re: [R] How to Read command line parameters in Sweave?

2012-06-06 Thread Jessica Streicher
http://stackoverflow.com/questions/9399459/r-sweave-arguments google is your friend ;) Am 06.06.2012 um 15:29 schrieb manish gupta: > I don't want to use it as manual. I want my software to automated. > > On Wed, Jun 6, 2012 at 9:13 PM, Yihao Lu wrote: > >> you use this list as your manual?

Re: [R] cluster algorithm with fixed cluster size

2012-06-06 Thread Özgür Asar
Hi, See the package cluster in R. Ozgur -- View this message in context: http://r.789695.n4.nabble.com/cluster-algorithm-with-fixed-cluster-size-tp4632523p4632540.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org m

Re: [R] how to ignore NA with "NA" or "NULL"

2012-06-06 Thread Jeff Newmiller
Still not clear what solution you would consider a success. On the one hand, you said you needed the NULLs, but you want one big data frame also. Does refill <- refill[ -which( sapply( refill, is.null ), arr.ind=TRUE ) ) ] refill <- as.data.frame( refill ) do what you want? If you need to keep

Re: [R] Fourier descriptors created in a loop

2012-06-06 Thread Jeff Newmiller
It would help if you read the manual page for "png" and gave it arguments that matched what the function expects. You probably also need to read ?paste. Also, based on what you have said so far, you do NOT need nested for loops. Just use the inner loop and when you need "i" use instead "coun

Re: [R] error calling Winbugs using R2WinBugs to run a multi-level model

2012-06-06 Thread ilai
Untested because I don't have (use) winbugs and you didn't provide dat*. But consider a <- 4 ; f <- 6 list('a','f') list(a,f) list(a=a,f=f) My guess is you wanted sp.data to be a named list, not a list of names... HTH On Wed, Jun 6, 2012 at 4:12 AM, Saana Isojunno < saana.isoju...@googlemail.co

[R] ARCH modelling/MA process

2012-06-06 Thread and_mue
Hi all ARCH modelling I have a problem now on how to proceed with further steps in my analysis. I did a linear OLS regression with my daily data of stock and index returns. There is now the problem of arch in my error terms. Thus I used the following r command: garch(resid_desn, order=c(0,2)) #

Re: [R] How to find best parameter values using deSolve n optim() ?

2012-06-06 Thread mhimanshu
Hello Thomas, This code seems to be fine and its now working well. I read the about the FME package, but I have one doubt, as in the data set given in the paper, it showing a nice kinetics of the viral growth, so my question is what if there is a sudden increase in viral growth after some interv

Re: [R] Piecewise Lasso Regression

2012-06-06 Thread Lucas Santana dos Santos
Hi Vito, I am more interested in selecting the number of breakpoints. My data has some structure and I believe that fitting a piecewise regression would be of great benefit. Thanks, Lucas On Jun 6, 2012, at 4:54 AM, Vito Muggeo (UniPa) wrote: > dear lucas, > yes you are right, segmented does

Re: [R] How to Read command line parameters in Sweave?

2012-06-06 Thread Yihao Lu
you use this list as your manual? On Wed, Jun 6, 2012 at 2:31 AM, Manish Gupta wrote: > Hi, > > I want to read command line parameter in Sweave. How this can be done. > > R CMD Sweave input.Rnw   parameter1  paramter2 > > Regards > > -- > View this message in context: > http://r.789695.n4.nabble

Re: [R] ggplot incorrect legend

2012-06-06 Thread jcrosbie
I'm expecting the legend to be 1,2,4,5,10 not 2,4,6,8,10. Is there away I can set my own colour and legend tittles? -- View this message in context: http://r.789695.n4.nabble.com/ggplot-incorrect-legend-tp4632471p4632529.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] how to add a vertical line for each panel in a lattice dotplot with log scale?

2012-06-06 Thread ilai
You say median for each panel but tapply gets medians for each variety (chartjunk IMHO). Regardless, *this case* has nothing to do with panel.abline. Add print(median.values) to your panel function would have hinted as to the missing piece. # medians for each panel: dotplot(variety ~ yield | site,

Re: [R] Chi square value of anova(binomialglmnull, binomglmmod, test="Chisq")

2012-06-06 Thread peter dalgaard
On Jun 6, 2012, at 10:59 , lincoln wrote: > > David Winsemius wrote >> >> This is making me think you really have multiple observation on the >> same individuals (and that persons make transitions from one state to >> another as a result of the passage of time. That needs a more complex >

Re: [R] [r] par and complex graph

2012-06-06 Thread Francesco Nutini
Thank you Brian! So, that's why sometimes I can't use the par() Now I'm using the ternaryplot in [vcd]. Then, I have to read the vcd help to looking for a function similar to par(). Many thanks. Francesco > Date: Tue, 5 Jun 2012 19:01:25 +0100 > From: rip...@stats.ox.ac.uk > To: nutini.fra

Re: [R] how to ignore NA with "NA" or "NULL"

2012-06-06 Thread jeff6868
Ok Jeff, but then it'll be a big one. I'm working on a list of files and my problem depends on different functions used previously. So it's very hard for me to summarize to reproduct my error. But here is the reproductible example with the error at the last line of the code (just copy and paste it)

Re: [R] How to Read command line parameters in Sweave?

2012-06-06 Thread manish gupta
I don't want to use it as manual. I want my software to automated. On Wed, Jun 6, 2012 at 9:13 PM, Yihao Lu wrote: > you use this list as your manual? > > On Wed, Jun 6, 2012 at 2:31 AM, Manish Gupta > wrote: > > Hi, > > > > I want to read command line parameter in Sweave. How this can be done.

[R] cluster algorithm with fixed cluster size

2012-06-06 Thread Martin Guetlein
Hi all, Does anyone know a cluster algorithm in R that allows to set the cluster size (not the number of clusters) to a fixed value? With best regards, Martin -- Dipl-Inf. Martin Gütlein Phone: +49 (0)761 203 7633 (office) +49 (0)177 623 9499 (mobile) Email: guetl...@informatik.uni-freiburg.

[R] randomForest Species Distribution Modelling

2012-06-06 Thread Fionn
Hi, I appologise if this is a rudimentary question and long winded but I just wanted to let ye know where I'm comming from. I'm new to R and I'm trying to use the 'randomForest' package to classify and predict. The Error message that is troubling me is: > pr<-predict(predictors,rf1, ext=ext) Error

  1   2   >