Re: [R] accumulation curves

2010-09-22 Thread Michael Bedward
Hello Kyran, Some more details of your data would be helpful. For example, is it cumulative species count over time ? Michael On 23 September 2010 15:05, Kyran Staunton wrote: > Hi, > > I am trying to fit a logarithmic trendline to a scatterplot of a > species accumulation curve. I've tried abl

[R] ergm

2010-09-22 Thread Iasonas Lamprianou
Dear colleagues, I have another question, which, I think cannot be answered easily by the manual. What is the effect of including both nodefactor("Gender") and nodematch("Gender",diff=TRUE)) for the same variable in the model? Judging from the output (please see below), you cant have estimates

Re: [R] import csv file problem

2010-09-22 Thread sisxy
Erik Iverson-3 wrote: > > On 09/22/2010 07:24 PM, sisxy wrote: >> >> > > R will search in its working directory for Q.csv. > > What is the working directory, use getwd() to > find out. > > > Thanks , by using the getwd() , i found the place that i should save in my laptop... then after i

Re: [R] import csv file problem

2010-09-22 Thread sisxy
it's work by using the read.csv(file.choose())... thanks ^^ as a beginner , what kind of the material should i learn ??i know the R tutorial actually , the code i saw from previous topic in the forum, for a code like Q<-read.csv(file="Q.csv") ...i not really understand Q in front for the read ,

[R] non-linear integer optimization?

2010-09-22 Thread darckeen
Are there any packages that do non-linear integer otimization? Looked at lpSolve but i'm pretty sure it only works with linear programming and not non-linear, tried "L-BFGS-B" optim after flooring all my params, works somewhat but seems really inefficient. Anything else I should look at? -- Vie

[R] converting NSCA HDF5 files to ASCII

2010-09-22 Thread Alex Anderson
Hi All, I am struggling with the task of converting some MODIS remotes sensed image data in HDF5 format to ASCII format. I have found oblique references to the HDF format in the help files for the packages hdf5, RnetCDF, and ncdf, but nothing that appears to read in an HDF format file and p

Re: [R] rcom and safearray type of data

2010-09-22 Thread Alex Bird
Thanks! Will post there. -- View this message in context: http://r.789695.n4.nabble.com/rcom-and-safearray-type-of-data-tp2548552p2551426.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.e

[R] accumulation curves

2010-09-22 Thread Kyran Staunton
Hi, I am trying to fit a logarithmic trendline to a scatterplot of a species accumulation curve. I've tried abline, lines, curve and scatter.smooth but none of these work. Can anyone help please, Kyran __ R-help@r-project.org mailing list https://stat

Re: [R] Problem with outer()

2010-09-22 Thread Christofer Bogaso
Thanks Petr for your input. As you correctly said to make the function vectorize, I have done it and it is working fine: > fff=Vectorize(function(x,y) { +AA <- sign(x) +BB <- sign(y) +CC <- abs(y) +DD1

Re: [R] extending survival curves past the last event using plot.survfit

2010-09-22 Thread David Winsemius
On Sep 22, 2010, at 8:15 PM, Krambrink, Amy M wrote: Hello, I'm using plot.survfit to plot cumulative incidence of an event. Essentially, my code boils down to: cox <-coxph(Surv(EVINF,STATUS) ~ strata(TREAT) + covariates, data=dat) surv <- survfit(cox) plot(surv,mark.time=F,fun="event")

[R] randomForest - PartialPlot - reg

2010-09-22 Thread Vijayan Padmanabhan
Dear R Group I am not sure if this is the right forum to raise this query, but i would rather give it a try and aim for reaching the right person who might be a part of this group who can help. I have a query on interpretation of PartialPlot in package randomForest. In my earlier queries in thi

Re: [R] Passing a function as a parameter...

2010-09-22 Thread Liaw, Andy
One possibility: R> f = function(x, f) eval(as.call(list(as.name(f), x))) R> f(1:10, "mean") [1] 5.5 R> f(1:10, "max") [1] 10 Andy From: Jonathan Greenberg > R-helpers: > > If I want to pass a character name of a function TO a > function, and then > have that function executed, how would I do

Re: [R] Passing a function as a parameter...

2010-09-22 Thread Joshua Wiley
Hi, I think the easiest way is with match.fun(). For instance: apply_some_function <- function(data, function_name) { FUN <- match.fun(function_name) FUN(data) } > apply_some_function(1:10,"mean") [1] 5.5 > apply_some_function(1:10,"min") [1] 1 Cheers, Josh On Wed, Sep 22, 2010 at 4:06 P

[R] Passing a function as a parameter...

2010-09-22 Thread Jonathan Greenberg
R-helpers: If I want to pass a character name of a function TO a function, and then have that function executed, how would I do this? I want an arbitrary version of the following, where any function can be used (e.g. I don't want the if-then statement here): apply_some_function <- function(data,

[R] extending survival curves past the last event using plot.survfit

2010-09-22 Thread Krambrink, Amy M
Hello, I'm using plot.survfit to plot cumulative incidence of an event. Essentially, my code boils down to: cox <-coxph(Surv(EVINF,STATUS) ~ strata(TREAT) + covariates, data=dat) surv <- survfit(cox) plot(surv,mark.time=F,fun="event") Follow-up time extends to 54 weeks, but the last e

Re: [R] "statistic" term in boot function

2010-09-22 Thread David Winsemius
On Sep 22, 2010, at 12:24 PM, alfredo wrote: Hi There, Just a question regarding the function that is specified to boot (I have read the help, the manual and online examples.). The description of boot says that the second argument of "statistic" (non parametric bootstrap) must

Re: [R] "statistic" term in boot function

2010-09-22 Thread Jorge Ivan Velez
Hi Alfredo, Short answer is no. As en example, consider the following: # example require(boot) x <- c(4, 4, 4, 3, 2, 4, 4, 3, 6, 2) res <- boot(x, function(v, index) mean(v[index]), R = 1000) res str(res) More information can be found under ?boot (after loaging the boot package) as well a

Re: [R] How to change the xlab name's color?

2010-09-22 Thread Bill.Venables
?par See col.lab, col.main, col.sub, &c. To see what colours are available you can use colours() (or colors() if you don't speak English). -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of tooblue Sent: Thursday, 23 September 201

Re: [R] import csv file problem

2010-09-22 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of sisxy > Sent: Wednesday, September 22, 2010 5:25 PM > To: r-help@r-project.org > Subject: [R] import csv file problem > > > Hello, i am trying to import the csv file into R . >

[R] How to change the xlab name's color?

2010-09-22 Thread tooblue
What I want is different colors corresponding to the different names, which are the colors' names. -- View this message in context: http://r.789695.n4.nabble.com/How-to-change-the-xlab-name-s-color-tp2551264p2551264.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] import csv file problem

2010-09-22 Thread Erik Iverson
On 09/22/2010 07:24 PM, sisxy wrote: Hello, i am trying to import the csv file into R . i have a file saved as csv in my desktop. My laptop is Window vista, version R is 2.10.1. then i used the code Q<-read.csv("Q.csv",header=TRUE) R will search in its working directory for Q.csv. What is t

Re: [R] import csv file problem

2010-09-22 Thread jim holtman
You are not in the correct directory. Use read.csv(file.choose()) so that you can interactively choose the correct location. On Wed, Sep 22, 2010 at 8:24 PM, sisxy wrote: > > Hello, i am trying to import the csv file into R . > i have a file saved as csv in my desktop. > My laptop is Window vi

[R] import csv file problem

2010-09-22 Thread sisxy
Hello, i am trying to import the csv file into R . i have a file saved as csv in my desktop. My laptop is Window vista, version R is 2.10.1. then i used the code > Q<-read.csv("Q.csv",header=TRUE) then my error is Error in file(file, "rt") : cannot open the connection In addition: Warning me

Re: [R] Newey West and Singular Matrix

2010-09-22 Thread Achim Zeileis
On Wed, 22 Sep 2010, ivo welch wrote: dear R experts:  I am writing my own little newey-west standard error function, with heteroskedasticity and arbitrary x period autocorrelation corrections.  including my function in this post here may help others searching for something similar. it is worki

Re: [R] Doing operations by grouping variable

2010-09-22 Thread Michael Bedward
Thanks for that terrific post Bill - I learnt a lot. One question, should this line d <- within(d, interaction(g1, g2, drop=TRUE)) be this ? d <- within(d, g1g2 <- interaction(g1, g2, drop=TRUE)) Michael On 23 September 2010 03:50, William Dunlap wrote: >> -Original Message- >> From:

Re: [R] coxme AIC score and p-value mismatch??

2010-09-22 Thread Teresa Iglesias
Indeed! That is what was confusing me too. Glad you figured it out. -Teresa On Wed, Sep 22, 2010 at 7:31 AM, whoppitt [via R] < ml-node+2550409-1571116512-138...@n4.nabble.com > wrote: > I think I've figured it out, the AIC column is the IMPROVEMENT in AIC > compared to the null model. So bigger

Re: [R] Determine area between two density plots

2010-09-22 Thread Peter Alspach
Tena koe Ralf If you save the results of density() x1Den <- density(x1) you get the x and y values of the line which is plotted. Similarly for x2 - you can then use these to shade the joint area and find the area. Tinkering with the arguments of density to make the x values for each the same

Re: [R] Determine area between two density plots

2010-09-22 Thread David Winsemius
On Sep 22, 2010, at 4:54 PM, Ralf B wrote: Hi group, I am creating two density plots as shown in the code below: x1 <- c(1,4,5,3,2,3,4,5,6,5,4,3,2,1,1,1,2,3) x2 <- c(1,4,5,3,5,7,4,5,6,1,1,1,2,1,1,1,2,3) plot(density(x1, na.rm = TRUE)) polygon(density(x2, na.rm = TRUE), border="blue") How can

Re: [R] rcom and safearray type of data

2010-09-22 Thread Erich Neuwirth
rcom has its own mailing list. Please subscribe to this list at rcom.univie.ac.at and post your question there. On 9/21/2010 2:53 PM, Alex Bird wrote: > > Hello there, > > I started to use rcom package and there were no problems until I tried to > call some external function (method) which ret

[R] Determine area between two density plots

2010-09-22 Thread Ralf B
Hi group, I am creating two density plots as shown in the code below: x1 <- c(1,4,5,3,2,3,4,5,6,5,4,3,2,1,1,1,2,3) x2 <- c(1,4,5,3,5,7,4,5,6,1,1,1,2,1,1,1,2,3) plot(density(x1, na.rm = TRUE)) polygon(density(x2, na.rm = TRUE), border="blue") How can I determine the area that is covered between t

[R] How to Ignore NaN values in Rows when using hclust function in making Heatmap??

2010-09-22 Thread BD
I am making heatmaps for a dataset (~ 300*600 matrix) with the following R script (I am not familiar with R and this is the first time I am using it). library("gplots") library("Cairo") mydata <- read.csv(file="data.csv", header=TRUE, sep=",") rownames(mydata)=mydata$Name mydata <- mydata[,2:297

Re: [R] Unique subsetting question

2010-09-22 Thread AndrewPage
Oops, yeah I didn't see that. Thanks, Andrew -- View this message in context: http://r.789695.n4.nabble.com/Unique-subsetting-question-tp2550453p2550865.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing lis

Re: [R] speeding up regressions using ddply

2010-09-22 Thread Greg Snow
Why do you want to do this? If there is just a small part of the logistic regression that you are interested in, then there may be a way to compute or approximate that more quickly than doing a full glm fit on every pair. It seems unlikely that you would get much meaning out of that many full

Re: [R] legend

2010-09-22 Thread David Winsemius
On Sep 22, 2010, at 3:03 PM, David Winsemius wrote: On Sep 22, 2010, at 2:58 PM, David Winsemius wrote: On Sep 22, 2010, at 1:39 PM, threshold wrote: Hi, there is a function to plot survival curves: library(survival) plot.KM <- function(survival, x, x_cut.off, main='', label='') { plot(

Re: [R] Multiple Lorenz curves in one diagram

2010-09-22 Thread David Winsemius
On Sep 22, 2010, at 3:32 PM, Ralf B wrote: Hi group, I would like to draw multiple Lorenz curves in a single plot using data already prepared. Here is a simple example: require("lawstat") lorenz.curve(c(1,2,3),c(4,5,4)) #You can get a half-assed solution by separating the two plot calls w

[R] Multiple Lorenz curves in one diagram

2010-09-22 Thread Ralf B
Hi group, I would like to draw multiple Lorenz curves in a single plot using data already prepared. Here is a simple example: require("lawstat") lorenz.curve(c(1,2,3),c(4,5,4)) lorenz.curve(c(1,2,3),c(4,2,1)) This example draws two separate graphs. How can I combine them in a distinguishable way

Re: [R] problem opening pdf device on Windows 7

2010-09-22 Thread Peter Dalgaard
On 09/22/2010 05:28 PM, anupam wrote: > I can not open PDf device. Acrobat is closed. I have checked archives but > could not find a solution. What should I do? > >> cont.cdfplot("myanalysis.pdf", myanalysis$CDF, ylbl.r="Stream Length (km)") > Error in pdf(file = pdffile, width = width, height =

Re: [R] legend

2010-09-22 Thread David Winsemius
On Sep 22, 2010, at 2:58 PM, David Winsemius wrote: On Sep 22, 2010, at 1:39 PM, threshold wrote: Hi, there is a function to plot survival curves: library(survival) plot.KM <- function(survival, x, x_cut.off, main='', label='') { plot(survfit(survival ~ I(x >= x_cut.off)), main=main) legen

Re: [R] legend

2010-09-22 Thread David Winsemius
On Sep 22, 2010, at 1:39 PM, threshold wrote: Hi, there is a function to plot survival curves: library(survival) plot.KM <- function(survival, x, x_cut.off, main='', label='') { plot(survfit(survival ~ I(x >= x_cut.off)), main=main) legend('bottomleft', c(expression(label >= x_cut.off),expr

Re: [R] Extracting bins and frequencies from frequency table

2010-09-22 Thread Henrique Dallazuanna
Try this: as.data.frame(table(x1)) On Wed, Sep 22, 2010 at 3:44 PM, Ralf B wrote: > Dear R users, > > I would like to great a frequency table from raw data and then access > the classes/bins and > their respective frequencies separately. Here the code to create the > frequency tables: > > > x1

Re: [R] Extracting bins and frequencies from frequency table

2010-09-22 Thread Phil Spector
Ralf - Try bins = as.numeric(names(t1)) freqs = as.vector(t1) - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] Extracting bins and frequencies from frequency table

2010-09-22 Thread Mike Rennie
Hi Ralf try hist() obl<-hist(x1, plot=FALSE) it returns midpoints and their respective frequencies. You can specify the breakpoints as well. ?hist for details. Mike On Wed, Sep 22, 2010 at 1:44 PM, Ralf B wrote: > Dear R users, > > I would like to great a frequency table from raw data and

Re: [R] Unique subsetting question

2010-09-22 Thread Ista Zahn
I already gave you three examples of how this works. Your last request can be done in exactly the same way. Give it a try and see what happens (use example data of course!). As a last resort you could read the documentation: ?Comparison ?Extract -Ista On Wed, Sep 22, 2010 at 2:22 PM, AndrewPage

[R] Extracting bins and frequencies from frequency table

2010-09-22 Thread Ralf B
Dear R users, I would like to great a frequency table from raw data and then access the classes/bins and their respective frequencies separately. Here the code to create the frequency tables: x1 <- c(1,5,1,1,2,2,3,4,5,3,2,3,6,4,3,8) t1 <- table(x1) print(t1[1]) Its easy to plot this, but how do

Re: [R] Unique subsetting question

2010-09-22 Thread Ista Zahn
Hi Andrew, Perhaps you did not notice my previous email. The answer is still the same (see below): On Wed, Sep 22, 2010 at 1:48 PM, AndrewPage wrote: > > How about this: > > > s = c("aa", "bb", "cc", "", "aa", "dd", "", "aa") > > n = c(2, 3, 5, 6, 7, 8, 9, 3) > > b = c(TRUE, FALSE, TRUE, TRUE, FA

Re: [R] Unique subsetting question

2010-09-22 Thread AndrewPage
Thanks-- that works for what I'm trying to do. I was also wondering, in the data frame example you gave, if I just wanted to get rid of rows where the "a" value is 5, how would I do that? -- View this message in context: http://r.789695.n4.nabble.com/Unique-subsetting-question-tp2550453p25508

Re: [R] reshape is re-ordering my variables

2010-09-22 Thread Kevin E. Thorpe
On 09/21/2010 09:44 PM, Dennis Murphy wrote: Hi: Reshaping multiple variables is nontrivial. Try the following (untested): reshape(rcw, idvar = 'ICU', varying = list(c(paste('Q6.RC', 1:4, sep = '.'), c(paste('Q6.FT.RC', 1:4, 'years', sep = '.'),

Re: [R] Unique subsetting question

2010-09-22 Thread AndrewPage
How about this: s = c("aa", "bb", "cc", "", "aa", "dd", "", "aa") n = c(2, 3, 5, 6, 7, 8, 9, 3) b = c(TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE) df = data.frame(n, s, b) # df is a data frame I want to display df with no value in s occurring more than once. Also, I want to

Re: [R] Unique subsetting question

2010-09-22 Thread Ista Zahn
Hi Andrew, You can use duplicated() to index the rows you wish to keep, like this: test.dat <- data.frame(a=c(1,1:5,5:10), b=1:12, c=letters[1:12]) #make up data duplicated(test.dat$a) # see what duplicated() function does !duplicated(test.dat$a) # see how we can invert using the ! function so t

Re: [R] Doing operations by grouping variable

2010-09-22 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Seth W Bigelow > Sent: Tuesday, September 21, 2010 4:22 PM > To: bill.venab...@csiro.au > Cc: r-help@r-project.org > Subject: Re: [R] Doing operations by grouping variable > > Aa

[R] legend

2010-09-22 Thread threshold
Hi, there is a function to plot survival curves: library(survival) plot.KM <- function(survival, x, x_cut.off, main='', label='') { plot(survfit(survival ~ I(x >= x_cut.off)), main=main) legend('bottomleft', c(expression(label >= x_cut.off),expression(label < x_cut.off))) } Now, I need to determ

Re: [R] Unique subsetting question

2010-09-22 Thread AndrewPage
I just figured that out, but the real data I'm using is a data frame for sure, so I'll find another example. -- View this message in context: http://r.789695.n4.nabble.com/Unique-subsetting-question-tp2550453p2550736.html Sent from the R help mailing list archive at Nabble.com.

[R] problem opening pdf device on Windows 7

2010-09-22 Thread anupam
I can not open PDf device. Acrobat is closed. I have checked archives but could not find a solution. What should I do? > cont.cdfplot("myanalysis.pdf", myanalysis$CDF, ylbl.r="Stream Length (km)") Error in pdf(file = pdffile, width = width, height = height) : unable to start device pdf In addi

Re: [R] help with sockets in R

2010-09-22 Thread Christopher Bare
Hi, Thanks for the advice! My locale and encoding setting follow: > Sys.getlocale() [1] "en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8" > getOption("encoding") [1] "native.enc" I was indeed able to solve my immediate problem by using readLines to read the whole response and parse it later,

Re: [R] Unique subsetting question

2010-09-22 Thread David Winsemius
On Sep 22, 2010, at 12:35 PM, AndrewPage wrote: I understand how duplicated and unique work for a list where all parts of a given row are duplicated, or how to find duplicated values if I'm just looking at that first column, but in this case the rows for 1954 and 1955 are not completely

Re: [R] Unique subsetting question

2010-09-22 Thread AndrewPage
I understand how duplicated and unique work for a list where all parts of a given row are duplicated, or how to find duplicated values if I'm just looking at that first column, but in this case the rows for 1954 and 1955 are not completely the same; only quarter 1 is duplicated, so I'm not sure h

[R] Ordinal mixed model

2010-09-22 Thread Patrick Walsh
Hello, I am trying to build a generalised linear mixed model.  My dependent variable is ordinal.  I have a random factor (7 individuals), and a repeated measure where the dependent variable was measured three times for each of four attempts (so the repeats are nested).  I also have a few covari

[R] "statistic" term in boot function

2010-09-22 Thread alfredo
Hi There, Just a question regarding the function that is specified to boot (I have read the help, the manual and online examples.). The description of boot says that the second argument of "statistic" (non parametric bootstrap) must be a vector of indices, frequencies or weights which def

Re: [R] kstest vs shapirotest

2010-09-22 Thread Greg Snow
The way that you called ks.test below your null hypothesis is that your data comes from a normal distribution with mean 0 and standard deviation 1. Now I am not familiar with your data, but I would be very surprised in general to find a population of trees where half of them had negative height

Re: [R] failure to access packages

2010-09-22 Thread Graves, Gregory
The problem R ver is 2.10.1 - I am using 2.11.1 Running windows xp sp3 - same system as what I use The suggested solution is for the user to upgrade to 2.11.1 to resolve package incompatibilities Gregory A. Graves, Lead Scientist Everglades REstoration COoordination and VERification (RECOVER) R

Re: [R] For loop with ifelse help

2010-09-22 Thread Pele
Hi David - thanks for your suggestion, but I am trying to avoid doing any merging and sorting for this step because the real file I will be working with has about 20 million records. If I can get this loop or something similar to work will be good enough. thanks again.. -- View this message

Re: [R] Crash report: regexpr("a{2-}", "")

2010-09-22 Thread Brian Diggs
On 9/21/2010 8:04 PM, Henrik Bengtsson wrote: Each of the following calls crash ("core dumps") R (R --vanilla) on various versions and OSes: regexpr("a{2-}", "") sub("a{2-}", "") gsub("a{2-}", "") EXAMPLES: To add another (windows) example it also crashes the 2.12.0 alpha build: > sessionIn

Re: [R] Unique subsetting question

2010-09-22 Thread Ivan Calandra
Hi, Take a look at ?duplicated and ?unique HTH, Ivan Le 9/22/2010 16:55, AndrewPage a écrit : > Hi all, > > I'm looking at a large data set, and I'm interested in removing rows where > only one variable is duplicated. Here's an example: > >> presidents > Qtr1 Qtr2 Qtr3 Qtr4 > 1945 NA

[R] Unique subsetting question

2010-09-22 Thread AndrewPage
Hi all, I'm looking at a large data set, and I'm interested in removing rows where only one variable is duplicated. Here's an example: > presidents Qtr1 Qtr2 Qtr3 Qtr4 1945 NA 87 82 75 1946 63 50 43 32 1947 35 60 54 55 1948 36 39 NA NA 1949 69 57 57

Re: [R] Can ucminf be installed in 64 bit R and one more question?

2010-09-22 Thread Hey Sky
hey, Ravi yes. I have tried the hessian() in the numDeriv package and it is the same package ucminf() uses to calculate the hessian matrix while having the option "hessian=1". maybe I should avoid the word fail but instead using some others. anyway, what I mean in the former post is the hes

[R] bctrans: Box-Cox Transformation Problem

2010-09-22 Thread Axel Kasparek
Hello, I'm currently trying to model the movement of a slope (v.obs) with a regression model. The data can be found following the given links: either http://www.sendspace.com/file/dnugwc or http://rapidshare.com/files/420569660/sel.day.txt I want to use the Box-Cox transformation to normalize

Re: [R] For loop with ifelse help

2010-09-22 Thread David Winsemius
On Sep 22, 2010, at 11:42 AM, Pele wrote: Hello R users, I have 2 files (file1 and f2) and I am trying to sum columns 6:10 of a specific row in f2 and append it in file 1 if the "state" variable in file 1 equals the rowname in f2. Below is an example of the code I wrote using a for loop,

Re: [R] Can ucminf be installed in 64 bit R and one more question?

2010-09-22 Thread Hey Sky
thanks. Duncan. previously I try to install the 32 bit ucminf on a 64 bit R thus it cannot fit in. thanks for the link and I have downloaded  and installed it. it works perfect. Nan   - Original Message From: Duncan Murdoch To: Hey Sky Cc: R Sent: Tue, September 21, 2010 12:5

Re: [R] failure to access packages

2010-09-22 Thread Graves, Gregory
I am helping a fellow worker get R up and running, and he has run into a peculiar problem I've not encountered in previous install situations. >From the Rconsole menu choice, he can set CRAN mirror to USA CA2, but when he >selects "load packages" a very truncated list of packages appears (many

Re: [R] Problem with ggplot2 - Boxplot

2010-09-22 Thread Hadley Wickham
That implies you need to update your version of plyr. Hadley On Wed, Sep 22, 2010 at 4:10 AM, RaoulD wrote: > > Hi, > > I am using ggplot2 to create a boxplot that summarizes a continuous > variable. This code works fine for me on one PC however when I use it on > another it doesnt. > > The struc

[R] For loop with ifelse help

2010-09-22 Thread Pele
Hello R users, I have 2 files (file1 and f2) and I am trying to sum columns 6:10 of a specific row in f2 and append it in file 1 if the "state" variable in file 1 equals the rowname in f2. Below is an example of the code I wrote using a for loop, but it not working (i.e it only works for the la

Re: [R] defining set of variables in a formula

2010-09-22 Thread Ivan Calandra
Hi, Try with ".": model<- lm(y~., data=data) From ?formula: "There are two special interpretations of |.| in a formula. The usual one is in the context of a |data| argument of model fitting functions and means 'all columns not otherwise in the formula': see |terms.formula

Re: [R] defining set of variables in a formula

2010-09-22 Thread Erik Iverson
Ozlem, Just read ?formula, where it says: There are two special interpretations of ‘.’ in a formula. The usual one is in the context of a ‘data’ argument of model fitting functions and means ‘all columns not otherwise in the formula’: see ‘terms.formula’. In the context of

[R] defining set of variables in a formula

2010-09-22 Thread Ozlem Yanmaz
Dear fellow R users, I am trying to conduct a regression analysis. I have thousands of variables. The names are V1, V2,V2000 Is there an easy way to include these variables in the regression? my model is something like that: model<- lm(y~V1+V2+.+V2000, data=data) Thanks so much in ad

Re: [R] Asking Favor

2010-09-22 Thread Petr PIKAL
Hi what exactly do you want. You say you can read your data x <- read.jpeg(system.file("data", "cat.jpg", package="rimage")) plot(x) What do you mean by pixel image? By reading a picture you get an object imagematrix > str(x) imagematrix [1:420, 1:418, 1:3] 0.255 0.251 0.247 0.247 0.255 .

[R] Odp: Problem with outer()

2010-09-22 Thread Petr PIKAL
Hi It is difficult to give some help as you did not provide any clue what the result shall be. basically outer takes 2 vectors and evaluate function for each combination of elements in both vectors. However the function has to be vectorised and your function is not. fff=function(x,y) { +

[R] reliability of the level-1 random coefficients (lme4)

2010-09-22 Thread Luana Marotta
Hello everyone, I want to estimate the reliability *of the level*-*1 random coefficients (the one *reported in the HLM output) using the software R. Does anyone know how to get this statistic from R? I'm using the function "lmer" of the package "lme4" to estimate multilevel models. I tried to use

Re: [R] speeding up regressions using ddply

2010-09-22 Thread Abhijit Dasgupta, PhD
There has been a recent addition of parallel processing capabilities to plyr (I believe v1.2 and later), along with a dataframe iterator construct. Both have improved performance of ddply greatly for multicore/cluster computing. So we now have the niceness of plyr's grammar with pretty good pe

Re: [R] speeding up regressions using ddply

2010-09-22 Thread Ista Zahn
Hi Alison, On Wed, Sep 22, 2010 at 11:05 AM, Alison Macalady wrote: > > > Hi, > > I have a data set that I'd like to run logistic regressions on, using ddply > to speed up the computation of many models with different combinations of > variables. In my experience ddply is not particularly fast.

Re: [R] coxme AIC score and p-value mismatch??

2010-09-22 Thread whoppitt
I think I've figured it out, the AIC column is the IMPROVEMENT in AIC compared to the null model. So bigger values are better. -- View this message in context: http://r.789695.n4.nabble.com/coxme-AIC-score-and-p-value-mismatch-tp2333980p2550409.html Sent from the R help mailing list archive at N

Re: [R] eigen and svd

2010-09-22 Thread Ravi Varadhan
It does for real-symmetric and complex Hermitian matrices, i.e. the $u and $v from svd() are the same as $vectors from eigen() for Hermitian matrices. There might be differences in signs, but that does not matter. Of course the singular values and eigenvalues are identical too. Ravi. -Origina

Re: [R] coxme AIC score and p-value mismatch??

2010-09-22 Thread whoppitt
The AICs do not seem right to me either. Unless I am missing something, it appears that the formula: AIC= -2x logLik -2k is being applied, rather than: AIC= -2x logLik +2k Meaning models with fewer degrees of freedom are being penalised. So in your example I make the degrees of freedom 9.61 +2

Re: [R] extracting random effects from model formula

2010-09-22 Thread David Winsemius
On Sep 22, 2010, at 5:09 AM, Lorenzo Cattarino wrote: actually I need to extract the random effect from the formula, not the model any idea? From: Sacha Viquerat [mailto:sacha.v...@googlemail.com] Sent: Wed 22/09/2010 5:55 PM To: Lorenzo Cattarino Subject:

Re: [R] merge verctor and matrix

2010-09-22 Thread David Winsemius
On Sep 22, 2010, at 3:57 AM, Yuan Jian wrote: hi, can anyone tell me how to merge a vector and a matrix? v=c(1,4,2) names(v)=c("e","r","t") m=matrix(c("r","t","r","s","e",5,6,7,8,9),nr=5) colnames(m)=c("c1","c2") I want to do like merge(v, m, by.x="names",by.y="c1") I got error Error in fix.b

Re: [R] merge verctor and matrix

2010-09-22 Thread Peng, C
> v=data.frame(c1=c("e","r","t"),v=c(1,4,2) ) > m=matrix(c("r","t","r","s","e",5,6,7,8,9),nr=5) > colnames(m)=c("c1","c2") > m=as.data.frame(m) > merge(v, m, by ="c1" ) c1 v c2 1 e 1 9 2 r 4 5 3 r 4 7 4 t 2 6 -- View this message in context: http://r.789695.n4.nabble.com/merge-v

Re: [R] merge verctor and matrix

2010-09-22 Thread Henrique Dallazuanna
Try this: merge(m, v, by.x = 'c1', by.y = 0, all = TRUE, sort = FALSE) On Wed, Sep 22, 2010 at 4:57 AM, Yuan Jian wrote: > hi, > can anyone tell me how to merge a vector and a matrix? > > v=c(1,4,2) > > names(v)=c("e","r","t") > > m=matrix(c("r","t","r","s","e",5,6,7,8,9),nr=5) > > colnames(m)

Re: [R] eigen and svd

2010-09-22 Thread RICHARD M. HEIBERGER
X = U D V' ## D are the singular values of X X'X = V D^2 V' ## D^2 are the eigenvalues of X'X V is the same in both factorizations. 2010/9/22 Ondřej Mikula > Dear R-helpers, > could anybody explain me briefly what is the difference between > eigenvectors returned by 'eigen' and 'svd' funct

Re: [R] best model cp mallow

2010-09-22 Thread Peng, C
I think you need to set up a cut-off of Cp and then get the "good" values of Cp from adjr$Cp. -- View this message in context: http://r.789695.n4.nabble.com/best-model-cp-mallow-tp2550015p2550283.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] eigen and svd

2010-09-22 Thread Peng, C
svd() does not return eigeinvectors! -- View this message in context: http://r.789695.n4.nabble.com/eigen-and-svd-tp2550210p2550257.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch

[R] apply union function vectorially

2010-09-22 Thread statquant2
Hello everybody, I have a list.array which is a list containing arrays, lets say list.array= list( c(1,2,3),c(5,6,7),c(1,4,6,7,8) ); I would like to apply the union function to those 3 vectors to get the union of the three : [1,2,3,4,5,6,7,8] I tried do.call(what=union,args=list.array) but this i

Re: [R] Error in eval(expr, envir, enclos)

2010-09-22 Thread uttara_n
Hello, I just figured out that there was some problem with my dataset. So, the Regression is working fine now. Thanks a lot for all your help and suggestions. Uttara -- View this message in context: http://r.789695.n4.nabble.com/Error-in-eval-expr-envir-enclos-tp2547917p2550252.html Sent from

Re: [R] Problem with ggplot2 - Boxplot

2010-09-22 Thread statquant2
Hi, are you sure you have the same version R + packages version on both ? -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-ggplot2-Boxplot-tp2549970p2549997.html Sent from the R help mailing list archive at Nabble.com. __ R

Re: [R] extracting random effects from model formula

2010-09-22 Thread Lorenzo Cattarino
actually I need to extract the random effect from the formula, not the model any idea? From: Sacha Viquerat [mailto:sacha.v...@googlemail.com] Sent: Wed 22/09/2010 5:55 PM To: Lorenzo Cattarino Subject: Re: [R] extracting random effects from model formula Am

[R] Problem with ggplot2 - Boxplot

2010-09-22 Thread RaoulD
Hi, I am using ggplot2 to create a boxplot that summarizes a continuous variable. This code works fine for me on one PC however when I use it on another it doesnt. The structure of the dataset AHT_TopCD is SubReason=Categorical variable, AHT=Continuous variable. The code for the boxplot: requi

[R] merge verctor and matrix

2010-09-22 Thread Yuan Jian
hi, can anyone tell me how to merge a vector and a matrix? > v=c(1,4,2) > names(v)=c("e","r","t") > m=matrix(c("r","t","r","s","e",5,6,7,8,9),nr=5) > colnames(m)=c("c1","c2") I want to do like merge(v, m, by.x="names",by.y="c1") I got error Error in fix.by(by.x, x) : 'by' must specify valid column(

[R] extracting random effects from model formula

2010-09-22 Thread Lorenzo Cattarino
Hi again, Sorry, probably I was not clear enough. I was wondering if there is a way in R to identify (and extract) only the random effects, which, because I am using the lmer function, are the terms with the symbol | on the left side of the grouping variable ("SITE" in my example). Than

Re: [R] predict.lrm ( Design package) poor performance?

2010-09-22 Thread Chris Mcowen
Thats great thanks, I suppose it is hard to move away from a more "traditional" measure of performance such a percentage correct, at least for the relatively amateur statisticians among us who have been graded on such a system. The difficulty comes in reporting the effectiveness of the model to

[R] best model cp mallow

2010-09-22 Thread Alfredo Alessandrini
Hi, I'm using the Cp and Radj method for the selection of variable, with the library leaps. I need to save the best model in a file. If I use the "adjr2" method it's work, but I've a problem with "Cp" method: > adjr <- leaps(x,y,method="adjr2") > maxadjr(adjr) 12312 0.713 0.56 ok... but

[R] speeding up regressions using ddply

2010-09-22 Thread Alison Macalady
Hi, I have a data set that I'd like to run logistic regressions on, using ddply to speed up the computation of many models with different combinations of variables. I would like to run regressions on every unique two-variable combination in a portion of my data set, but I can't quite

Re: [R] kstest vs shapirotest

2010-09-22 Thread Peng, C
In general Shapiro's normality test is more powerful than the KS. For this specific case, I don't see the significantly different results from both tests. The normality assumption in this example seems to be questionable. -- View this message in context: http://r.789695.n4.nabble.com/kstest-vs-s

  1   2   >