Re: [R] Getting a column of values from a list - think I'm doing it the hard way

2009-06-04 Thread Gavin Simpson
On Thu, 2009-06-04 at 10:57 +0800, Ronggui Huang wrote: > 2009/6/4 Jason Rupert : > > HouseDates <- c("02/27/90", "02/27/91", "01/14/92", "02/28/93", "02/01/94", > > "02/01/95", "02/01/96") > > > > # ?as.Date > > HouseDatesFormatted<-as.Date(HouseDates, "%m/%d/%y") > > > > HouseDatesFormatted > >

Re: [R] R on Windows Server

2009-06-04 Thread Uwe Ligges
Lensing, Shelly Y wrote: We are starting the process for purchasing a server with Windows Server 2008 OS. We are mainly interested in storage for multiple users, but would like to have the capability to run R simulations on the server. Are there any issues we should be aware of for installin

Re: [R] About classifier in RWeka

2009-06-04 Thread Achim Zeileis
On Wed, 3 Jun 2009, Huihua Lu wrote: Hi everyone, I have trouble to use RWeka, I tried: (w=weather dataset, all preditors are nominal) m<-J48(play~., data=w) e<-evaluate_Weka_classifier(m,cost = matrix(c(0,2,1,0), + ncol = 2),numFolds = 10, complexity = TRUE,seed = 123, + class = TRUE) it gi

[R] 'beside' option for boxplots

2009-06-04 Thread Malcolm Ryan
Is there any way to get a boxplot of several data sets beside one another on the same graph, as there is for barplot? If I do: d1 <- data.frame(a = c(rep(1:3, each = 3)), b = c(1:9)) d2 <- data.frame(a = c(rep(1:3, each = 3)), b = c(9:1)) boxplot(d1$b ~ d1$a) boxplot(d2$b ~ d2$a, add=T) It wi

Re: [R] Deviance explined in GAMM, library mgcv

2009-06-04 Thread nsc
Hi all, I have the same question for a GAMM with quasi-poisson errors. Does anyone know how to calculate the % deviance explained by a GAMM model or any other method evaluating the % contribution of the model in explaining the response variable (eg. number of birds in an area)? Thanks Nicole

[R] Binning or grouping data

2009-06-04 Thread alamoboy
Newbie here. Many apologies in advance for using the incorrect lingo. I'm new to statistics and VERY new to R. I'm attempting to "group" or "bin" data together in order to analyze them as a combined group rather than as discrete set. I'll provide a simple example of the data for illustrative p

Re: [R] Understanding R Hist() Results...

2009-06-04 Thread Philipp Pagel
On Wed, Jun 03, 2009 at 09:00:11PM -0700, Jason Rupert wrote: > > http://n2.nabble.com/What-is-going-on-with-Histogram-Plots-td3022645.html > > For my example I count 7 unique years, however, on the histogram > there only 6. It looks like the bin to the left of the tic mark on > the x-axis repre

Re: [R] Binning or grouping data

2009-06-04 Thread Philipp Pagel
> I'm attempting to "group" or "bin" data together in order to analyze them as > a combined group rather than as discrete set. I'll provide a simple example > of the data for illustrative purposes. > > Patient ID | Charges |Age | Race > 1 | 100 |0 | Bla

Re: [R] Getting a column of values from a list - think I'm doing it thehard way

2009-06-04 Thread ONKELINX, Thierry
Dear Jason, Have a look at years() from the chron package. library(chron) HouseDates <- c("02/27/90", "02/27/91", "01/14/92", "02/28/93", "02/01/94", "02/01/95", "02/01/96") HouseDatesFormatted<-as.Date(HouseDates, "%m/%d/%y") years(HouseDates) HTH, Thierry

[R] Fast way of finding top-n values of a long vector

2009-06-04 Thread Allan Engelhardt
If x is a (long) vector and n << length(x), what is a fast way of finding the top-n values of x? Some suggestions (calculating the ratio of the two top values): library("rbenchmark") set.seed(1); x <- runif(1e6, max=1e7); x[1] <- NA; benchmark( replications=20, columns=c("test","elapsed"), ord

[R] plot.boot

2009-06-04 Thread David A.G
Dear list, I have bootstrapped the C-index of a logistic regression model, 500 times. > results <- boot(data=data,statistic=cindex,R=500,formula = myformula) When I plot the results I get a histogram of the bootstrapped where the Y axis is density, but it spans from 0 to about 25 > plot(res

Re: [R] Abort run

2009-06-04 Thread Allan Engelhardt
Ronggui Huang wrote: It depends on the OS you use. For windows user, the ESC key or "stop all computation" in the menu are the options. On Unix, you use Ctrl-C if you run R from a terminal window. __ R-help@r-project.org mailing list https://stat.e

[R] stepwise linear regression, both sides, with limit

2009-06-04 Thread fd54
Hello, I am totaly new to R, and I would like to know if there is a R package that performs stepwise linear regression in the following way: - both backwards and forwards like in S+ and - being asked to put a number that tells until when to do the stepwise, like in SPSS I am not a statistician at

Re: [R] Fast way of finding top-n values of a long vector

2009-06-04 Thread Barry Rowlingson
On Thu, Jun 4, 2009 at 9:18 AM, Allan Engelhardt wrote: > I want to apply this code to a few tens of thousands of vectors so speed > does matter.  In C or similar I would of course calculate the result with a > single pass through x, and not with three passes as in 'max2'. > So why not code it

Re: [R] Binning or grouping data

2009-06-04 Thread Allan Engelhardt
You want cut and tapply, perhaps along these lines: ## Your data frame: a <- data.frame(patient=1:6, charges=c(100,500,200,90,400,500), age=c(0,3,5,7,10,16), race=c("black","white","hispanic","asian","hispanic","black")) ## Add an age category: a <- cbind(a, age_category=cut(a$age, breaks=c(-

Re: [R] Finding cointegration relations in a VAR(1)

2009-06-04 Thread Pfaff, Bernhard Dr.
>Von: r-help-boun...@r-project.org >[mailto:r-help-boun...@r-project.org] Im Auftrag von >severine.gai...@unil.ch >Gesendet: Donnerstag, 4. Juni 2009 01:43 >An: r-h...@stat.math.ethz.ch >Betreff: [R] Finding cointegration relations in a VAR(1) > >Dear R people, > >I am trying to find the cointeg

Re: [R] classification table in logistic regression

2009-06-04 Thread Peter Flom
Frank E Harrell Jr wrote >Armida, > >I regret putting CTABLE as an option on the old SAS PROC LOGIS which was >a basis for PROC LOGISTIC. Classification tables are arbitrary and >misleading so I would stay away from them. > >You might build a model with and without the variable of interest and

Re: [R] Binning or grouping data

2009-06-04 Thread Ronggui Huang
Personally, I prefer the recode() in package of car. Ronggui 2009/6/4 Philipp Pagel : >> I'm attempting to "group" or "bin" data together in order to analyze them as >> a combined group rather than as discrete set.  I'll provide a simple example >> of the data for illustrative purposes. >> >> Pat

Re: [R] Understanding R Hist() Results...

2009-06-04 Thread Ted Harding
On 04-Jun-09 04:00:11, Jason Rupert wrote: > > Think I'm missing something to understand what is going on with > hist(...) > > http://n2.nabble.com/What-is-going-on-with-Histogram-Plots-td3022645.htm > l > > For my example I count 7 unique years, however, on the histogram there > only 6. It loo

[R] order() with randomised order in ties?

2009-06-04 Thread Rainer M Krug
Hi I want to use order() to get the order of a vector. But I would need a different behavior when ties occur: similar to the parameter ties.method = "random" in the rank() function, I would need to randomise the ties. Is this possible? Example: x <- rep(1:10, 2) order(x) [1] 1 11 2 12 3 13

[R] Rmpi issue

2009-06-04 Thread Jacques ROPERS
Dear R users, I am trying to use Rmpi in a Windows XP box to parallelize some simulations. Ultimately I would like to setup a small cluster of Win XP machines, but as a first step I only use one computer. Unfortunately Rgui crashes as soon as I call the function mpi.spawn.Rslaves() . Configurati

Re: [R] order() with randomised order in ties?

2009-06-04 Thread Rainer M Krug
Sorry for replying to my own post, but I found a solution. Still, a more elegant solution would be preferred. On Thu, Jun 4, 2009 at 12:02 PM, Rainer M Krug wrote: > Hi > > I want to use order() to get the order of a vector. > > But I would need a different behavior when ties occur: similar to th

Re: [R] order() with randomised order in ties?

2009-06-04 Thread Patrick Burns
How about: order(x, runif(length(x))) Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of "The R Inferno" and "A Guide for the Unwilling S User") Rainer M Krug wrote: Sorry for replying to my own post, but I found a solution. Still, a more elegant solu

Re: [R] IP-Address

2009-06-04 Thread edwin7
Hi, Unfortunately, they can't handle NA. Any suggestion? Some row for Ip don't have ip address. This cause an error/ wrong result. Eddie > library(gsubfn) > library(gtools) > library(rbenchmark) > > n <- 1 > df <- data.frame( > a = rnorm(n), > b = rnorm(n), > c = rnorm(n), > ip = r

Re: [R] Problem making a package using S4 objects.

2009-06-04 Thread Fernando Martins
Hello again. I have found the answer to my own problem and I have documented it in my blog. Take a look at http://m6onsoftware.blogspot.com/2009/06/r-package-with-s4-objects.html for full story. Hope this is useful for others. Best regards On Fri, May 29, 2009 at 11:54 PM, Fernando Martins wrot

Re: [R] about time

2009-06-04 Thread Uwe Ligges
XinMeng wrote: How to use R to modify the time when the file is created, and the time when the file is modified ? Thanks! My best. I do not think that R provides functions() / API to do that. You need to read the documentation of your particular operating system / file system how to do i

Re: [R] legend problem [with ggplot[12]]

2009-06-04 Thread Uwe Ligges
IF you provide us with the reproducible code that is requested in the posting guide, you may get some valuable help. I gues sthe is from ggplot2? Uwe Ligges Felipe Carrillo wrote: Hi: See the attached pdf graphic. The legend overlaps a little bit with the strip. Is there a way to move it ove

Re: [R] 'beside' option for boxplots

2009-06-04 Thread Uwe Ligges
Example: boxplot(d1$b ~ d1$a, pars = list(boxwex = 0.15), at=c(1:3 - 0.1), xaxt="n") boxplot(d2$b ~ d2$a, add=T, pars = list(boxwex = 0.15), at=c(1:3 + 0.1), xaxt="n") axis(1, at=1:3) Uwe Malcolm Ryan wrote: Is there any way to get a boxplot of several data sets beside one another on the sam

Re: [R] Adding a method to a generic in another package

2009-06-04 Thread Uwe Ligges
Jeffrey J. Hallman wrote: I am the maintainer of the 'tis' package. One of the functions in my package is 'nberShade'. A user wants to make nberShade generic, with the old version renamed as nberShade.default, all of which is fine with me. And he wants to add a new method, nberShade.ggplot,

Re: [R] Understanding R Hist() Results...

2009-06-04 Thread Jason Rupert
Thank you again for all the R help folks who responded. I again appreciate all the help and insight and will investigate the options suggested. I guess I still doing a little head scratching at how the division occurred: It looks like the default hist(...) behavior is doing the following: Hou

Re: [R] Adding a method to a generic in another package

2009-06-04 Thread Gabor Grothendieck
The zoo package has lattice methods and does not use require and it puts lattice in Imports in the DESCRIPTION file. If a user wants to the use the zoo lattice functions then they must issue a library(lattice) call. As a result users do not have to load lattice but if they want to use it they mus

Re: [R] Using constrOptim() function

2009-06-04 Thread spencerg
It looks to me like you need to add "x" to the arguments in your call to "constrOptim", something like the following: constrOptim(beta_i, myFunction, NULL, ui, ci, mu = 1e-04, control = list(), method = "Nelder-Mead",outer.iterations = 100, outer.eps = 1e-05, x=x) The first "x"

Re: [R] Getting a column of values from a list - think I'm doing it thehard way

2009-06-04 Thread Gabor Grothendieck
Or even: > library(chron) > ch <- chron(HouseDates) > years(ch) [1] 1990 1991 1992 1993 1994 1995 1996 Levels: 1990 < 1991 < 1992 < 1993 < 1994 < 1995 < 1996 > # or > with(month.day.year(ch), year) [1] 1990 1991 1992 1993 1994 1995 1996 On Thu, Jun 4, 2009 at 4:02 AM, ONKELINX, Thierry wrote:

Re: [R] IP-Address

2009-06-04 Thread Peter Dalgaard
edw...@web.de wrote: > Hi, > > > Unfortunately, they can't handle NA. Any suggestion? Some row for Ip > don't have ip address. This cause an error/ wrong result. A quick fix could be to substitute "..." or "0.0.0.0" for the "NA" entries. (Use something like ipch <- as.character(df$ip) ipch[is.n

[R] Cochran’s Q statistic

2009-06-04 Thread jlfmssm
Does anyone know which package include the computation of Cochran’s Q statistic in R? jlfmssm [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gui

Re: [R] 'beside' option for boxplots

2009-06-04 Thread ONKELINX, Thierry
Dear Malcom, Another option is to merge both dataset to one big dataset and then plot the big dataset. d1 <- data.frame(a = c(rep(1:3, each = 3)), b = c(1:9), d = "A") d2 <- data.frame(a = c(rep(1:3, each = 3)), b = c(9:1), d = "B") Dataset <- rbind(d1, d2) library(ggplot2) Dataset$a <- factor(Da

Re: [R] IP-Address

2009-06-04 Thread Gabor Grothendieck
Suggest you be more specific. The solution I posted does handle missing values sorting them to the beginning: > Lines <- "id rank color status ip + 138 29746 yellow no 162.131.58.26 + 138 29746 red yes 162.131.58.16 + 138 29746 blue yes 162.131.58.10 + 138 29746 red no 162.131.58.17 + 138 297

[R] visible code

2009-06-04 Thread Karin & Martijn
Hello, Can anyone help me with the following: if one enters a function name in the R console then usually one sees the code of that function. But there are functions that one cannot see. For example I want to see the code of print.htest or t.test.default. These functions are non-visible. Is it

Re: [R] Create a time interval from a single time variable

2009-06-04 Thread Terry Therneau
-- begin included message -- I am trying to set up a data set for a survival analysis with time-varying covariates. The data is already in a long format, but does not have a variable to signify the stopping point for the interval. The variable DaysEnrolled is the variable I would like to use t

[R] Hedges g statistic

2009-06-04 Thread jlfmssm
which package have Hedges g statistic calculation in R? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guid

Re: [R] Cochran’s Q statistic

2009-06-04 Thread Allan Engelhardt
jlfmssm wrote: Does anyone know which package include the computation of Cochran’s Q statistic in R? install.packages("outliers") __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide htt

Re: [R] Cochran’s Q statistic

2009-06-04 Thread Marc Schwartz
On Jun 4, 2009, at 7:48 AM, jlfmssm wrote: Does anyone know which package include the computation of Cochran’s Q statistic in R? jlfmssm See this thread: https://stat.ethz.ch/pipermail/r-help/2006-September/113139.html HTH, Marc Schwartz __ R-

Re: [R] visible code

2009-06-04 Thread David Winsemius
Yes. Uwe Ligges' R Help Desk article in this Rnews should answer your questions: www.r-project.org/doc/Rnews/Rnews_2006-4.pdf On Jun 4, 2009, at 9:08 AM, Karin & Martijn wrote: Hello, Can anyone help me with the following: if one enters a function name in the R console then usually one se

[R] Morlet wavelet analysis

2009-06-04 Thread Irina Foss
Dear, I am using "cwt "function from Rwave package to perform Morlet wavelet analysis. d1<-c(1.31673209591515, -0.171333455797346, -1.67618546079420, -0.931604651010362, -0.954614183224057, -1.19821794547758, 0.516096363353144, -0.0432811977638559, 0.737764943619919, 0.438046629673177, -0.20860

Re: [R] Cochran's Q statistic

2009-06-04 Thread Weiss, Bernd
jlfmssm schrieb: Does anyone know which package include the computation of Cochran?s Q statistic in R? jlfmssm [[alternative HTML version deleted]] I might be wrong but the packages rmeta and meta report a Q-statistic. For an example, see library(meta) meta1 metagen(meta1$TE, meta

Re: [R] order() with randomised order in ties?

2009-06-04 Thread Rainer M Krug
On Thu, Jun 4, 2009 at 12:36 PM, Patrick Burns wrote: > How about: > > order(x, runif(length(x))) Thanks - that is really elegant. Rainer > > > > Patrick Burns > patr...@burns-stat.com > +44 (0)20 8525 0696 > http://www.burns-stat.com > (home of "The R Inferno" and "A Guide for the Unwilling S

[R] Dropping terms from regression w/ poly()

2009-06-04 Thread Joshua Stults
Hello r-help, I'm fitting a model with lm() and using the orthogonal polynomials from poly() as my basis: dat <- read.csv("ConsolidatedData.csv", header=TRUE) attach(dat) nrows <- 1925 Rad <- poly(Radius, 2) ntheta <- 14 Theta <- poly(T.Angle..deg., ntheta) nbeta <- 4 Beta <- poly(B.Beta..deg., n

[R] Plot and lm

2009-06-04 Thread Par Leijonhufvud
I want to make a log-log plot with a regression line, but I can't figure out what I'm doing wrong. What I'm trying is: plot(mass,area, log="xy", pch=as.numeric(food)) abline(lm(mass~area)) or plot(mass,area, log="xy", pch=as.numeric(food)) islands$logmass <- log(mass) islands$logarea <- log(area

Re: [R] Cochran’s Q statistic

2009-06-04 Thread David Winsemius
http://finzi.psych.upenn.edu/R/Rhelp02/archive/85027.html http://finzi.psych.upenn.edu/R/Rhelp02/archive/85025.html Agresti's description of Cochran's Q (p 252) in "Introduction to Categorical Analysis" suggests that Cochran's Q is a particular application the generalized CMH test. You can

[R] Import ARIMA coefficients

2009-06-04 Thread Daniel Mail
Hello, I need to know how to import ARIMA coefficients. I already determined the coefficients of the model with other software, but now i need to do the forecast in R. For Example: I have a time series named x and i have fitted an ARIMA(1,0,1) (with other software) AR coef = -.17

[R] RGtk2 help: Show list of column names from dataset and categorize as factor or numeric

2009-06-04 Thread Harsh
Hi UseRs, I recently started working with the RGtk2 library. The documentation is comprehensive and I've tried learning from the examples in most Gtk tutorials (which have C code). This is a little problematic, but has helped quite a bit in getting me started. I would like to create a GUI for file

Re: [R] RGtk2 help: Show list of column names from dataset and categorize as factor or numeric

2009-06-04 Thread Ronggui Huang
I use gWidgetsRGtk2, which provides widgets such as notebook etc. You can start with gWidgetsRGtk2, and if you want to tailor the GUI according to your needs, you can modified them with RGtk2 package. Ronggui 2009/6/4 Harsh : > Hi UseRs, > I recently started working with the RGtk2 library. The do

Re: [R] Binning or grouping data

2009-06-04 Thread Glen Sargeant
alamoboy wrote: > > Newbie here. Many apologies in advance for using the incorrect lingo. > I'm new to statistics and VERY new to R. > > I'm attempting to "group" or "bin" data together in order to analyze them > as a combined group rather than as discrete set. I'll provide a simple > examp

[R] hist returning density larger than 1

2009-06-04 Thread Steven Matthew Anderson
The following code is giving me problems. I want to export densities of a distribution to a csv file. At the bottom of the code I use the hist function to generate the densities. But hist is returning values greater than 1. I don't understand, why. Any help you can supply is greatly ap

[R] error installing RCurl in SUSE SLES10-SP2

2009-06-04 Thread Robert Castelo
dear list, i'm trying to install the package RCurl into a linux system running SUSE Linux Enterprise Server 10 SP2 but i get compilation errors which i guess should be due to some missing additional software. i've been searching about the R-help archives without success so i hope somebody can poin

Re: [R] order() with randomised order in ties?

2009-06-04 Thread Rainer M Krug
On Thu, Jun 4, 2009 at 12:45 PM, Rainer M Krug wrote: > On Thu, Jun 4, 2009 at 12:36 PM, Patrick Burns > wrote: >> How about: >> >> order(x, runif(length(x))) > > Thanks - that is really elegant. One thing: it is saver to use sample(length(x)) instead of runif(length(x)), as runif() might also

[R] ordered Twoing criterion in classification trees

2009-06-04 Thread Paolo Radaelli
Dear R users, I'm using the rpart package to build classification trees. I'm interested in implementing the ordered Twoing as a splitting criterion. Does anyone have experience with this task ? Thank you for your help Paolo Paolo Radaelli Dipartimento di Metodi Quantitativi per le Scienze Eco

Re: [R] hist returning density larger than 1

2009-06-04 Thread Sarah Goslee
Hi, If I understand your problem correctly, you didn't need to send us your entire code. A simple reproducible example that showed just your problem would have been sufficient. Take a look at this, and reread the help for hist(). > testdata <- runif(1000) > testdata.hist <- hist(testdata) > test

[R] Small mystery : passing a "subset=" argument to lme|lm through "..."

2009-06-04 Thread Emmanuel Charpentier
Dear list, I have problems involving passing a "subset=" argument through "...". I'm trying to augment the set of defined analyses for mice (homonymous package) with a call to lme. This package create multiple imputations of missing data in a "mids" object, each completed data set may be obtained

Re: [R] Binning or grouping data

2009-06-04 Thread Glen Sargeant
alamoboy wrote: > > Newbie here. Many apologies in advance for using the incorrect lingo. > I'm new to statistics and VERY new to R. > > I'm attempting to "group" or "bin" data together in order to analyze them > as a combined group rather than as discrete set. I'll provide a simple > examp

Re: [R] Need help understanding output from aov and from anova

2009-06-04 Thread Suman Sundaresh
Hi Steve, Thanks for your response and also for the useful information about the latest version warning. On the earlier version that I was using (2.6.2 Win), I was expecting at least an error or warning in response to submitting an obviously corner case condition that should result in "NaN", but

Re: [R] Getting a column of values from a list - think I'm doing it the hard way

2009-06-04 Thread Greg Snow
If you want to play R golf then: > sapply(HouseDatesList, '[[', 1) [1] "1990" "1991" "1992" "1993" "1994" "1995" "1996" Does the same thing in fewer keystrokes, but Ronggui's solution is more readable. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@i

[R] Least Squares Method

2009-06-04 Thread aledanda
Dear Helpers, I need to fit a gamma function on a distribution. I want to use the Method of the Least Squares for minimizing the sum of squared residuals (SSE). I don't know how to do this. I guess I need to calculate the best fit parameter values and then somehow comparing my empirical distribut

[R] loglilelihood

2009-06-04 Thread Subha P. T.
Hi,  I tried fitting loglinear model using the glm(catspec). The data used is FHtab. . An independence model was fitted. Here summary() and fitmacro( ) give different values for AIC.   I understand that fitmacro( ) takes the likelilhood ratio L2(deviance) to calculate AIC and uses the formu

[R] wrong labels and colors of points in graph/plot

2009-06-04 Thread Katharina May
Hi there, I trying to solve this problem for the whole day not going anywhere, so I really hope maybe somebody can help me in this community... I've got an object coefficient2 which I want to plot in differerent ways, with colors and labels added to the points, but somehow there seems to be a pro

Re: [R] Import ARIMA coefficients

2009-06-04 Thread Stefan Grosse
On Thu, 4 Jun 2009 15:21:52 +0100 Daniel Mail wrote: DM> I need to know how to import ARIMA coefficients. I already DM> determined the coefficients of the model with other software, but DM> now i need to do the forecast in R. So why then don't you fit the model then in R Would be much more c

[R] help needed with ridge regression and choice of lambda with lm.ridge!!!

2009-06-04 Thread Giulio Di Giovanni
Hi, I'm a beginner in the field, I have to perform the ridge regression with lm.ridge for many datasets, and I wanted to do it in an automatic way. In which way I can automatically choose lambda ? As said, right now I'm using lm.ridge MASS function, which I found quite simple and fast, and I've

[R] 5-D density? was Re: R help

2009-06-04 Thread David Winsemius
(copy of earlier reply which was not addressed to r-help. Also added informative Subject:) "yes .." is not responsive to the question of how you propose to display or examine such a mathematical object. My signature was perhaps a lame (certainly an ineffective) effort at getting you to

Re: [R] wrong labels and colors of points in graph/plot

2009-06-04 Thread David Winsemius
No attachment came through the mailserver. Did you follow the directions in the posting guide regarding acceptable types of attachments? I also do not see any code that would let us reproduce an input process. One method that might work is to offer the results of dput(coefficients) as tex

Re: [R] Return variable assignments from a function

2009-06-04 Thread Greg Snow
I still think that fortune(181) applies here. Someday you (or another user that you give your function to) will run this, then realize that you/they had an A, B, or c variable that has just been overwritten that you/they wanted to keep. (also 'c' is one of the variable names recommended agains

Re: [R] Using WinBUGS from R: A Multi-Way Array Problem

2009-06-04 Thread Greg Snow
Your output example below looks the same as the input. But I think the 'aperm' function may be what you are looking for, read its help page and run the example to see if that will work for you. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org

Re: [R] wrong labels and colors of points in graph/plot

2009-06-04 Thread katharina
sorry, the attachment can be found here for download: http://www.wzw.tum.de/waldinventur/fileadmin/coefficient2.RData katharina wrote: > > Hi there, > > I trying to solve this problem for the whole day not going anywhere, > so I really hope maybe somebody can help > me in this community... >

Re: [R] Excel Export in a beauty way

2009-06-04 Thread Kevin W
Also see this post at https://stat.ethz.ch/pipermail/r-help/2008-July/169149.html The same idea is discussed in a SAS proceedings paper (but it is NOT specific to SAS) www.lexjansen.com/wuss/2005/data_presentation/dp_using_*sas*_with_xml.pdf

[R] documentation / An Intro to R / list manipulation

2009-06-04 Thread Robbie Morrison
Hello R users http://cran.r-project.org/doc/manuals/R-intro.html An Introduction to R 6.2 Constructing and modifying lists After a short but successful struggle with nested associative arrays (using named lists), I think the following documentation change might be beneficial. The existing

Re: [R] Plot and lm

2009-06-04 Thread stephen sefick
Could you provide a reproducible example even with fake data would be fine or dput() yours. On Thu, Jun 4, 2009 at 10:11 AM, Par Leijonhufvud wrote: > I want to make a log-log plot with a regression line, but I can't figure > out what I'm doing wrong. What I'm trying is: > > plot(mass,area, log="

Re: [R] Fast way of finding top-n values of a long vector

2009-06-04 Thread Greg Snow
Try adding a version that uses sort with the partial argument, that should be faster than regular sort (for long enough test vectors) and possibly faster than the max solutions when finding more than just the largest 2. Also, for your max solutions, what happens when the 2 largest values are id

Re: [R] wrong labels and colors of points in graph/plot

2009-06-04 Thread David Winsemius
Was not able to find NCStats on CRAN or BioConductor repositories. You are wasting our (or mine at any rate) time by giving us dead ends. You have been bitten by the "factor snake in the grass". Color should be text rather than a factor if you want the desired results. See if this is illumi

Re: [R] Plot and lm

2009-06-04 Thread Par Leijonhufvud
stephen sefick [2009.06.04] wrote: > Could you provide a reproducible example even with fake data would be > fine or dput() yours. Sorry, I don't understand what you mean. Im my post was the first 8 lines of my data, imported into R with islands <- read.table("islands.csv", sep=",", h=T) and th

Re: [R] wrong labels and colors of points in graph/plot

2009-06-04 Thread katharina
Sorry for the problem with NCStats, I used it from this page not realizing that this is not 'official': http://www.rforge.net/NCStats/files/ Thank you for helping me with the color issue, I finally know now what has happened with the colors of the points my plots. David Winsemius wrote: > > W

[R] Error Catching?

2009-06-04 Thread Brigid Mooney
Hi, Is there an easy way to "catch" errors, in order to arrange for r-scripts to exit gracefully? I'm thinking of something along the lines of using is.na with an if/else statement, but for errors. Thanks! __ R-help@r-project.org mailing list https://

[R] how to tell if as.numeric succeeds?

2009-06-04 Thread Steve Jaffe
Suppose I have a vector of strings. I'd like to convert this to a vector of numbers if possible. How can I tell if it is possible? as.numeric() will issue a warning if it fails. Do I need to trap this warning? If so, how? In other words, my end goal is a function that takes a vector of strings

Re: [R] Error Catching?

2009-06-04 Thread Barry Rowlingson
On Thu, Jun 4, 2009 at 6:56 PM, Brigid Mooney wrote: > Hi, > > Is there an easy way to "catch" errors, in order to arrange for > r-scripts to exit gracefully? > > I'm thinking of something along the lines of using is.na with an > if/else statement, but for errors. > Try 'try'. Barry __

Re: [R] Error Catching?

2009-06-04 Thread Marc Schwartz
On Jun 4, 2009, at 12:56 PM, Brigid Mooney wrote: Hi, Is there an easy way to "catch" errors, in order to arrange for r-scripts to exit gracefully? I'm thinking of something along the lines of using is.na with an if/else statement, but for errors. Thanks! See ?try and ?tryCatch HTH, Marc

Re: [R] Plot and lm

2009-06-04 Thread stephen sefick
I can't copy and paste your example right out of you email and into an R session. ?dput and then see if you can copy and paste it into an R session and make it work. That way it is easier for everyone and you have a better chance of getting helpful responses. HTH Stephen Sefick On Thu, Jun 4, 2

Re: [R] how to tell if as.numeric succeeds?

2009-06-04 Thread Marc Schwartz
On Jun 4, 2009, at 1:01 PM, Steve Jaffe wrote: Suppose I have a vector of strings. I'd like to convert this to a vector of numbers if possible. How can I tell if it is possible? as.numeric() will issue a warning if it fails. Do I need to trap this warning? If so, how? In other words, my en

Re: [R] Newton method again

2009-06-04 Thread Berend Hasselman
Roslina Zakaria wrote: > > Hi Ravi, > I did ask you some question regarding newton method sometime ago..  Now I > have fixed the problem and I also wrote 2 looping code (ff1 and ff2) to > evaluate the modified Bessel function of the first kind and call them in > the newton code.  But I dont't un

Re: [R] Fast way of finding top-n values of a long vector

2009-06-04 Thread Allan Engelhardt
Greg Snow wrote: Try adding a version that uses sort with the partial argument, that should be faster than regular sort (for long enough test vectors) and possibly faster than the max solutions when finding more than just the largest 2. I find the documentation for the partial argument in sor

Re: [R] Plot and lm

2009-06-04 Thread William Dunlap
I think the problem is that plot's log axes are to the base 10 so the lm() call needs to use log10, not log. E.g., x<-101:200 y<-sqrt(x)+1+runif(100) plot(x,y,log="xy") abline(col="red", lm(log(y)~log(x))) # nothing plotted abline(col="blue", lm(log10(y)~log10(x))) # passes through

[R] logical indexing multidimensional arrays

2009-06-04 Thread Steve Jaffe
Suppose I have an n-dimensional array and a logical vector as long as the first dimension. I can extract an n-dimensional subarray with a[ i, , , , .. ,] where there are n-1 commas (ie empty indices) Is there an alternative notation that would better lend itself to more generic use, e.g. to wr

[R] type = 'b' with Grid

2009-06-04 Thread baptiste auguie
Dear all, I feel like I've been reinventing the wheel with this code (implementing type = 'b' for Grid graphics), http://econum.umh.ac.be/rwiki/doku.php?id=tips:graphics-grid:linesandpointsgrob Has anyone here attempted this with success before? I found suggestions of overlapping large white

Re: [R] For Social Network Analysis-Graph Analysis - How to convert 2 mode data to 1 mode data?

2009-06-04 Thread S. Messing
All, There is a simple solution to this problem using R's matrix algebra commands. I describe in detail at http://www.stanford.edu/~messing/Affiliation%20Data.html http://www.stanford.edu/~messing/Affiliation%20Data.html . Best wishes, -Solomon -- View this message in context: http://www

Re: [R] IP-Address

2009-06-04 Thread edwin
Thank you Peter, This solved the problem. > edw...@web.de wrote: > > Hi, > > > > > > Unfortunately, they can't handle NA. Any suggestion? Some row for Ip > > don't have ip address. This cause an error/ wrong result. > > A quick fix could be to substitute "..." or "0.0.0.0" for the "NA" > entries

Re: [R] 5-D density? was Re: R help

2009-06-04 Thread arijit kumar debnath
I don't want to plot or visualize the plot. I just want to clculate the density at certain prespecified points.For that,knowin the funcional form is enough.I just want a function that returns me back the estimate of density at some point On Thu, Jun 4, 2009 at 10:04 PM, David Winsemius wrote: > (

Re: [R] 5-D density? was Re: R help

2009-06-04 Thread David Winsemius
To address the creation of a 5-D density object: http://finzi.psych.upenn.edu/R/library/ks/html/kda.kde.html http://finzi.psych.upenn.edu/R/library/ks/html/kde.html http://finzi.psych.upenn.edu/R/library/locfit/html/locfit.raw.html -- David Winsemius On Jun 4, 2009, at 12:34 PM, David Winsemi

Re: [R] Minor tick marks for date/time ggplot2 (this is better, but not exactly what I want)

2009-06-04 Thread hadley wickham
On Mon, Jun 1, 2009 at 2:18 PM, stephen sefick wrote: > library(ggplot2) > > melt.updn <- (structure(list(date = structure(c(11808, 11869, 11961, 11992, > 12084, 12173, 12265, 12418, 12600, 12631, 12753, 12996, 13057, > 13149, 11808, 11869, 11961, 11992, 12084, 12173, 12265, 12418, > 12600, 12631,

Re: [R] 5-D density? was Re: R help

2009-06-04 Thread arijit kumar debnath
thank you. This is just what I was looking for. On Fri, Jun 5, 2009 at 3:16 AM, David Winsemius wrote: > To address the creation of a 5-D density object: > > http://finzi.psych.upenn.edu/R/library/ks/html/kda.kde.html > > http://finzi.psych.upenn.edu/R/library/ks/html/kde.html > > http://finz

[R] RPostgreSQL segfault with LEFT JOIN

2009-06-04 Thread Dylan Beaudette
Hi, I recently upgraded to R 2.9.0 on linux x86. After doing so, I switched to the RPostgreSQL package for interfacing with a postgresql database. I am using postgresql 8.3.7. A query that works from the postgresql terminal is causing a segfault when executed from R. My sessionInfo, the erro

Re: [R] RPostgreSQL segfault with LEFT JOIN

2009-06-04 Thread Dirk Eddelbuettel
On 4 June 2009 at 16:17, Dylan Beaudette wrote: | Hi, | | I recently upgraded to R 2.9.0 on linux x86. After doing so, I switched to the | RPostgreSQL package for interfacing with a postgresql database. I am using | postgresql 8.3.7. | | A query that works from the postgresql terminal is cau

Re: [R] RPostgreSQL segfault with LEFT JOIN

2009-06-04 Thread Dylan Beaudette
On Thursday 04 June 2009, Dirk Eddelbuettel wrote: > On 4 June 2009 at 16:17, Dylan Beaudette wrote: > | Hi, > | > | I recently upgraded to R 2.9.0 on linux x86. After doing so, I switched > | to the RPostgreSQL package for interfacing with a postgresql database. I > | am using postgresql 8.3.7. >

[R] Help Needed

2009-06-04 Thread Angshuman Bagchi
HI, I am Angshuman a postdoc in Buck Institute, Novato, CA. I am using random forest in R. I have a problem. I have a training file and a test file. I need to generate model file to classify a set of data of the test file. I need to know the command for that. Please let me know. Thank you. Ang

  1   2   >