Re: [R] [klaR package] [NaiveBayes] warning message numerical 0 probability

2011-11-10 Thread Ted Chang
Uwe Ligges ligges at statistik.tu-dortmund.de writes: On 03.11.2010 16:26, Fabon Dzogang wrote: Hi, I run R 2.10.1 under ubuntu 10.04 LTS (Lucid Lynx) and klaR version 0.6-4. I compute a model over a 2 classes dataset (composed of 700 examples). To that aim, I use the function

[R] reshape - reshape2 problem

2011-11-10 Thread Johannes Radinger
Hi, I'd like to use the reshape2 package for melting datasets. The problem is that I've also loaded the gglot2 package which automatically loads the reshape-package. And the reshape is masking my reshape2. Thats why I tried reshape2::melt(df_test,id=c(X1,

Re: [R] reshape - reshape2 problem

2011-11-10 Thread Johannes Radinger
Have you tried loading reshape2 after ggplot2 and all it's requirements? Usually whatever is loaded last masks earlier loaded packages with functions of the same name so if reshape2 is last then it should mask reshape(1) and all of it's similarly named functions. Brandon Yes, reshape2

Re: [R] reshape - reshape2 problem

2011-11-10 Thread Johannes Radinger
Am 10.11.2011 um 09:54 schrieb Brandon Hurr: Is the value.name ignored as well? Looks like it might have been left out of the function call? reshape2::melt function (data, ..., na.rm = FALSE, value.name = value) { UseMethod(melt, data) } environment: namespace:reshape2

Re: [R] [klaR package] [NaiveBayes] warning message numerical 0 probability

2011-11-10 Thread Uwe Ligges
On 10.11.2011 09:00, Ted Chang wrote: Uwe Liggesliggesat statistik.tu-dortmund.de writes: On 03.11.2010 16:26, Fabon Dzogang wrote: Hi, I run R 2.10.1 under ubuntu 10.04 LTS (Lucid Lynx) and klaR version 0.6-4. I compute a model over a 2 classes dataset (composed of 700 examples). To

Re: [R] lapply to list of variables

2011-11-10 Thread Kenn Konstabel
Hi hi, It is much easier to deal with lists than a large number of separate objects. So the first answer to your question How can I apply a function to a list of variables. .. might be to convert your list of variables to a regular list. Instead of ... monday - 1:3 tuesday - 4:7 wednesday -

Re: [R] Error in axis ????

2011-11-10 Thread Uwe Ligges
This is plot.xts that generates the error. Argument col seems to be unsuppotred. Please ask the package maintainer or send patches to improve the xts package. Uwe Ligges On 10.11.2011 04:38, eric wrote: Recently updated my packages (update.packages() and also updated rstudio to the latest

Re: [R] Web based R-help not a list

2011-11-10 Thread Duncan Murdoch
On 11-11-09 6:03 PM, Sean Robert McGuffee wrote: On 11/9/11 7:22 PM, David Winsemiusdwinsem...@comcast.net wrote: On Nov 9, 2011, at 5:38 PM, Cem Girit wrote: 2. My mailbox do not overflow with emails so that I do not need to edit it every day Yes. You were offered an option to

Re: [R] Error in axis ????

2011-11-10 Thread Duncan Murdoch
On 11-11-09 10:34 PM, eric wrote: I did an update of both rstudio and my packages. I had some trouble but was able to move a lot of the packages so most troubles seem to be behind me. But having a problem with code that previously ran fine. See below: require(quantmod) Loading required package:

Re: [R] Error in Summary.factor(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 4L, : max not meaningful for factors

2011-11-10 Thread Duncan Murdoch
On 11-11-10 12:11 AM, Alex DJ wrote: Hello, Beginner, sorry if this is wasting anyone's time, but have been working on this for a couple of days now, think it should have take a few hours! The Problem: Error in Summary.factor(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 4L, : max not

[R] library(qpcR) cbind.na

2011-11-10 Thread Evgenia
I want to use function cbind.na at library(qpcR) I install package qpcR and I can use functions such m1 - pcrfit(reps, 1, 2, l5) AICc(m1) [1] -102.5843 but when i try cbind.na(1, 1:7) i take message Error: could not find function cbind.na Thanks -- View this message in context:

Re: [R] Web based R-help not a list

2011-11-10 Thread Petr PIKAL
On Nov 9, 2011, at 5:38 PM, Cem Girit wrote: Hello, Is there a web version of this R-Help user group snip Yes. You were offered an option to get a digest when you signed up. I'm not sure if this response answers the question. It seems to me that there

Re: [R] library(qpcR) cbind.na

2011-11-10 Thread Sarah Goslee
Did you try qpcR:::cbind.na(1, 1:7) as specified in the help files? cbind.na isn't exported in the namespace, but can still be used as above. The examples in the documentation show this. Sarah On Thu, Nov 10, 2011 at 6:38 AM, Evgenia ev...@aueb.gr wrote: I want to use function cbind.na at

Re: [R] reshape - reshape2 problem

2011-11-10 Thread Johannes Radinger
Hi, I tried that before but then I get: Error: 'melt.data.frame' is not an exported object from 'namespace:reshape2' Strange that this is working in your case but not in my case. Some addtional info about my package versions: R 2.14.0 reshape 0.8.4 reshape 1.1 ggplot2 0.8.9 cheers /j

Re: [R] library(qpcR) cbind.na

2011-11-10 Thread Evgenia
Yes, I dit it. I got the same error message qpcR:::cbind.na(1, 1:7) Error in get(name, envir = asNamespace(pkg), inherits = FALSE) : object 'cbind.na' not found -- View this message in context: http://r.789695.n4.nabble.com/library-qpcR-cbind-na-tp4023339p4023489.html Sent from the R help

Re: [R] library(qpcR) cbind.na

2011-11-10 Thread Sarah Goslee
Then we likely need to know the information requested in the posting guide, including your version of R and OS; the output of sessionInfo() at the very least. And please send your replies to the list, not just me. Sarah 2011/11/10 ev...@aueb.gr: Yes, I dit it. I got the same error message

Re: [R] Error in Summary.factor(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 4L, : max not meaningful for factors

2011-11-10 Thread Alex DJ
Thanks Duncan. This is a package, SIAR. fo - ordered(f) fo [1] a b c d e Levels: a b c d e max(fo) [1] e Levels: a b c d e The data set has 101 values, what can I use instead of letters? Best wishes, Alex. -- View this message in context:

[R] Creating dummys in R

2011-11-10 Thread David .
Dear R-project! How do i create 1 dummy from 2 already existing dummys. To be more precise, I want to create a dummy from a dummy called sex and another called sex1 when both thoose dummys are 1 I want my created dummy samesex to take 1. Thanks for the help! Paulie

Re: [R] reshape - reshape2 problem

2011-11-10 Thread Brandon Hurr
Have you tried loading reshape2 after ggplot2 and all it's requirements? Usually whatever is loaded last masks earlier loaded packages with functions of the same name so if reshape2 is last then it should mask reshape(1) and all of it's similarly named functions. Brandon On Thu, Nov 10, 2011 at

Re: [R] reshape - reshape2 problem

2011-11-10 Thread Brandon Hurr
Is the value.name ignored as well? Looks like it might have been left out of the function call? reshape2::melt function (data, ..., na.rm = FALSE, value.name = value) { UseMethod(melt, data) } environment: namespace:reshape2 Brandon On Thu, Nov 10, 2011 at 08:45, Johannes Radinger

Re: [R] determine length of bivariate polynomial

2011-11-10 Thread Nicolas Schuck
I was thinking of an analytical solution, but using diff() works great as well! thanks for help, nico On Nov 10, 2011, at 2:55 AM, R. Michael Weylandt wrote: I think this will do it: sum(sqrt(diff(x.pred)^2 + diff(y.pred)^2)) Michael On Tue, Nov 8, 2011 at 11:34 AM, Nicolas Schuck

[R] Removing numbers from a list

2011-11-10 Thread vioravis
I am using gsub to remove numbers for each element of a list. Code is given below. testList - list(this contains a number 1000,this does not contain) removeNumbers - function(X) { gsub(\\d,,X) } outputList - lapply(testList,removeNumbers) However, when I try to find the number of

[R] Removing outliers

2011-11-10 Thread Filipe Ferminiano Rodrigues
Hi, I want to remove the outliers of my database with the following program (an observation is considered an outlier if it is bigger than second quartile + 1,5* distance interquartiles or less than second quartile - 1,5*distance interquartiles): for(i in 1:length(dados)){ q3=quantile(dados[i],

Re: [R] reshape - reshape2 problem

2011-11-10 Thread Luciano Selzer
I had the same issue. The problem is that melt will call a method. The method will dispach melt.data.frame from reshape package, thus ignoring reshape2. The solution is to call specificly reshape2::melt.data.frame() HTH Luciano 2011/11/10 Johannes Radinger jradin...@gmx.at: Am 10.11.2011 um

Re: [R] Web based R-help not a list

2011-11-10 Thread Alex DJ
Hello, Only answer to one but: 1. I can do a search on any topic over thousands of posts on R easily and effectively = www.rseek.org -- View this message in context: http://r.789695.n4.nabble.com/Web-based-R-help-not-a-list-tp4021752p4023359.html Sent from the R help mailing list

Re: [R] reshape - reshape2 problem

2011-11-10 Thread Luciano Selzer
Sorry, it's reshape2:::melt.data.frame() Luciano 2011/11/10 Johannes Radinger jradin...@gmx.at: Hi, I tried that before but then I get: Error: 'melt.data.frame' is not an exported object from 'namespace:reshape2' Strange that this is working in your case but not in my case. Some

Re: [R] Removing outliers

2011-11-10 Thread jim holtman
It is hard to tell with reproducible example; e.g., you data is missing. At least provide 'str(dados)' so we have an idea of what it looks like. My guess is that you want 'dados[[i]]' instead of 'dados[i]'. Also a stack trace would be useful. There was a discussion yesterday about trapping

Re: [R] Error in Summary.factor(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 4L, : max not meaningful for factors

2011-11-10 Thread David Winsemius
On Nov 10, 2011, at 6:12 AM, Alex DJ wrote: Thanks Duncan. This is a package, SIAR. fo - ordered(f) fo [1] a b c d e Levels: a b c d e max(fo) [1] e Levels: a b c d e The data set has 101 values, what can I use instead of letters? Why not as.numeric(fo)? -- View this

Re: [R] Removing numbers from a list

2011-11-10 Thread jim holtman
This is probably what you want: outLength - lapply(outputList, function(x)length(strsplit(x, ' ')[[1]])) outLength [[1]] [1] 4 [[2]] [1] 4 notice that 'outputList' is a 'list' and not a legal argument to strsplit. On Thu, Nov 10, 2011 at 5:29 AM, vioravis viora...@gmail.com wrote: I am

Re: [R] Creating dummys in R

2011-11-10 Thread jim holtman
Not sure what you mean by 'dummies'; do you mean 'objects'? samesex - sex == sex1 Examples of the data would help in the formulation of an answer. On Thu, Nov 10, 2011 at 5:13 AM, David . loove...@hotmail.com wrote: Dear R-project! How do i create 1 dummy from 2 already existing dummys. To

[R] 2^k*r experimental design and anova

2011-11-10 Thread Giovanni Azua
Hello, Can anyone point me to an online tutorial or book containing the easiest way to do ANOVA over the result data from a 2^k*r experiment. It is not clear to me if I can pass the raw data corresponding to each experiment or just the summarized data i.e. mean, sse, std, etc. I would like to

Re: [R] Creating dummys in R

2011-11-10 Thread Sarah Goslee
Without having any actual idea what you mean (sample data!), this might work: sex - c(1,0,1,0) sex1 - c(1,1,0,0) samesex - ifelse(sex == 1 sex1 == 1, 1, 0) Note that this does NOT return 1 if both initial variables are 0, so it isn't really a samesex indicator, but it is my best guess as to

[R] ggplot2 - regression statistics how to display on plot

2011-11-10 Thread Durant, James T. (ATSDR/DTEM/PRMSB)
Hello - So I am trying to use ggplot2 to show a linear regression between two variables, but I want to also show the fit of the line on the graph as well. I am using ggplot2 for other graphics in what I am working on, so even though this would be a fairly easy thing to do in Excel, I would

Re: [R] Creating dummys in R

2011-11-10 Thread P.B. Lecavalier
Hi, Try ifelse function. samesex - ifelse( sex==1 sex1==1, yes=1, no=0) Cheers Philippe Baril Lecavalier On 2011-11-10 8:03 AM, David . loove...@hotmail.com wrote: Dear R-project! How do i create 1 dummy from 2 already existing dummys. To be more precise, I want to create a dummy from a

[R] [R-pkgs] maps package updated databases

2011-11-10 Thread Ray Brownrigg
The latest version, maps_2.2-2 (appearing soon on CRAN), has been enhanced with the state.vbm and state.carto databases (thanks to Simon Urbanek), and the state.fips, county.fips (both thanks to Clint Cummins), state.vbm.center and state.carto.center datasets. Enjoy, Ray Brownrigg

Re: [R] How does once import a function from an imported script?

2011-11-10 Thread David Winsemius
On Nov 9, 2011, at 9:11 PM, Aimee Jones wrote: Hi all, I am trying to import some functions into a script and am having difficulty in doing so. I am able to import a series of functions from a .tex file into my script, and call on each function by column name, however R reads them as data

Re: [R] ggplot2 - regression statistics how to display on plot

2011-11-10 Thread Bryan Hanson
Jim, you can use the function appended below, which is part of package HandyStuff. If you want an example, see ?lmEqn after installing HandyStuff, available at github.com/bryanhanson/HandyStuff. Bryan lmEqn - function(df = NULL, y = NULL, x = NULL, method = lm, leg.loc = c(0, 0),

[R] Sum of the deviance explained by each term in a gam model does not equal to the deviance explained by the full model.

2011-11-10 Thread Huidong TIAN
Dear R users, I read your methods of extracting the variance explained by each predictor in different places. My question is: using the method you suggested, the sum of the deviance explained by all terms is not equal to the deviance explained by the full model. Could you tell me what caused

Re: [R] Error in Summary.factor(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 4L, : max not meaningful for factors

2011-11-10 Thread Petr PIKAL
Hi Thanks Duncan. This is a package, SIAR. fo - ordered(f) fo [1] a b c d e Levels: a b c d e max(fo) [1] e Levels: a b c d e The data set has 101 values, what can I use instead of letters? Why do you need to use letters? AFAIK this was only illustration

Re: [R] Creating dummys in R

2011-11-10 Thread Rob Griffin
hi Paulie, Further to Sarah’s email, this will give the same sex indicator (both 0 or both 1 then samesex scores 1): samesex-ifelse(sex==sex1,1,0) from what you have described this will give you the desired result hope that helps, Rob Robert M Griffin Department of Evolutionary Biology

Re: [R] Removing numbers from a list

2011-11-10 Thread David Winsemius
On Nov 10, 2011, at 5:29 AM, vioravis wrote: I am using gsub to remove numbers for each element of a list. Code is given below. testList - list(this contains a number 1000,this does not contain) removeNumbers - function(X) { gsub(\\d,,X) } outputList -

Re: [R] Creating dummys in R

2011-11-10 Thread David Winsemius
On Nov 10, 2011, at 8:41 AM, Sarah Goslee wrote: Without having any actual idea what you mean (sample data!), this might work: sex - c(1,0,1,0) sex1 - c(1,1,0,0) samesex - ifelse(sex == 1 sex1 == 1, 1, 0) sex sex1 [1] TRUE FALSE FALSE FALSE 0+(sex sex1) [1] 1 0 0 0 Note that

Re: [R] How does once import a function from an imported script?

2011-11-10 Thread R. Michael Weylandt
Going down the text parsing approach, you might want to use something like this: fnc - eval(parse(text=function(x) dnorm(x))) all.equal(1/sqrt(2*pi), fnc(0)) [1] TRUE On Thu, Nov 10, 2011 at 8:55 AM, David Winsemius dwinsem...@comcast.net wrote: On Nov 9, 2011, at 9:11 PM, Aimee Jones wrote:

Re: [R] Upgrade R?

2011-11-10 Thread Kevin Burton
Since apparently there is no one familiar with this error message let me rephrase the question. Is there a 'manual' process to fully remove a version of 'R' from my machine? This is a Window PC running Windows 7. Thank you. Kevin From: Kevin Burton [mailto:rkevinbur...@charter.net]

[R] A question on Programming

2011-11-10 Thread Christofer Bogaso
Dear all. Let say I have a group of codes which will be used in many places in my overall R-code files. These group of codes will be used within a for-loop (with a big length, like 1 times) and also many other places outside of that for loop. As this group of codes are being used in many

Re: [R] Stack trace?

2011-11-10 Thread Kevin Burton
Will traceback() work in the error routine specified in tryCatch? error - function(e) { traceback() } tryCatch(..., error=error) -Original Message- From: William Dunlap [mailto:wdun...@tibco.com] Sent: Wednesday, November 09, 2011 5:09 PM To: Thomas Lumley; rkevinbur...@charter.net

Re: [R] Upgrade R?

2011-11-10 Thread Steve_Friedman
Why don't you just download the latest release from CRAN - R. It is the recommended approach to installing R. Steve Friedman Ph. D. Ecologist / Spatial Statistical Analyst Everglades and Dry Tortugas National Park 950 N Krome Ave (3rd Floor) Homestead, Florida 33034 steve_fried...@nps.gov

Re: [R] Upgrade R?

2011-11-10 Thread Petr PIKAL
Hi Since apparently there is no one familiar with this error message let me rephrase the question. Is there a 'manual' process to fully remove a version of 'R' from my machine? This is a Window PC running Windows 7. Not sure about W7 but I can easily remove R installation by simple

Re: [R] Upgrade R?

2011-11-10 Thread Kevin Burton
I downloaded and installed the latest (2.14.0). It works just fine. But, I still have 2.13.2 installed and when I try to uninstall it I get the error that I showed at the beginning of this thread. -Original Message- From: steve_fried...@nps.gov [mailto:steve_fried...@nps.gov] Sent:

Re: [R] A question on Programming

2011-11-10 Thread Sarah Goslee
Hi, On Thu, Nov 10, 2011 at 10:07 AM, Christofer Bogaso bogaso.christo...@gmail.com wrote: Dear all. Let say I have a group of codes which will be used in many places in my overall R-code files. These group of codes will be used within a for-loop (with a big length, like 1 times) and also

Re: [R] A question on Programming

2011-11-10 Thread R. Michael Weylandt
Yes, there will be some reduction in speed: E.g., system.time(replicate(1e5, (function() sum(1:10))())) user system elapsed 0.696 0.022 0.729 system.time(replicate(1e5, sum(1:10))) user system elapsed 0.292 0.006 0.306 But it's not much: 3 tenths of a second for 10,000

Re: [R] A question on Programming

2011-11-10 Thread Joshua Wiley
Hi Christofer, Any speed reduction should be relatively small, and the advantage in terms of easily maintainable, clearly understandable code will be enormous. If the function you make from the code does not have any methods and you are concerned about a slow down related to your loop repeatedly

Re: [R] Upgrade R?

2011-11-10 Thread John Kane
You might want to try Revo Uninstaller. Reportedly it hunts down and kills just about anything connected to a program that you want to uninstall. I have only used it once but it seems to work. There is a free and a paid version. I have the free one. --- On Thu, 11/10/11, Kevin Burton

Re: [R] A question on Programming

2011-11-10 Thread jim holtman
You can always runs a quick test. Here a loop is repeated 10M times and the cost of the function call adds 344 ns; is this significant in your case? Probably not for the modularity that is gained. For your 10,000 loops, it would add 3.44 ms to the overall run (less than an blink of the eye).

Re: [R] A question on Programming

2011-11-10 Thread Duncan Murdoch
On 10/11/2011 10:28 AM, R. Michael Weylandt wrote: Yes, there will be some reduction in speed: E.g., system.time(replicate(1e5, (function() sum(1:10))())) user system elapsed 0.696 0.022 0.729 system.time(replicate(1e5, sum(1:10))) user system elapsed 0.292 0.006

Re: [R] A question on Programming

2011-11-10 Thread R. Michael Weylandt
Dr Murdoch, You're absolutely correct -- my apologies. Michael On Thu, Nov 10, 2011 at 10:44 AM, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 10/11/2011 10:28 AM, R. Michael Weylandt wrote: Yes, there will be some reduction in speed: E.g.,  system.time(replicate(1e5, (function()

[R] Title for a group of plots?

2011-11-10 Thread Kevin Burton
I can get multiple plots on a page like: op - par(mfcol = c(3, 1)) What I was wondering is if there is a way to have a title for the whole page? I can specify the title for each individual plot like: plot(xxx, main=.) But I would like a 'title' for the group of plots. Is this

Re: [R] Title for a group of plots?

2011-11-10 Thread Bert Gunter
?mtext (Note the outer argument) -- Bert On Thu, Nov 10, 2011 at 8:07 AM, Kevin Burton rkevinbur...@charter.netwrote: I can get multiple plots on a page like: op - par(mfcol = c(3, 1)) What I was wondering is if there is a way to have a title for the whole page? I can specify the

Re: [R] Title for a group of plots?

2011-11-10 Thread Sarah Goslee
Try ?mtext for information on how to plot into the outer margin of a group of plots. Sarah On Thu, Nov 10, 2011 at 11:07 AM, Kevin Burton rkevinbur...@charter.net wrote: I can get multiple plots on a page like: op - par(mfcol = c(3, 1)) What I was wondering is if there is a way to have

Re: [R] Upgrade R?

2011-11-10 Thread jose Bartolomei
Hi,Don't know if this will help you but...In my short experience and following the guidelines you should first uninstall R. http://cran.r-project.org/doc/manuals/R-admin.html#Installing-R-under-Windows Unistall it from the Windows control panel. The old R version libraries file will be kept on

Re: [R] Title for a group of plots?

2011-11-10 Thread Muhammad Rahiz
Perhaps something like this? par(oma=c(0,0,2,0)) par(mar=c(1,1,1,1)) par(mfcol=c(3,1)) plot(rnorm(10)) mtext(title) plot(rnorm(10)) plot(rnorm(10)) -- Muhammad Rahiz On Thu, 10 Nov 2011, Kevin Burton wrote: I can get multiple plots on a page like: op - par(mfcol = c(3, 1)) What I was

Re: [R] Upgrade R?

2011-11-10 Thread Bert Gunter
The advice below is wholly unnecessary, and, in fact, various versions of R can coexist without problems (and are designed to do so). I just upgraded to 2.14.0 on Windows via the simple binary install process, copied old libraries over (unnecessary if you do not wish to keep old versions around

Re: [R] library(qpcR) cbind.na

2011-11-10 Thread Evgenia
I have windows 7 and below is information about R and loading library(qpcR) R version 2.9.1 (2009-06-26) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain

Re: [R] 2^k*r experimental design and anova

2011-11-10 Thread Nicole Marie Ford
Sounds like you are hypotesis testing. you can try an R companion to applied regression 2nd edition 2011 by john fox and sanford weisberg. effects package does interactions quite well. - Original Message - From: Giovanni Azua brave...@gmail.com To: r-help@r-project.org Sent: Thursday,

Re: [R] Upgrade R?

2011-11-10 Thread Kevin Burton
I know they can coexist. It all works fine with both versions installed. But with limited resources I would like to uninstall the previous version (for me it is 2.13.1). Choosing uninstall from the 'Control Panel' results in the error listed at the beginning of this thread. From: Bert Gunter

Re: [R] library(qpcR) cbind.na

2011-11-10 Thread Sarah Goslee
Well, that's your problem. You need to upgrade to the latest version of R, and the latest version of qpcR. It's no wonder things found in the current version don't work correctly in software that's over two years old. Sarah On Thu, Nov 10, 2011 at 11:43 AM, Evgenia ev...@aueb.gr wrote: I have

Re: [R] Upgrade R?

2011-11-10 Thread Kevin Burton
The problem with this documentation is two-fold. One it seems to concentrate on building from source which I don't need. Two it doesn't address the upgade. I have a number of packages and so I need to do what has been suggested and install the latest version *first*. Then copy the libraries

Re: [R] Help: sqlSave Error

2011-11-10 Thread Jeff Newmiller
The error seems clear enough to me... sqlSave is trying to create the table but it already exists. Some possible directions you could take: 1) Do your work on a particular instance of the table within a single transaction and rollback at the end. 2) Delete the table before you run sqlSave. 3)

Re: [R] Help with gam

2011-11-10 Thread Paula McGee
From: Uwe Ligges ligges_at_statistik.tu-dortmund.de mailto:ligges_at_statistik.tu-dortmund.de?Subject=Re:%20[R]%20Help%20with%2 0gam Date: Wed, 11 May 2011 19:08:38 +0200 On 11.05.2011 17:22, Zsolt Macskasi wrote: Hi, http://tolstoy.newcastle.edu.au/R/e14/help/11/05/1036.html#1040qlink1

Re: [R] Removing outliers

2011-11-10 Thread Filipe Ferminiano Rodrigues
Thanks for the answer, but I already fixed the problem. The problem was in selecting the row and column of the matrix. The program fixed is: for(i in 1:length(dados)){ q3=quantile(dados*[,i]*, probs=.75) q2=quantile(dados*[,i]*, probs=.50) q1=quantile(dados*[,i]*, probs=.25) d=q3-q1 for(i2 in

[R] Error with Source()

2011-11-10 Thread ftonini
Hi everybody, I started to receive a weird message in R that I have never seen before...also I haven't found anything on google or on this forum about it. Whenever I use the command source(...) to point to one of my scripts, I get the following message: Error in source(myfunctions.R) :

[R] efpFunctional construction (strucchange package)

2011-11-10 Thread bonda
Hello, to understand better how efpFunctional works, I'm trying to construct my own functionals. But concerning already existing functionals I have some questions. With maxBB it is clear: functional = list(comp = function(x) max(abs(x)), time = max), with rangeBB: functional = list(time =

[R] Error with Source()

2011-11-10 Thread ftonini
Hi everybody, I started to receive a weird message in R that I have never seen before...also I haven't found anything on google or on this forum about it. Whenever I use the command source(...) to point to one of my scripts, I get the following message: Error in source(myfunctions.R) :

[R] counting columns that match criteria

2011-11-10 Thread JL Villanueva
Hi, I am a little new in R but I'm finding it extremely useful :) Here's my tiny question: I've got a table with a lot of columns. What I am interested now is to evaluate how many of 4 columns have a value greater than 1. I think it can be done with subset() but it will take a very long

[R] newbie's question : xyplot legend with a white background

2011-11-10 Thread PtitBleu
Hello, Sorry in advance for adding a silly question on this forum but I haven't found the right keywords to find a solution to this basic problem. I'm just looking a way to have a white background behind the legend to hide the grid. Thanks in advance. The silly example for my silly question:

Re: [R] ggplot2 - regression statistics how to display on plot

2011-11-10 Thread Dennis Murphy
Hi: Here's an example of how one might do this in a specific example using geom_text(). # Some fake data: df - data.frame(x = 1:10, y = 0.5 + (1:10) + rnorm(10)) # Fit a linear model to the data and save the model object: mod - lm(y ~ x, data = df) # Create a list of character strings - the

[R] grid.pack and grid.frame bewilder me

2011-11-10 Thread cheung zihong
Hello R friends, I get quite confused in using the grid graphic function grid.pack( ) and grid.frame ( ). Here is a simple example: library(grid) grid.frame(name=frame1) grid.pack(frame1,rectGrob(width=unit(0.5,npc), height=unit(0.5,npc), gp=gpar(col=red))) what I expect is a rectangle with

[R] request for post

2011-11-10 Thread LAXMI KANT TIWARI
please post my query in your mailing list -- LAXMI KANT TIWARI Andaman and Nicobar Space Application Cell PCCF'S Office, Van Sadan, Haddo - 744102 Port Blair, Andaman and Nicobar Islands, India Ph:+913192234430 Mobile:+919531839311 Alternate email: tiwari21...@itc.nl

Re: [R] Error in Summary.factor(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 4L, : max not meaningful for factors

2011-11-10 Thread Alex DJ
When you put (fo) what do you mean? With ordered variable am now getting this error message: model1 - siarmcmcdirichletv4(data, source, tef, concdep=0, 50, 5) Error in matrix(1, ncol = (numsources + numiso) * numgroups, nrow = (siardata$iterations - : invalid 'ncol' value (too

Re: [R] Error in Summary.factor(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 4L, : max not meaningful for factors

2011-11-10 Thread Alex DJ
The data set has 101 values, what can I use instead of letters? Why do you need to use letters? AFAIK this was only illustration what could be root of the error message. If the function requires ordered factor you can use your.ordered.factor - ordered(your.unordered.factor) I do not

Re: [R] Error with Source()

2011-11-10 Thread jim holtman
You have a syntax error in your script. Take a look around line 884 On Thu, Nov 10, 2011 at 9:27 AM, ftonini f_ton...@hotmail.com wrote: Hi everybody, I started to receive a weird message in R that I have never seen before...also I haven't found anything on google or on this forum about it.

Re: [R] counting columns that match criteria

2011-11-10 Thread jim holtman
try this: x Col1 Col2 Col3 Col4 11111 22111 34141 43333 apply(x, 1, function(a) sum(a 1)) [1] 0 1 2 4 x$count - apply(x, 1, function(a) sum(a 1)) x Col1 Col2 Col3 Col4 count 11111 0 22111

Re: [R] counting columns that match criteria

2011-11-10 Thread Jorge I Velez
Hi JL, How about the following? rowSums(d 1) # d is your data Best, Jorge.- On Thu, Nov 10, 2011 at 10:24 AM, JL Villanueva wrote: Hi, I am a little new in R but I'm finding it extremely useful :) Here's my tiny question: I've got a table with a lot of columns. What I am interested

[R] Gibbs sampler

2011-11-10 Thread Gyanendra Pokharel
I have the following code, gibbs -function(m,theta = 0.25, lambda =0.55, n =1){ alpha - 1.5 beta - 1.5 gamma - 1.5 x- array(0,c(m+1, 3)) x[1,1] - theta x[1,2] - lambda x[1,3]- n for(t in 2:(m+1)){ x[t,1] - rbinom(1, x[t-1,3], x[t-1,1])

Re: [R] efpFunctional construction (strucchange package)

2011-11-10 Thread Achim Zeileis
On Thu, 10 Nov 2011, bonda wrote: Hello, to understand better how efpFunctional works, I'm trying to construct my own functionals. But concerning already existing functionals I have some questions. With maxBB it is clear: functional = list(comp = function(x) max(abs(x)), time = max), with

[R] R package for segmentation with both continuous and categorical input variables XXXX

2011-11-10 Thread Dan Abner
Hello everyone, Can anyone suggest a decently documented (with good examples in the documentation) R package/function that performs segmentation (cluster, mixture modeling) of a population using both continuous and categorical input variables? Thank you, Dan [[alternative HTML version

Re: [R] newbie's question : xyplot legend with a white background

2011-11-10 Thread Dennis Murphy
Hi: Add a background = 'color' argument to key(): library('lattice') xyplot(1~1, panel = function(x,y, ...) { panel.xyplot(x,y) panel.abline(v=seq(0,1.4,by=0.1)) panel.abline(h=seq(0,1.4,by=0.1)) } ,key = list (x=0.2,

Re: [R] R to automate scatter plots

2011-11-10 Thread R. Michael Weylandt
It's usually encouraged to reply to the list as well for threading/archive reasons. (And because occasionally your first respondent will say something wrong and require correction -- I was called out just this morning...oops) Yes, you seem to be using it right to add a title to the plot but you

[R] optim seems to be finding a local minimum

2011-11-10 Thread Dimitri Liakhovitski
Hello! I am trying to create an R optimization routine for a task that's currently being done using Excel (lots of tables, formulas, and Solver). However, otpim seems to be finding a local minimum. Example data, functions, and comparison with the solution found in Excel are below. I am not

Re: [R] counting columns that match criteria

2011-11-10 Thread Dennis Murphy
Hi: Here's a toy example: # Default var names are V1-V20: u - as.data.frame(matrix(rpois(100, 3), ncol = 20)) u - transform(u, ngt1 = apply(u[, c('V1', 'V4', 'V9', 'V15')], 1, function(x) sum(x 1)) ) u HTH, Dennis On Thu, Nov 10, 2011 at 7:24 AM, JL Villanueva jlpost...@gmail.com wrote:

[R] Named components in a list

2011-11-10 Thread JulioSergio
I'm studying lists and I came to an example where L $name [1] Fred $wife [1] Mary $no.children [1] 4 $child.ages [1] 4 7 9 then following the instructions to extend the list with a new component, I executed: L[5] -list(NewName=something) and the new list I got was: L $name [1] Fred

Re: [R] Named components in a list

2011-11-10 Thread Sarah Goslee
Hi, On Thu, Nov 10, 2011 at 1:55 PM, JulioSergio julioser...@gmail.com wrote: I'm studying lists and I came to an example where L $name [1] Fred $wife [1] Mary $no.children [1] 4 $child.ages [1] 4 7 9 then following the instructions to extend the list with a new component, I

Re: [R] optim seems to be finding a local minimum

2011-11-10 Thread Dimitri Liakhovitski
Just to add: I also experimented with the starting parameters (par) under optim, especially with the second one. I tried 1, 10, 100, 1000, etc. When I tried 100,000,000 then I got a somewhat better solution (but still not as good as in Excel). However, under message it said: ERROR:

[R] unable to load Hmisc in R 2.14.0

2011-11-10 Thread Jacob Wegelin
On my MacBook Pro (OS 10.6.8), after updating to R version 2.14.0 (2011-10-31) and reinstalling the Hmisc package, I am unable to load the Hmisc library. Hmisc was working *before* I updated R. Any idea what's wrong? Details below. install.packages(Hmisc, dependencies=TRUE) trying URL

Re: [R] optim seems to be finding a local minimum

2011-11-10 Thread Bert Gunter
Refer to the CRAN Optimization task view, please. That is a much more appropriate place to begin than posting a query here. All numerical optimizers only produce local optima. -- Bert On Thu, Nov 10, 2011 at 11:24 AM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: Just to add:

Re: [R] R to automate scatter plots

2011-11-10 Thread R. Michael Weylandt
I think you are off in the order of calls: you need to open the pdf and then do all the plots so that they get pushed to the pdf. The blank plot call won't do anything particularly helpful. If you use pdf() after most of the plot commands they go to your default device which is usually printing to

Re: [R] Named components in a list

2011-11-10 Thread JulioSergio
Sarah Goslee sarah.goslee at gmail.com writes: Hi, You probably want: L[NewName] - something or one of the many potential variants. Thanks, Sara, That works! However, following the idea that the syntactic notation L[i] means a sublist of L, again the syntactic notation L[i] -

[R] Error in matrix, not ordered vectors or numerical value, and SIAR.

2011-11-10 Thread Alex DJ
Help! model1 - siarmcmcdirichletv4(data, source, tef, concdep=0, 50, 5) Error in matrix(1, ncol = (numsources + numiso) * numgroups, nrow = (siardata$iterations - : invalid 'ncol' value (too large or NA) In addition: Warning message: In Ops.ordered((numsources + numiso), numgroups) :

Re: [R] optim seems to be finding a local minimum

2011-11-10 Thread Dimitri Liakhovitski
Bert, that's exactly where I started. I found optim in the first paragraph under General Purpose Continuous Solvers and used bounded BFGS for a constrained optimization for a situation with more than 1 parameters. Again, not being an engineer / mathematician - would greatly appreciate any

[R] plotting a function with given formula in ggplot2

2011-11-10 Thread Curiouslearn
Hi All, I have a scatter plot produced using ggplot2 and I want to add the regression line to this scatter plot. I suppose I can use geom_smooth() to do this, but for the sake of learning ( I am new both to R and ggplot2), I want to try and add it as a function (something that curve() does in the

  1   2   >