[R] div, curl, grad, laplacian and Poisson solver.

2012-06-07 Thread Pascal Oettli
Good morning/afternoon/evening, Using R, I am trying to calculate stream function (psi) and velocity potential (phi) from both 2D zonal (u) and meridional wind (v). I Stream function The stream function can be obtained from the vorticity (vorticity): vorticity = curl(u,v) or in other terms: 

Re: [R] "Re-creating" distributions

2012-06-07 Thread Bert Gunter
Related comment: "Even the data aren't sufficient." -- Brian Joiner (some years ago). Explanation: See W.E. Deming on "analytic" vs "enumerative" statistics. --- Bert On Thu, Jun 7, 2012 at 8:06 PM, R. Michael Weylandt wrote: > Short answer: no, those are (in general) insufficient parameters t

Re: [R] extracting values from txt with regular expression

2012-06-07 Thread emorway
Hi Dan and Rui, Thank you for the suggestions, both were very helpful. Rui's code was quite fast...there is one more thing I want to explore for my own edification, but first I need some help fixing the code below, which is a slight modification to Dan's suggestion. It'll no doubt be tough to be

Re: [R] "Re-creating" distributions

2012-06-07 Thread R. Michael Weylandt
Short answer: no, those are (in general) insufficient parameters to characterize a distribution. Long answer: unfortunately, it's not uncommon that those "summary statistics" are the only ones reported based on someone or other's limited experience with the Gaussian. There are a few things you cou

Re: [R] changing font to italic for one entry in legend()

2012-06-07 Thread Vikram Chhatre
Thanks Paul. That worked beautifully. V On Thu, Jun 7, 2012 at 7:46 PM, Paul Murrell wrote: > Hi > > > On 8/06/2012 12:27 p.m., Vikram Chhatre wrote: >> >> Hello, >> >> I need to change the font for one of the items (C. elegans) in my >> legend to italic.  Can someone suggest how to accomplis

[R] changing font to italic for one entry in legend()

2012-06-07 Thread Vikram Chhatre
Hello, I need to change the font for one of the items (C. elegans) in my legend to italic. Can someone suggest how to accomplish this? legend('bottomright', bty='n', c('C. elegans range', 'Study area'), cex=0.8, fill=c('light gray', 'white'), border=c('black','black')) I tried using lab.font=c(

Re: [R] cluster algorithm with fixed cluster size

2012-06-07 Thread Martin Gütlein
Hi, okay, and which algorithm is it? I had a closer look at the manual and could not find it, but there is quite a number of methods in there, maybe I missed it. Thanks, Martin -- View this message in context: http://r.789695.n4.nabble.com/cluster-algorithm-with-fixed-cluster-size-tp4632523p463

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

2012-06-07 Thread Carlos Ortega
Hi Francesco, No, I haven't tried... But if you have some code I can try. Regards, Carlos Ortega www.qualityexcellence.es 2012/6/7 Francesco Nutini > Oh thank you Carlos! > I wasted a lot of time formatting my xyplot by powerpoint. > Did you used a similar tips for ternaryplot (vcd)? > >

[R] Query regarding SVD of binary matrix:

2012-06-07 Thread Angel Russo
Hello, I have a binary matrix of 80k sets (sets comprising of combination of cities) by 885 cities (dimension = 80k x 885). For matrix, 1 means city is a part of the set and 0 means the city is not part of the set. Sets are rows and cities are columns (city.test). I want to do feature reduction

Re: [R] degrees of freedom for contrast

2012-06-07 Thread Qian Liu
Hi, I need some help to figure out the df I should use in t test for my contrast. I have 5 treatments and 5 phenotypes, I would like to compute the difference of treatment means for each phenotype and do t test, such as treatment1 vs treatment2 on phenotype1 How should I calculate the pooled degree

[R] degrees of freedom for contrast

2012-06-07 Thread Qian Liu
Hi, I need some help to figure out the df I should use in t test for my contrast. I have 5 treatments and 5 phenotypes, I would like to compute the difference of treatment means for each phenotype and do t test, such as treatment1 vs treatment2 on phenotype1 How should I calculate the pooled degree

[R] RJava: Error obtaining System.out

2012-06-07 Thread Oliver Ruebenacker
Hello, Any idea why trying to obtain System.out in rJava does not work? > library(rJava) > .jinit() > s <- .jnew("java/lang/String", "Hello World!") > .jcall(s,"I","length") [1] 12 > systemOut <- .jfield("java/lang/System", "Ljava/io/PrintStream", "out") Error in .jfield("java/lang/System"

[R] "Re-creating" distributions

2012-06-07 Thread Andras Farkas
Dear All,   I often have to work with certain models in which I try to "reproduce" a distribution the best I can with very little known information avaible. Is there a package or function in R that could best reproduce a probability distribution using only the mean, median and SD values availble

[R] how lm behaves

2012-06-07 Thread Peter Palenchar
I was wondering if somebody could explain why I get different results here: >treats[,2]<-as.factor(treats[,2]) >treats[,5]<-as.factor(treats[,5]) >treats[,4]<-as.factor(treats[,4]) #there are 'c' on more days than I have 'h2o2', where treats[,4] is the day. I only want 'c' that correspond to the

[R] R2wd error in wdGet

2012-06-07 Thread Andreia Leite
Dear list, I'm trying to use R2wd package. I've installed the package and try wdGet(). However a error message came up. I'm presently using R 2.15.0 > wdGet() Error in if (wdapp[["Documents"]][["Count"]] == 0) wdapp[["Documents"]]$Add() : argument is of length zero Does anyone knows what this

Re: [R] Error in installing packages

2012-06-07 Thread Andreia Leite
Thank you for helping me to solve this question! -- View this message in context: http://r.789695.n4.nabble.com/Error-in-installing-packages-tp4632543p4632736.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

Re: [R] Quantile regression: Discrepencies Between optimizer and rq()

2012-06-07 Thread Roger Koenker
Optim() by default is using Nelder-Mead which is an extremely poor way to do linear programming, despite the fact that ?optim says that: "It will work reasonably well for non-differentiable functions."I didn't check your coding of the objective function fully, but at the very least you sho

[R] Quantile regression: Discrepencies Between optimizer and rq()

2012-06-07 Thread Kevin Chang
Hello Everyone, I'm currently learning about quantile regressions. I've been using an optimizer to compare with the rq() command for quantile regression. When I run the code, the results show that my coefficients are consistent with rq(), but the intercept term can vary by a lot. I don't thi

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

2012-06-07 Thread Rui Barradas
Hello, I've just read your follow-up question on regular expressions, and I believe this, your original problem, can be made much faster. Just use readLine() differently, reading large amounts of text lines at a time. For this to work you will still need to know the total number of lines in t

Re: [R] How do I obtain the current active path of a function that's being called?

2012-06-07 Thread Greg Snow
Wow, even those of us who have been using S for more than 25 years (and R since well before version 1.0) still have things to learn since R keeps improving. So I stand corrected (well sit actually) on the part about not keeping track of this sort of thing. On Thu, Jun 7, 2012 at 3:04 AM, Duncan M

Re: [R] select subrows based on a specific column in a matrix

2012-06-07 Thread Seungyeul Yoo
Dear Rui, Thank you so much. Yes, that function is what I wanted. I will make sure I post a data example for the next time. Thank you for your help again. Bests, Seungyeul On Jun 7, 2012, at 12:50 PM, Rui Barradas wrote: > Hello, > > You should post a data example, like the posting guide sa

Re: [R] extracting values from txt with regular expression

2012-06-07 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of emorway > Sent: Thursday, June 07, 2012 10:41 AM > To: r-help@r-project.org > Subject: [R] extracting values from txt with regular expression > > Thanks for your suggestions. Be

[R] extracting values from txt with regular expression

2012-06-07 Thread emorway
Thanks for your suggestions. Bert, in your response you raised my awareness to "regular expressions". Are regular expressions the same across various languages? Consider the following line of text: txt_line<-" PERCENT DISCREPANCY = 0.01 PERCENT DISCREPANCY = -0.05" It s

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

2012-06-07 Thread Greg Snow
I think the problem is with fonts and encodings. The pdf device is using a different font and/or encoding than the screen device and so the non-ascii characters are looking different. If you can convince the pdf driver to use the same font and encoding then the symbols/characters in the plot shou

Re: [R] select subrows based on a specific column in a matrix

2012-06-07 Thread Rui Barradas
Hello, You should post a data example, like the posting guide says. If your dataset is large, use something like dput(head(dat, 20)) # paste the output of this in your post. where 'dat' is your dataset. Now, try # make up some data set.seed(12) dat <- matrix(c(sort(rnorm(10)), sample(let

Re: [R] Trouble with Functions

2012-06-07 Thread Peter Ehlers
On 2012-06-06 12:45, dougmcintosh wrote: 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 TextWran

Re: [R] How to set cookies in RCurl

2012-06-07 Thread mdvaan
Thanks for the fast response. I am not sure how to enter the proxy info in the call. I am working via EZProxy (which I think, rewrites a URL). According to their website it does this: 1. Within the config.txt/ezproxy.cfg file, various hosts are identified that require access from a local IP add

[R] select subrows based on a specific column in a matrix

2012-06-07 Thread Seungyeul Yoo
Hi all, I have a matrix with 1 rows and 10 columns. The last columns contains another identifiers but the values are not uniques so that I want to generate another matrix with rows with unique values in the last column. If I did tmp<-unique(my_mat$col10) this will give me 8560 unique ent

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

2012-06-07 Thread David Winsemius
On Jun 7, 2012, at 11:34 AM, maxbre wrote: a new session of R with the following sessionInfo() Part of the confusion may be that you have reversed the colors for mean and median in two different examples. The other confusion may be that mean(log(.)) != log(mean(.)) this is the code

Re: [R] How to set cookies in RCurl

2012-06-07 Thread Duncan Temple Lang
Apologies for following up on my own mail, but I forgot to explicitly mention that you will need to specify the appropriate proxy information in the call to getURLContent(). D. On 6/7/12 8:31 AM, Duncan Temple Lang wrote: > To just enable cookies and their management, use the cookiefile > optio

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

2012-06-07 Thread maxbre
a new session of R with the following sessionInfo() R version 2.15.0 (2012-03-30) Platform: i386-pc-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=Italian_Italy.1252 LC_CTYPE=Italian_Italy.1252 [3] LC_MONETARY=Italian_Italy.1252 LC_NUMERIC=C [5] LC_TIME=Italian_Italy.1252

Re: [R] flagging values without a loop

2012-06-07 Thread andrija djurovic
Hi. Yes it is possible. Here is one approach: DF <- read.table(textConnection(" Unit DayHour Price Flag afd11/2/20031 1 N afd11/2/20031 2 N afd11/2/20031 3 N afd11/2/20031 4 Y dcf11/2/2003

Re: [R] How to set cookies in RCurl

2012-06-07 Thread Duncan Temple Lang
To just enable cookies and their management, use the cookiefile option, e.g. txt = getURLContent(url, cookiefile = "") Then you can pass this to readHTMLTable(), best done as content = readHTMLTable(htmlParse(txt, asText = TRUE)) The function readHTMLTable() doesn't use RCurl and doesn't

Re: [R] flagging values without a loop

2012-06-07 Thread R. Michael Weylandt
In two steps, you could use ave() to split by hour and find the maximum of price and then use an ifelse clause on the resulting vector to see when that actually equals the given price and assign "Y"/"N" appropriately, I'll leave the implementation as an exercise to the reader :-) Best, Michael O

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

2012-06-07 Thread Saana Isojunno
Thanks for the suggestions! Unfortunately I get same trap whether I input the data as a named list, list of the names, or text file. I tried the three with and without transposing the matrices (I didn't change the model structure indexing but this should appear as an indexing error later on). Goo

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

2012-06-07 Thread Achim Zeileis
On Wed, 6 Jun 2012, Prof Brian Ripley wrote: 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.f

[R] How to set cookies in RCurl

2012-06-07 Thread mdvaan
Hi, I am trying to access a website and read its content. The website is a restricted access website that I access through a proxy server (which therefore requires me to enable cookies). I have problems in allowing Rcurl to receive and send cookies. The following lines give me: library(RCurl) l

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

2012-06-07 Thread Tim Smith
Hi, Here is the corrected code: library(ggplot2) 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),position) colnames(mdat) <- c('ID','T

Re: [R] Relative frequencies in table

2012-06-07 Thread Patrick Hubers
Thanks a lot! Takes some fiddling, but it works great. Regards, Patrick 2012/6/7 Rmh > please look at the likert function in the HH package. It is designed for > this type of study. > > ?likert has many examples similar to yours. > > > Rich > > [[alternative HTML version deleted]] __

[R] flagging values without a loop

2012-06-07 Thread jcrosbie
For a given hour I want to be able to add a new column called flag. The flag column will flag the highest price in a given hour. Is there a way to do this without a loop? matrix: Unit, Day,Hour, Price, Flag afd11/2/20031 1 N afd11/2/20031 2

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

2012-06-07 Thread John Kane
Well, a brute force and stupidity approach with geom_text will work but it's not aesthetically very nice. Note I did not play around with text size. Try : ggplot(mdat, aes(position, value)) + geom_point(aes(colour = Treatment)) + geom_rug(subset = .(position < 14),aes(y=NUL

[R] divide factor in n equal groups?

2012-06-07 Thread David Studer
Could anyone please tell me what is the most elegant way to divide an ordinal variable in equal groups? (as cut() does with continous variables) for example I'd like to have the factor "educational level" in three groups "low" "medium" and "high" Thank you! David [[alternative HTML versi

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

2012-06-07 Thread David Winsemius
On Jun 7, 2012, at 10:23 AM, maxbre wrote: thanks kimmo I managed to get the desired result by first plotting the medians and then adding the means through the user defind function posted in thread you mentioned (here it is http://r.789695.n4.nabble.com/Adding-mean-line-to-a-lattice-density

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

2012-06-07 Thread maxbre
thanks kimmo I managed to get the desired result by first plotting the medians and then adding the means through the user defind function posted in thread you mentioned (here it is http://r.789695.n4.nabble.com/Adding-mean-line-to-a-lattice-density-plot-td4455770.html#a4456502) # start dotplot(v

Re: [R] table function in a matrix

2012-06-07 Thread Sarah Auburn
Perfect, thank you! From: Petr Savicky To: r-help@r-project.org Sent: Thursday, 7 June 2012, 19:42 Subject: Re: [R] table function in a matrix On Wed, Jun 06, 2012 at 11:02:46PM -0700, Sarah Auburn wrote: > Hi, > I am trying to get a summary of the counts of

Re: [R] Basic question about confidence intervals

2012-06-07 Thread David Winsemius
On Jun 7, 2012, at 7:30 AM, Mohan Radhakrishnan wrote: Hi, I am again asking a generic question and the general response for such questions is cold. I am a beginner but use and write simple R scripts. Have you read the Posting Guide? "If the question is well-asked and of interes

Re: [R] graphic problems with special characters

2012-06-07 Thread John Kane
I think we need some data and code. Would you please provide some sample data (see ?dput for a handy way to provide data) and some working code that demonstrates the problem? John Kane Kingston ON Canada > -Original Message- > From: leray.guilla...@gmail.com > Sent: Thu, 7 Jun 2012 11:

Re: [R] Abrupt closure of R when using .C function

2012-06-07 Thread peter dalgaard
On Jun 7, 2012, at 12:52 , Nouedoui Laetitia wrote: > Hi Everyone, > > This is my first message on this discussion list. > I create a R function which includes a .C function. I didn't get any error > neither from "C side", nor from "R side". I tried to put proper type in R. > > But the problem

Re: [R] Relative frequencies in table

2012-06-07 Thread Rmh
please look at the likert function in the HH package. It is designed for this type of study. ?likert has many examples similar to yours. Rich Sent from my iPhone On Jun 7, 2012, at 8:42, Patrick Hubers wrote: > Hi, > > I'm trying to create a stacked bar plot with the satisfaction scores f

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

2012-06-07 Thread K. Elo
Hi! I recently posted a similar question (entitled "Adding mean line to a lattice density plot"). Have not got any usable solution forcing my to fall back to the use of the normal 'plot' function. The problem was the same as yours: using panel.abline simply did not work, the position of the m

[R] Relative frequencies in table

2012-06-07 Thread Patrick Hubers
Hi, I'm trying to create a stacked bar plot with the satisfaction scores from a customer satisfaction survey. I have results for three stores over several weeks and want to create a weekly graph with a stacked bar for each store. I can flatten the dataframe into a table with absolute frequencies,

Re: [R] How to build a large identity matrix faster?

2012-06-07 Thread Spencer Graves
On 6/7/2012 2:27 AM, Rui Barradas wrote: Hello, To my great surprise, on my system, Windows 7, R 15.0, 32 bits, an R version is faster! I was also surprised, Windows 7, R 2.15.0, 64-bit > rbind(diag=t1, Rdiag=t2, ratio=t1/t2) user.self sys.self elapsed user.child sys.child diag

[R] Abrupt closure of R when using .C function

2012-06-07 Thread Nouedoui Laetitia
Hi Everyone, This is my first message on this discussion list. I create a R function which includes a .C function. I didn't get any error neither from "C side", nor from "R side". I tried to put proper type in R. But the problem is that I get an abrupt closure of R, with the following messa

[R] Rare event in logistic regression

2012-06-07 Thread Bharat Warule
Hello, I am working with logistic analysis in which event rate is 0.005% with large requirds. Is there is any R package which handle rare event in logistic regression. Please let me know? Thanks for your help. Thanks, Bharat - Bharat Warule Cypress Analytica , Pune -- View this messag

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

2012-06-07 Thread maxbre
...and what if I need to plot another vertical line for showing also the means for each panel? by simply adding another call to panel.abline () seems not producing a correct result for each panel # medians and means for each panel: dotplot(variety ~ yield | site, data = barley, scales=list(

Re: [R] Basic question about confidence intervals

2012-06-07 Thread Mohan Radhakrishnan
Apology. The formulas are munged. I am referring to 'APPENDIX: Confidence Intervals' in the paper at http://www.cse.iitb.ac.in/~puru/courses/spring12/cs695/downloads/cuttingcorners.pdf Mohan -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On

[R] Basic question about confidence intervals

2012-06-07 Thread Mohan Radhakrishnan
Hi, I am again asking a generic question and the general response for such questions is cold. I am a beginner but use and write simple R scripts. I am looking for some ideas to calculate the confidence intervals based on this excerpt from the paper. Moreover it would help i

Re: [R] How to build a large identity matrix faster?

2012-06-07 Thread Rui Barradas
Em 07-06-2012 11:26, Prof Brian Ripley escreveu: On 07/06/2012 10:27, Rui Barradas wrote: Hello, To my great surprise, on my system, Windows 7, R 15.0, 32 bits, an R version is faster! Faster than what? diag() is written entirely in R, just more general than yours and so one would expect it

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

2012-06-07 Thread Francesco Nutini
Oh thank you Carlos!I wasted a lot of time formatting my xyplot by powerpoint.Did you used a similar tips for ternaryplot (vcd)? Many thanks.Regards,Francesco Date: Wed, 6 Jun 2012 17:08:39 +0200 Subject: Re: [R] [r] par and complex graph From: c...@qualityexcellence.es To: nutini.france..

Re: [R] How to build a large identity matrix faster?

2012-06-07 Thread Prof Brian Ripley
On 07/06/2012 10:27, Rui Barradas wrote: Hello, To my great surprise, on my system, Windows 7, R 15.0, 32 bits, an R version is faster! Faster than what? diag() is written entirely in R, just more general than yours and so one would expect it to be slower. I have to say that we don't see a

Re: [R] Error in installing packages

2012-06-07 Thread Uwe Ligges
On 07.06.2012 00:09, Martin Morgan wrote: 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 ver

Re: [R] table function in a matrix

2012-06-07 Thread Petr Savicky
On Wed, Jun 06, 2012 at 11:02:46PM -0700, Sarah Auburn wrote: > Hi, > I am trying to get a summary of the counts of different variables for each > sample in a matrix of the form "m" below to generate an output as shown. > (Ultimately I want to generate a stacked barchart for each sample). I am on

[R] graphic problems with special characters

2012-06-07 Thread guillaume Le Ray
Hi, I am actually working on some auto-routine to import XML file, run some analysis on them and create graph as jpeg. The files are in different language french/english/danish even chinese. At the moment I'm focusing on the European language. I import them using the XML package and specify encodi

Re: [R] How to build a large identity matrix faster?

2012-06-07 Thread Rui Barradas
Hello, To my great surprise, on my system, Windows 7, R 15.0, 32 bits, an R version is faster! Rdiag <- function(n){ m <- matrix(0, nrow=n, ncol=n) m[matrix(rep(seq_len(n), 2), ncol=2)] <- 1 m } Rdiag(4) n <- 5e3 t1 <- system.time(d1 <- diag(n)) t2 <- system.time(d2

Re: [R] Rare event in logistic regression

2012-06-07 Thread Özgür Asar
Hi, Please see the discussion at http://r.789695.n4.nabble.com/regression-methods-for-rare-events-td4632332.html Ozgur -- View this message in context: http://r.789695.n4.nabble.com/Rare-event-in-logistic-regression-tp4632656p4632658.html Sent from the R help mailing list archive at Nabble.com

Re: [R] How do I obtain the current active path of a function that's being called?

2012-06-07 Thread Duncan Murdoch
On 12-06-05 4:58 PM, Michael wrote: Hi all, How do I obtain the current active path of a function that's being called? That's to say, I have several source files and they all contain definition of function A. I would like to figure out which function A and from which file is the one that's bei

[R] Use fitted Garch models in linear regression

2012-06-07 Thread henmarco
Hi I am analysing a data set of daily S&P 500 Index returns and my goal is to elaborate a relationship with a sentiment indicator (daily data). For this purpose I fitted a model to each variable. I found that a GARCH (1,1) suits best for the differenced closing price of the SPX and a GARCH (2,2)

[R] How to build a large identity matrix faster?

2012-06-07 Thread Ceci Tam
Hello, I am trying to build a large size identity matrix using diag(). The size is around 23000 and I've tried diag(23000), that took a long time. Since I have to use this operation several times in my program, the running time is too long to be tolerable. Are there any alternative for diag(N)? Tha

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

2012-06-07 Thread Manish Gupta
Hi, I followed the link u provided but getting some error. R -e "Sweave('MyReport.Rnw')" --args PatientId=1 i am keeping commandArgs(TRUE) in my Rnw file. print(PatientId) // Error: chunk 2 Error in print(PatientId) : object 'PatientId' not found Execution halted Any working example will help

[R] table function in a matrix

2012-06-07 Thread Sarah Auburn
Hi, I am trying to get a summary of the counts of different variables for each sample in a matrix of the form "m" below to generate an output as shown. (Ultimately I want to generate a stacked barchart for each sample). I am only able to get the "table" function to work on one sample (column) at

Re: [R] - detecting outliers

2012-06-07 Thread Özgür Asar
Hi, I believe that first learning the appropriate statistical methods to detect the outliers and searching for the related functions in R is a better way. Ozgur -- View this message in context: http://r.789695.n4.nabble.com/detecting-outliers-tp4632636p4632637.html Sent from the R help mailing

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

2012-06-07 Thread arun
Hi, Try this,> dat1 <- data.frame(x=rep(1,6),y=rep(1:3,2), fac=sample(L3, 6, replace=TRUE)) > dat1   x y fac 1 1 1   C 2 1 2   B 3 1 3   B 4 1 1   A 5 1 2   B 6 1 3   B > dat1[dat1$x==1&dat1$y==1,1:2]<-NA > dat1    x  y fac 1 NA NA   C 2  1  2   B 3  1  3   B 4 NA NA   A 5  1  2   B 6  1  3   B

[R] [R-pkgs] New version of the TraMineR package (1.8-2)

2012-06-07 Thread Gilbert Ritschard
Hi all, It is our pleasure to announce that the new version 1.8-2 of TraMineR has been released on the CRAN. Alongside the fixes of a series of small bugs and some speed improvements, the main changes are: - a new information display when creating state sequence object which permits

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

2012-06-07 Thread Jim Lemon
On 06/07/2012 08:08 AM, Faz Jones wrote: 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. Hi Jones, Unfortunately, you might as well have attached

[R] Bill Veanables Workshop

2012-06-07 Thread Antony Unwin
Bill Venables talks R :: Augsburg University, Germany :: 2-3 July 2012 Bill Venables will give a two-day R Workshop in Augsburg on the 2nd and 3rd July 2012, an expanded version of the course, which he has been invited to give at this year's useR! meeting in Nashville. Details: www.math.uni-aug

Re: [R] - detecting outliers

2012-06-07 Thread Rui Barradas
Hello, Had you looked more, and you would have seen R-help discussions on what is an outlier. Almost unanimously, an ill defined concept. In your problem, predators don't eat all eggs that they are given except for one case, 38 were given and all 38 were eaten. You can detect this in R with

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

2012-06-07 Thread peter dalgaard
On Jun 7, 2012, at 09:25 , Rui Barradas wrote: > Hello, > > Try option stringsAsFactors, see ?read.csv or ?read.table > As for the thousands separator, see ?format help(as.Date) should also help. (Hint: there's no dateFormat= argument) > > Hope this helps, > > Rui Barradas > > Em 07-06-2012

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

2012-06-07 Thread Rui Barradas
Hello, Try option stringsAsFactors, see ?read.csv or ?read.table As for the thousands separator, see ?format Hope this helps, Rui Barradas Em 07-06-2012 03:09, eric escreveu: How do I fix this error ? I tried coercion to a vector but that didn't work. msci <-read.csv("..MSCIexUS.csv", header

Re: [R] - detecting outliers

2012-06-07 Thread Ben Bolker
Joachim Audenaert pcsierteelt.be> writes: > > 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? Th

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

2012-06-07 Thread maxbre
thanks ilai sorry, I mixed up a little: I was thinking to medians of each panel but instead I was trying to plot medians for each variety (what an awful chart, indeed!) thanks for your solution (medians for each panel), it works perfectly, as usual... cheers max -- View this message in context

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

2012-06-07 Thread Thomas Petzoldt
On 6/6/2012 3:50 PM, mhimanshu wrote: 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 inc

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

2012-06-07 Thread peter dalgaard
On Jun 7, 2012, at 07:28 , Bert Gunter wrote: > 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. > Or, use the assignment form of is.na: cond <-