Re: [R] help with sockets in R

2010-09-22 Thread Prof Brian Ripley
readLines() is for a text-mode connection; readChar() is for a binary-mode connection. Given that you asked for possible re-encoding by the 'encoding' argument, you cannot safely mix them (text-mode access is re-encoded, binary-mode is not). However, we don't know if re-encoding was active

Re: [R] Package for calculating bandwidths

2010-09-22 Thread Brocker84
Thx so much, especially to Dennis. -- View this message in context: http://r.789695.n4.nabble.com/Package-for-calculating-bandwidths-tp2548091p2549796.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] Help with mclust package

2010-09-22 Thread Basilea Watson
Hi, I am trying to run th mclust package on a variable Tuberculin indurations recorded as mm. The file has only one variable. When I run the package I get NULL value for mu and sigma. Can anybody say why? This is the program: library(mclust) mc-Mclust(x.trab,G=1:9,warn=TRUE) mc mc$mu

[R] extracting random effects from model formula

2010-09-22 Thread Lorenzo Cattarino
Hi R-users I would like to extract the random effects (1|SITE, 1+SPECIES|SITE and BA|SITE) from this model formula: Full_model - formula (VAR ~ (1|SITE) + (1+SPECIES|SITE) + (BA|SITE) + HEIGHT + COND + NN_DIST) I tried: terms(Full_model) labels(terms(Full_model)) but I could

Re: [R] labels in (box)plot

2010-09-22 Thread Ivan Calandra
Hi Dennis, Thanks for your answer (for some reason, the only one). I could do that for sure, but I think it looks better if the labels are all horizontal. Anyway, it looks like what I wanted to do is not really possible. I have to play with the arguments I already know... Regards, Ivan Le

Re: [R] invalid 'row.names' length error when running scatterplots or plot in R Commander

2010-09-22 Thread Samantha McKenzie
Thank you everyone for your helpful feedback. To clarify a few things that people have been asking: Part of the problem comes from the fact that these are external students, so our conversations are over email and I'm not there to try things. I admit my shortcomings when it comes to R script

Re: [R] removed data is still there!

2010-09-22 Thread Ivan Calandra
Hi, I agree with you that levels should not be automatically dropped after subsetting. However, I think there should/can be an extra argument to make it possible (the default being no dropping). I have no example in mind, but I guess it is possible that sometimes, one want to show only some

[R] Problem with outer()

2010-09-22 Thread Christofer Bogaso
Dear all, I have following piece of codes: xx - seq(-2,2, length.out=11) mat1 - cbind(rep(43, 5), rnorm(5)) mat2 - cbind(rep(53, 5), rnorm(5)) outer(c(1,-1), xx, function(x,y) { AA - sign(x) BB - sign(y) CC - abs(y)

Re: [R] Colorramp in Maptools, how to choose min and max values for the fg= argument

2010-09-22 Thread schaber
Hi Jannis, thanks a lot for your reply. Unfortunately the solution you proposed does not work. Maybe the reason is, that plot.Map only accepts hsv colours and I do not know to convert the rgb colours to the right colour space. Isn't there a possibility to specify minimal an maximal values

Re: [R] Colorramp in Maptools, how to choose min and max values for the fg= argument

2010-09-22 Thread Barry Rowlingson
On Wed, Sep 22, 2010 at 9:56 AM, schaber kscha...@ipp.mpg.de wrote: Hi Jannis, thanks a lot for your reply. Unfortunately the solution you proposed does not work. Maybe the reason is, that plot.Map only accepts hsv colours and I do not know to convert the rgb colours to the right colour

[R] efficient list indexing

2010-09-22 Thread Alaios
Hello everyone, I need some help with lists inside lists (a good way to emulate a struct)\ Assume that there is a small list called fred: fred - list(happy = 1:10, name = squash) and a big list called bigfred that includes fred list 5 times bigfred - rep(fred,5) Is it possible somehow to

Re: [R] efficient list indexing

2010-09-22 Thread Patrick Burns
I'm confused by what you are looking for. There's some slight possibility that you are looking for double bracket subscripting with a vector: list(a=1:5, b=letters)[[c(2,4)]] [1] d On 22/09/2010 10:58, Alaios wrote: Hello everyone, I need some help with lists inside lists (a good way to

Re: [R] randomForest - partialPlot - Reg

2010-09-22 Thread Liaw, Andy
From: Vijayan Padmanabhan Dear R Group I had an observation that in some cases, when I use the randomForest model to create partialPlot in R using the package randomForest the y-axis displays values that are more than -1! It is a classification problem that i was trying to address. Any

Re: [R] group means of multi-way table?

2010-09-22 Thread Jim Lemon
On 09/22/2010 08:52 AM, Simon Kiss wrote: hello, can someone tell me how to generate the means for a data frame that looks like this? My data frame has many more variables, but I won't bother you with those; these are the one's that I'm interested in. Needless to say, z is the variable in which

Re: [R] efficient list indexing

2010-09-22 Thread Keith Jewell
Also, it may be that you want bigfred to be a list of 5 lists each of 2 elements (happy and name) rather than a list of 10 elements. Thus (also using double bracketing) fred- list(happy = 1:10, name = squash) bigfred - replicate(5, fred, FALSE) bigfred[[2]][[2]] hth Keith J Patrick Burns

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

2010-09-22 Thread Frank Harrell
% correct is an improper scoring rule and a discontinuous one to boot. So it will not always agree with more proper scoring rules. When you have a more difficult task, e.g., discriminating more categories, indexes such as the generalized c-index that utilize all the categories will recognize

[R] Referencing factor name

2010-09-22 Thread Paul Chatfield
Simple problem - I want the ylab to automatically pick up x1 rather than having to define x1 in the plot statement. x1-c(1.2,2,3);x2-c(1,2.1,2.6) y-x1 plot(1:3,y, ylab=x1) There must be a way of accessing the name x1 somehow, but unfortunately I don't know how to search for it. Any help

Re: [R] efficient list indexing

2010-09-22 Thread Dennis Murphy
Hi: I believe we had this discussion yesterday, http://r.789695.n4.nabble.com/Object-oriented-programming-in-R-td2538541.html#a2538916 but since you chose to repeat that message, it clearly wasn't enough, so start with http://cran.r-project.org/doc/manuals/R-intro.html#Lists

Re: [R] Referencing factor name

2010-09-22 Thread Dennis Murphy
Hi: I presume you mean x1-c(1.2,2,3) y - 'x1' plot(1:3, get(y), ylab = y) ?? HTH, Dennis On Wed, Sep 22, 2010 at 4:44 AM, Paul Chatfield p.s.chatfi...@reading.ac.uk wrote: Simple problem - I want the ylab to automatically pick up x1 rather than having to define x1 in the plot statement.

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

2010-09-22 Thread Chris Mcowen
Thats great thanks I guess it is hard to not use % as a performance measure when that is what is commonly used in everyday life. So when i come to predicting the response of new data ( using the estimated mean Y ) which i am more comfortable with i can say - Species A - 2.12 - Therefore this

[R] plot.ts versus plot.zoo

2010-09-22 Thread Alex van der Spek
plot.ts has an argument yax.flip, plot.zoo does not. Is there a way to make the yaxis flip in plot.zoo? I tried using a custom panel function: panel.yaxis-function(...) { npnl-parent.frame$panel.number if (npnl %% 2 == 0) { axis(side=3) } else { axis(side=2) } }

Re: [R] Survival curve mean adjusted for covariate

2010-09-22 Thread Peng, C
do the same thing for female and then take the weighted average of the two means. -- View this message in context: http://r.789695.n4.nabble.com/Survival-curve-mean-adjusted-for-covariate-tp2548387p2550178.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Survival curve mean adjusted for covariate

2010-09-22 Thread Peng, C
do the same thing for female and then take the weighted average of the two means. -- View this message in context: http://r.789695.n4.nabble.com/Survival-curve-mean-adjusted-for-covariate-tp2548387p2550179.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] plot.ts versus plot.zoo

2010-09-22 Thread Gabor Grothendieck
On Wed, Sep 22, 2010 at 8:07 AM, Alex van der Spek do...@xs4all.nl wrote: plot.ts has an argument yax.flip, plot.zoo does not. Is there a way to make the yaxis flip in plot.zoo? I tried using a custom panel function: panel.yaxis-function(...) {    npnl-parent.frame$panel.number    if

[R] kstest vs shapirotest

2010-09-22 Thread Sibylle Stöckli
Dear R-users Idea: Analysing tree height frequency with hist(), normal distribution (ks.test shapiro.test) and skewness (package e1071 - thanks a lot for this useful package)as an indication of possible self-thinning in an experimental tree stand. Problem: Results from the ks.test and the

Re: [R] apply union function vectorially

2010-09-22 Thread Peng, C
unique(unlist(list.array)) -- View this message in context: http://r.789695.n4.nabble.com/apply-union-function-vectorially-tp2550162p2550193.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] efficient list indexing

2010-09-22 Thread Alaios
Great one! Thanks this will simplify a lot addresing. Best REgards From: Keith Jewell k.jew...@campden.co.uk To: r-h...@stat.math.ethz.ch Sent: Wed, September 22, 2010 1:25:27 PM Subject: Re: [R] efficient list indexing Also, it may be that you want bigfred to

[R] Favor about Rimage Packages in R

2010-09-22 Thread chuan zun liang
Hello,everyone: I facing a problem in Rimage package.I cannot read the images with size 364X364 in jpeg format.What happen to it?After I run it, it give me an error Can't Open fie.I try many time already. But I can read an JPEG image than have smaller size or bigger size than 364X364.What

[R] eigen and svd

2010-09-22 Thread Ondřej Mikula
Dear R-helpers, could anybody explain me briefly what is the difference between eigenvectors returned by 'eigen' and 'svd' functions and how they are related? Thanks in advance Ondrej Mikula __ R-help@r-project.org mailing list

Re: [R] efficient list indexing

2010-09-22 Thread Alaios
For some reason I did not receive your email. Sorry for the inconvenience caused From: Dennis Murphy djmu...@gmail.com Cc: Rhelp r-help@r-project.org Sent: Wed, September 22, 2010 1:46:28 PM Subject: Re: [R] efficient list indexing Hi: I believe we had this

[R] Newey West and Singular Matrix

2010-09-22 Thread ivo welch
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 working quite well, except on occasion, it

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:

[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

[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 whit Cp

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] 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).

[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(s)   thanks jian  

[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:

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

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. __

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

[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

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

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 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 onmik...@gmail.com Dear R-helpers, could anybody explain me briefly what is the difference between eigenvectors returned by 'eigen'

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 jayuan2...@yahoo.com 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)

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:

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.by(by.x, x) : 'by' must

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] 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

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.

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

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 a...@kmhome.org 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

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

[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

[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) { +

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] 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

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

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

[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

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 raoul.t.dso...@gmail.com 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

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] 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 murdoch.dun...@gmail.com To: Hey Sky

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,

[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

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

[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] 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 87

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: sessionInfo() R version

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] 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)

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

[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

[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

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

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] 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 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

[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 determine

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 Aah, that

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

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 delete the

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
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:

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 savejar...@yahoo.com 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, FALSE,

[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
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

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 ralf.bie...@gmail.com wrote: Dear R users, I would like to great a frequency table

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 Henrique Dallazuanna
Try this: as.data.frame(table(x1)) On Wed, Sep 22, 2010 at 3:44 PM, Ralf B ralf.bie...@gmail.com 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

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 =

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)

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 = height) :

[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] 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

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='') {

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] 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

  1   2   >