Re: [R] About LU decomposition in R

2010-01-22 Thread Charles C. Berry
On Sat, 23 Jan 2010, Nai-Wei Chen wrote: Hi, How can I find and download??a function in R to do the LU decompostion for finding the upper and lower triangular matrix.?? Thank you so much. Joe, The 'Do your homework' advice in the _posting guide_ should get you there. Specifically,

Re: [R] (nlme, lme, glmmML, or glmmPQL)mixed effect models with large spatial data sets

2010-01-22 Thread Seth
Update on above. I sampled my data to create a 10,000 observation data set. I then tried lme with a correlation = corSpher and only one predictor, as a test. I set my memory.limit to the max allowable. It ran for a while then returned Error: cannot allocate vector of size 64.0 Mb. I can see

Re: [R] Automatic File Reading [Broadcast]

2010-01-22 Thread Brad Patrick Schneid
Hi, I have many files which look like this: " 2009/02/07 12:30:10.0 5.0161 13.208 2009/02/07 12:45:10.0 5.0102 13.350 2009/02/07 13:00:10.0 5.0044 13.473 2009/02/07 16:30:10.0 4.9366 13.788 2009/02/07 16:45:10.0 4.9397 13.798 end d

[R] About LU decomposition in R

2010-01-22 Thread Nai-Wei Chen
Hi, How can I find and download a function in R to do the LU decompostion for finding the upper and lower triangular matrix.  Thank you so much. Joe ___ 您的生活即時通 - 溝通、娛樂、生活、工作一次搞定! [[

[R] Newbie clip

2010-01-22 Thread Tiffany
Hi to all. I make a little movie with myself, is it good? http://tin.bz/tiffany __ 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-guide.html and provide com

[R] MAC R crashes

2010-01-22 Thread Peter Rossi
Dear R-Help Group: R will not start on my imac running 10.6.2. I installed both R2.10.1 and 2.10.0 from pkg. It crashed on both. I tried both the R and R64 apps and both versions 2.10.1 and 2.10.0. I googled and found nothing on this. Below is part of report: Process: R [767] Path:

Re: [R] Automatic File Reading [Broadcast]

2010-01-22 Thread Brad Patrick Schneid
Sorry... also, how do I remove the last line which says "end data" -- View this message in context: http://n4.nabble.com/R-Automatic-File-Reading-tp810331p1182386.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org m

[R] Quartiles and Inter-Quartile Range

2010-01-22 Thread eeramalho
Why am I getting a wrong result for quartiles? here is my code: > cbiomass = c(910, 1058, 929, 1103, 1056, 1022, 1255, 1121, , 1192, > 1074, 1415) > summary(cbiomass) > IQR(cbiomass) The result R gives me is: For the summary > Min. 1st Qu. MedianMean 3rd Qu.Max. 9101048

[R] (nlme, lme, glmmML, or glmmPQL)mixed effect models with large spatial data sets

2010-01-22 Thread Seth
Hi, I have a spatial data set with many observations (~50,000) and would like to keep as much data as possible. There is spatial dependence, so I am attempting a mixed model in R with a spherical variogram defining the correlation as a function of distance between points. I have tried nlme, lme

Re: [R] Quartiles and Inter-Quartile Range

2010-01-22 Thread David Freedman
It's looks like you think that type=2 are the 'true' quantiles, but the default method in R is type=7 You might want to look at ?stats::quantile hth david freedman -- View this message in context: http://n4.nabble.com/Quartiles-and-Inter-Quartile-Range-tp1145817p1213199.html Sent from the R he

Re: [R] sorted reshaping?

2010-01-22 Thread Dennis Murphy
Hi: # Start with some fictitious data: > firm <- rep(1:10, each = 5) > year <- rep(2002:2006, 10) > resp <- rnorm(50) > dat.long <- data.frame(firm = firm, year = year, resp = resp) > head(dat.long) firm yearresp 11 2002 -0.77367688 21 2003 -0.79069791 31 2004 0.69257133 4

Re: [R] Question on Merge/Lookup

2010-01-22 Thread Dennis Murphy
sqldf, authored by Gabor, if I read your intention correctly. D. On Fri, Jan 22, 2010 at 5:00 PM, Don MacQueen wrote: > Perhaps using the R merge() function, possibly twice in succession, will do > the job. (merge() does a one to many relational join, but with only two > dataframes at at time).

Re: [R] Question on Merge/Lookup

2010-01-22 Thread Don MacQueen
Perhaps using the R merge() function, possibly twice in succession, will do the job. (merge() does a one to many relational join, but with only two dataframes at at time). Or, there is an R package that lets you use the SQL language on dataframes. I don't recall its name, but a search on R pac

Re: [R] Help on tcl/tk package installation

2010-01-22 Thread 李道丰
Hi, how to compile with tcl/tk support ? command line options? thank you:) 2010/1/22 Uwe Ligges > You need to reinstall R and compile with tcl/tk support (best is to use > R-2.10.1 nowadays since yours is already outdated). > > Best, > Uwe Ligges > > > > > On 22.01.2010 08:13, 李道丰 wrote:

Re: [R] first and second derivative calculation

2010-01-22 Thread David Winsemius
On Jan 22, 2010, at 6:49 PM, Marlin Keith Cox wrote: I can plot this just fine: t<-seq(0,4, by=.1) y<- t^3-6*t^2+5*t+30 plot(t,y ,xlab="t-values", ylab="f(t)", type="l") This is the first derivative, how I I make a similar plot? t<-seq(0,4, by=.1) y<- t^3-6*t^2+5*t+30 y1<-D(expression(t^3-6*t^2

Re: [R] Sata and R users GLM methods translation

2010-01-22 Thread Thomas Lumley
On Fri, 22 Jan 2010, Jason Morgan wrote: Hello Jean-Baptiste, On 2010.01.22 16:32:53, Jean-Baptiste Combes wrote: Hello, I am learning R and I am fluent in Stata and I try to translate part of my Stata code to R to check the reliability of the data under R. I have a proportion variable as a d

Re: [R] first and second derivative calculation

2010-01-22 Thread Marlin Keith Cox
I can plot this just fine: t<-seq(0,4, by=.1) y<- t^3-6*t^2+5*t+30 plot(t,y ,xlab="t-values", ylab="f(t)", type="l") This is the first derivative, how I I make a similar plot? t<-seq(0,4, by=.1) y<- t^3-6*t^2+5*t+30 y1<-D(expression(t^3-6*t^2+5*t+30), 't') Thanks ahead of time. kc On Fri, J

[R] Estimate Slope from Boltzmann Model (package: DRC)

2010-01-22 Thread Bob Arrigo
Dear R Community, I am using the package DRC ( to fit a boltzman model to my data. I can fit the model and extract the lower limit, upper limit, and ED50 (aka V50), but I cannot figure out how to get the slope of the curve at ED50. Is there a simple way to do this? I've searched the mailing lis

[R] Help changing position of x-axis

2010-01-22 Thread Anderson, Chris
I have plotted the dataset below into a stripchart, which gives me the correct graph. However, my x-axis labels are to long to display hortizonal. I would like to display the labels at a 45 degree angle so that all of the labels are displayed. I have used the following text+par code on other gra

Re: [R] Sata and R users GLM methods translation

2010-01-22 Thread Jason Morgan
Hello Jean-Baptiste, On 2010.01.22 16:32:53, Jean-Baptiste Combes wrote: > Hello, > > I am learning R and I am fluent in Stata and I try to translate part of my > Stata code to R to check the reliability of the data under R. I have a > proportion variable as a dependent variable pQSfteHT . Indepe

[R] ANNOUNCE: edtdbg debugging tool

2010-01-22 Thread Norm Matloff
My edtdbg debugging tool is now on CRAN, at http://cran.r-project.org/web/packages/edtdbg/index.html I've added a few new commands since the last time I announced the package here. I'll enclose command list at the end of this message. Currently the package is implemented for Vim. I have a vol

[R] sorted reshaping?

2010-01-22 Thread ivo welch
dear R wizards:  I am wrestling with reshape.  I have a long data set that I want to convert into a wide data set, in which rows are firms and columns are years. > summary(rin) firm fyear sim1 Min. :1004.00 Min. :1964.0 Min. : -1.0 1st Qu.:1010.00 1s

Re: [R] solving cubic/quartic equations non-iteratively

2010-01-22 Thread Stavros Macrakis
On Tue, Jan 5, 2010 at 5:25 PM, Carl Witthoft wrote: > quote: > > There are certainly formulas for solving polynomials numerically up to > 4th degree non-iteratively, but you will almost certainly get better results > using iterative methods. > > I must be missing something here. Why not use t

Re: [R] Equality between covariance matrices?

2010-01-22 Thread Greg Snow
One approach is to do a permutation test on the covariances. You need a measure of how different they are (maximum difference, mean difference). Calculate that for the original data. Then randomly permute observations as to which group they are in and recalculate your difference measure. Rep

Re: [R] first and second derivative calculation

2010-01-22 Thread Doran, Harold
> D(expression(t^3-6*t^2+5*t + 30), 't') 3 * t^2 - 6 * (2 * t) + 5 > D(D(expression(t^3-6*t^2+5*t + 30), 't'), 't') 3 * (2 * t) - 6 * 2 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Marlin Keith Cox Sent: Friday, January 22, 2010

[R] first and second derivative calculation

2010-01-22 Thread Marlin Keith Cox
I would like to calculate a first and second derivative and am having problems finding a simple solution. My syntax may be off as I am not a mathematician, so pardon ahead of time. data: t<-seq(0,4, by=.1) The function is: H(t) = t^3-6*t^2+5*t + 30 from here I plot the curve: plot(x,y ,xlab="x-va

Re: [R] Title splitting function

2010-01-22 Thread Ista Zahn
Hi Michael, It looks like you're having fun, I hope I don't spoil it for you: title <- "some variety of words that are descriptive" paste(strwrap(title, width=16), collapse="\n") -Ista On Fri, Jan 22, 2010 at 9:07 PM, Michael Pearmain wrote: > Hi All, > > I'm trying to write a function to autom

[R] Title splitting function

2010-01-22 Thread Michael Pearmain
Hi All, I'm trying to write a function to automatically split long strings so they will appear nicely in a chart i'm trying to create, Say i have a string title <- "some variety of words that are descriptive" In this instance i want to place carriage return where there is a space just prior to

[R] Rotating the axis labels in the basic graphic device ?

2010-01-22 Thread Tal Galili
Hello dear R help group, I learned recently that one can change the rotation of labels in the axis, when using a lattice plot, for example: library(lattice) barchart(yield ~ variety , data = barley, groups = year, ylab = "Barley Yield (bushels/acre)", scales = list(rot

Re: [R] Mantel results shown in a graphical (histogram) form.

2010-01-22 Thread colin1
Hi! I have managed to sort this problem out by adapting script from a published 'instruction'. This gives: < m1 <- mantelkdist(kdist(data gene, data geo),999) < plot (m1). The script produced two sub-plots: one showing an xy plot of gene(x) end geo(y) data and another showing a histogram of gene-

Re: [R] Counting two factors at the same time

2010-01-22 Thread David Winsemius
On Jan 22, 2010, at 2:07 PM, Fabrice DELENTE wrote: Here's another R-way: lets<-factor(c( 'A', 'B', 'A', 'C', 'B', 'D', 'B')) # you did say they were factors, right? nums <- factor(c('1', '2', '2', '3', '2', '2', '3')) lets=="B" [1] FALSE TRUE FALSE FALSE TRUE FALSE TRUE sum(lets=="B"

Re: [R] [R-SIG-Finance] How to separate date and time into different columns?

2010-01-22 Thread J Ryan
A note about xts: The time class layer is abstracted from the implementation. This allows for some very time specific manipulation without having to manage the underlying details. Take a look at the xts docs and vignette. Also, the functions .indexmon .indexyear etc correspond to the POSIX

Re: [R] Counting two factors at the same time

2010-01-22 Thread Fabrice DELENTE
> Here's another R-way: > > > lets<-factor(c( 'A', 'B', 'A', 'C', 'B', 'D', 'B')) > # you did say they were factors, right? > > nums <- factor(c('1', '2', '2', '3', '2', '2', '3')) > > lets=="B" > [1] FALSE TRUE FALSE FALSE TRUE FALSE TRUE > > sum(lets=="B" & nums=="2") > [1] 2 Thanks very muc

Re: [R] Counting two factors at the same time

2010-01-22 Thread David Winsemius
On Jan 22, 2010, at 1:58 PM, Fabrice DELENTE wrote: Try this; f <- c( 'A', 'B', 'A', 'C', 'B', 'D', 'B') n <- c('1', '2', '2', '3', '2', '2', '3') table(paste(f, n)) Thanks for the incredibly fast answer! I'll give this a shot! Here's another R-way: > lets<-factor(c( 'A', 'B', 'A', 'C',

Re: [R] Counting two factors at the same time

2010-01-22 Thread Fabrice DELENTE
> Try this; > > > f <- c( 'A', 'B', 'A', 'C', 'B', 'D', 'B') > > n <- c('1', '2', '2', '3', '2', '2', '3') > > table(paste(f, n)) Thanks for the incredibly fast answer! I'll give this a shot! -- Fabrice DELENTE __ R-help@r-project.org mailing list ht

Re: [R] Counting two factors at the same time

2010-01-22 Thread Henrique Dallazuanna
Try this; > f <- c( 'A', 'B', 'A', 'C', 'B', 'D', 'B') > n <- c('1', '2', '2', '3', '2', '2', '3') > table(paste(f, n)) On Fri, Jan 22, 2010 at 4:51 PM, Fabrice DELENTE wrote: > Hello. > > I'm trying to count string data that correspond to a given > condition in two factors of the same length. >

[R] Question on Merge/Lookup

2010-01-22 Thread GL
I need to merge three datasets and don't know how. If I were using SQL, I would use df3, look up the characteristics of each date in df1 and the value for each observation in df2. df1 - unique list of Dates and characteristics of those dates Date, MM, WW, DOW df2 - the raw data Date,

[R] Counting two factors at the same time

2010-01-22 Thread Fabrice DELENTE
Hello. I'm trying to count string data that correspond to a given condition in two factors of the same length. For example, I have one factor [ 'A', 'B', 'A', 'C', 'B', 'D', 'B' ] and another is [ '1', '2', '2', '3', '2', '2', '3' ] I'd like to count the occurences of 'B' and '2' (so in my e

Re: [R] How to seperate date and time into different columns?

2010-01-22 Thread Gabor Grothendieck
Normally one wants to store time indexes as a single column so its likely that this is not what you really want to do. You may wish to explain what your final objective is and why you want to do this. However, if you must there are many ways and here is one The first two lines load chron and set

Re: [R] Optimizing C code

2010-01-22 Thread Duncan Murdoch
On 22/01/2010 12:52 PM, Christophe Genolini wrote: Thanks both of you. > > > Inf - Inf > [1] NaN So isn't the line 9 useless ? If either x[i] or y[i] are NA, then dev will be NA and !ISNAN(dev) will detect it... Sothe loop cool be 8.for(i = 0 ; i < taille ; i++) { 10.dev = (x[i] -

Re: [R] Looping multiple dimensions

2010-01-22 Thread jim holtman
I would suggest that you use a 'list' for the data. Something like this should work: objs <- grep("^mrunoff_", ls(), values=TRUE) # get the names of the objects result <- lapply(objs, function(.obj){ .obj <- get(.obj) # get the value lapply(1:12, function(. iter) .obj[,, .iter]) })

Re: [R] Optimizing C code

2010-01-22 Thread Henrik Bengtsson
A side note: The NA vs NaN does not seem to play a role here, because: #define both_non_NA(a,b) (!ISNAN(a) && !ISNAN(b)) So, it is the same type of test used in line 9 and in line 11. /Henrik On Fri, Jan 22, 2010 at 9:52 AM, Christophe Genolini wrote: > Thanks both of you. > >> >> > Inf - Inf

Re: [R] 3d trend line

2010-01-22 Thread Duncan Murdoch
On 22/01/2010 8:52 AM, mlcarte3 wrote: Which line do you want? There's more than one choice. For example, you could regress y and z on x, or you could find the principle axis of the x, y, z point cloud. Duncan Murdoch Thanks for the response. I need to find the principal axis for the point

[R] lm on group

2010-01-22 Thread newbieRRRRR
Hi all, I have a quick question about lm on group, say I have: x <- 1:10 y <- x*3 buckets <- seq(0, 10, by=5) g <- cut(x, buckets) summary(lm(y ~ g - 1)) Coefficients: Estimate Std. Error t value Pr(>|t|) g(0,5] 9.000 2.121 4.243 0.00283 ** g(5,1

Re: [R] How to seperate date and time into different columns?

2010-01-22 Thread jim holtman
> x <- as.POSIXct('4/17/2008 16:01', format='%m/%d/%Y %H:%M') > x [1] "2008-04-17 16:01:00 EDT" > # now create a four element vector of your desired values > y <- strsplit(format(x, "%d %m %Y %H:%M"), ' ') > y [[1]] [1] "17""04""2008" "16:01" > On Fri, Jan 22, 2010 at 1:09 PM, FMH wrot

Re: [R] How to seperate date and time into different columns?

2010-01-22 Thread Henrique Dallazuanna
Try this: strDate <- c('4/17/2008 16:01', '4/18/2008 17:13') do.call(rbind, strsplit(strDate, "[[:punct:]]|\\s"))[,c(2, 1, 3:5)] On Fri, Jan 22, 2010 at 4:09 PM, FMH wrote: > Dear All, > > I have a series of data in which the first column consist of a combination of > date and time, for instan

[R] Error on as.timeSeries function

2010-01-22 Thread anna
Hello everyone, I am trying to use the as.timeSeries.ts()/as.timeSeries() method on a ts object. Here is the error I get: as.timeSeries.ts(mes) Error in .local(.Object, ...) : unused argument(s) (Data = c(NA, NA, 14.2,15.5, I tried the same removing the NA values it gave me same error so I don'

Re: [R] [R-SIG-Finance] How to separate date and time into different columns?

2010-01-22 Thread Brian G. Peterson
FMH wrote: Dear All, I have a series of data in which the first column consist of a combination of date and time, for instance 17 April 2008 at 4.01pm, such data is recorded as: 4/17/2008 16:01 I'd like to seperate it into four different columns which consist of Day, Month,Year and Time, r

Re: [R] Computing Confidence Intervals for AUC in ROCR Package

2010-01-22 Thread David Winsemius
On Jan 22, 2010, at 12:01 PM, Na'im R. Tyson wrote: Thank you for your very prompt response. The authors of the ROCR package informed me the package works as stated in the documentation as long as you use R version 2.9.0--and indeed, it does! I do not mind using a slightly older version

[R] How to seperate date and time into different columns?

2010-01-22 Thread FMH
Dear All, I have a series of data in which the first column consist of a combination of date and time, for instance 17 April 2008 at 4.01pm, such data is recorded as: 4/17/2008 16:01 I'd like to seperate it into four different columns which consist of Day, Month,Year and Time, respectively.

Re: [R] exact wilcox test and Bonferroni correction

2010-01-22 Thread Meyners, Michael, LAUSANNE, AppliedMathematics
(i) you EITHER correct the p value (by multiplying by 8 in your case) OR you use the Bonferroni-threshold of 0.05/8, not both. If you correct the p values, your threshold remains 0.05. If you use 0.05/8, you use the original p values. (ii) Yes, if the p value is 0.15, then the corrected one for 8 t

Re: [R] Optimizing C code

2010-01-22 Thread Christophe Genolini
Thanks both of you. > Inf - Inf [1] NaN So isn't the line 9 useless ? If either x[i] or y[i] are NA, then dev will be NA and !ISNAN(dev) will detect it... Sothe loop cool be 8.for(i = 0 ; i < taille ; i++) { 10.dev = (x[i] - y[i]); 11.if(!ISNAN(dev)) { 12. dist +

Re: [R] loop on list levels and names

2010-01-22 Thread Matthew Dowle
data.table is the package name too. Make sure you find ?"[.data.table" which is linked from ?data.table. You could just do a mean of one variable first, and then build it up from there e.g. dataset[, mean(epLsar), by="SPECSHOR,BONE"]. To get multiple columns of output, wrap with DT() like this

Re: [R] column selection in list

2010-01-22 Thread baptiste auguie
?"[" should give you enough information. In short, "[" is an operator to extract elements, you can think of it as a function with special semantics. For a simple vector, v = c("one", "two") v[2] selects the second element of the vector, and is equivalent to, `[`(v, 2) # "two" as you can see fro

[R] Equality between covariance matrices?

2010-01-22 Thread Robert Lonsinger
I have conducted a discriminant function analysis with lda() in the MASS Package, and I am interested in testing that the covariance matrices of the groups are equal. Does anybody have any suggestions on how I could test for equality between covariance matrices? Any help would be great. Thank yo

Re: [R] Counting Na values on a time serie only on the past datas

2010-01-22 Thread anna
William thanks a lot that is exactly what I wanted! :working: -- View this message in context: http://n4.nabble.com/Counting-Na-values-on-a-time-serie-only-on-the-past-datas-tp1101617p1103103.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] Once again: Error: cannot allocate vector of size

2010-01-22 Thread Viechtbauer Wolfgang (STAT)
The problem I see here is not so much the 27136 observations, but the fact that the first two factors have up to 101 different levels and the third factor up to 1001 different levels. That means that lm() is essentially creating 100+100+1000 dummies for those factors, leading to a large (and spa

Re: [R] correlation significance testing with multiple factor levels

2010-01-22 Thread Greg Snow
If I understand your problem correctly, then one option is to use a permutation test. This tests the null hypothesis that set A and set B are identical and the only reason you are seeing a difference is due to random chance. The procedure is to randomly shuffle the observations between the set

Re: [R] Counting Na values on a time serie only on the past datas

2010-01-22 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of anna > Sent: Friday, January 22, 2010 8:56 AM > To: r-help@r-project.org > Subject: [R] Counting Na values on a time serie only on the past datas > > > Hello everyone, I have a

Re: [R] testing the fit of a regression and comparing regressn models

2010-01-22 Thread Ista Zahn
Hi, It sounds to me like you need to learn to use R's help functions. Try help.search("logistic regression") help.search("spearman") etc. If you don't find what you need with help.search() you can broaden your search filed by switching to RSiteSearch(). -Ista On Fri, Jan 22, 2010 at 4:53 PM, Di

Re: [R] Computing Confidence Intervals for AUC in ROCR Package

2010-01-22 Thread Na'im R. Tyson
Thank you for your very prompt response. The authors of the ROCR package informed me the package works as stated in the documentation as long as you use R version 2.9.0--and indeed, it does! I do not mind using a slightly older version of R to get the results I need. It is useful to have

Re: [R] loop on list levels and names

2010-01-22 Thread Ivan Calandra
Thanks for your advice, I will work on it then! Just one last question. In which package can I find the function data.table? Ivan Le 1/22/2010 17:18, Matthew Dowle a écrit : Great. If you mean the crantastic r package, sorry I wasn't clear, I meant the crantastic website http://crantastic.or

[R] Counting Na values on a time serie only on the past datas

2010-01-22 Thread anna
Hello everyone, I have a time serie of n values, some are na's. I want to get a vector of size n whose elements represent on the time t < n the number of missing values between o and t. I know I can do it with a loop but I wanted to know if there was a function or a special syntax to do this. Than

Re: [R] assigning a file name, or part of, to an object

2010-01-22 Thread Ista Zahn
Hi Jim, You might also want to see ?list.files() for a quick way to get the filenames in the first place, and then you can manipulate them using the functions Gabor suggested. -Ista On Fri, Jan 22, 2010 at 4:48 PM, Gabor Grothendieck wrote: > Check out the various help pages on string manipulati

Re: [R] testing the fit of a regression and comparing regressn models

2010-01-22 Thread DispersionMap
anyone? -- View this message in context: http://n4.nabble.com/testing-the-fit-of-a-regression-and-comparing-regressn-models-tp1055033p1101383.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://st

Re: [R] Once again: Error: cannot allocate vector of size

2010-01-22 Thread Matthew Dowle
Fantastic. You're much more likely to get a response now. Best of luck. "werner w" wrote in message news:1264175935970-1100164.p...@n4.nabble.com... > > Thanks Matthew, you are absolutely right. > > I am working on Windows XP SP2 32bit with R versions 2.9.1. > > Here is an example: > d <- as.d

Re: [R] assigning a file name, or part of, to an object

2010-01-22 Thread Gabor Grothendieck
Check out the various help pages on string manipulation: help.search(keyword = "character", package = "base") and particularly ?sub, ?substr and ?regex On Fri, Jan 22, 2010 at 11:33 AM, Jim Bouldin wrote: > > Is there a way to capure all, or part, of a filename and assign it to an > object.  Sa

Re: [R] column selection in list

2010-01-22 Thread Ivan Calandra
Thanks Baptiste, it does help. However, I don't really understand what "[" means. Could you please tell me more about it? I didn't find anything helpful on that in the help. Thanks in advance Ivan Le 1/22/2010 17:19, baptiste auguie a écrit : Hi, Try this, a = replicate(3, data.frame(x=1

[R] Sata and R users GLM methods translation

2010-01-22 Thread Jean-Baptiste Combes
Hello, I am learning R and I am fluent in Stata and I try to translate part of my Stata code to R to check the reliability of the data under R. I have a proportion variable as a dependent variable pQSfteHT . Independent variables are dummies for two categorical variables called dQSvacrateHTQuali3

[R] assigning a file name, or part of, to an object

2010-01-22 Thread Jim Bouldin
Is there a way to capure all, or part, of a filename and assign it to an object. Say I wanted to read in a file tiled "example.txt" and then assign the character string "example" (or "exa" or any other substring of "example" for that matter), to object a. Is there a simple way to do so? Thanks

Re: [R] Stata and R user GLM method

2010-01-22 Thread Joseph Magagnoli
Jean-Baptiste The most immediate difference I see is that you use a logit link in the R code but a probit link function in the stata code. Joe On Fri, Jan 22, 2010 at 8:25 AM, Jean-Baptiste Combes wrote: > Hello people, > > I am in the process of migrating from Stata to R and I would like to chec

[R] Looping multiple dimensions

2010-01-22 Thread Steve Murray
Dear all, I have 30 arrays, each with dimensions 720,360,12. The naming format for each of these 30 objects is: mrunoff_5221, mrunoff_5222... mrunoff_5250. For example: > str(mrunoff_5221)   num [1:720, 1:360, 1:12] NA NA NA NA NA NA NA NA NA NA ...  (the initial NA's are nothing to worry abo

Re: [R] Stata and R user GLM method

2010-01-22 Thread ONKELINX, Thierry
Jean-Baptiste, You are not doing the same thing in R as in Stata. In stata you used the probit link, in R the logit link. HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek team Biometrie & Kwa

[R] Stata and R user GLM method

2010-01-22 Thread Jean-Baptiste Combes
Hello people, I am in the process of migrating from Stata to R and I would like to check if my results are similar under the two softwares: Here is my GLM command under R nurse.model<-glm(pQSfteHT~dQSvacrateHTQuali3_2 + dQSvacrateHTQuali3_3 + dQSvacrateHTQuali3_4 + dQSvacrateHTQuali3_5 + cluster_

Re: [R] Once again: Error: cannot allocate vector of size

2010-01-22 Thread werner w
Thanks Matthew, you are absolutely right. I am working on Windows XP SP2 32bit with R versions 2.9.1. Here is an example: d <- as.data.frame(matrix(trunc(rnorm(6*27136, 1, 100)),ncol=6)) d[,4:5] <- trunc(100*runif(2*27136, 0, 1)) d[,6] <- trunc(1000*runif(27136, 0, 1)) for (i in 4:6)

Re: [R] Mutliple sets of data in one dataset....Need a loop?

2010-01-22 Thread Glen Sargeant
Thank you, Mario. Biostudent asked how one could perform repetitive tasks, e.g., plotting, with subsets of data. I originally provided a flexible example based on lapply. Mario suggested a variation that permits flexible control of options. This reply shows how Mario's objective and naming of

Re: [R] column selection in list

2010-01-22 Thread baptiste auguie
Hi, Try this, a = replicate(3, data.frame(x=1:10, y=rnorm(10)), simplify=FALSE) lapply(a, "[", "y") HTH, baptiste 2010/1/22 Ivan Calandra : > Hi everybody! > > I have a (stupid) question but I cannot find a way to do it! > > I have a list like: >> SPECSHOR_tx_Asfc > $cotau >   SPECSHOR Asfc.m

Re: [R] 3d trend line

2010-01-22 Thread mlcarte3
Which line do you want? There's more than one choice. For example, you could regress y and z on x, or you could find the principle axis of the x, y, z point cloud. Duncan Murdoch Thanks for the response. I need to find the principal axis for the point cloud. How can I plot this in R? Thank

Re: [R] loop on list levels and names

2010-01-22 Thread Matthew Dowle
Great. If you mean the crantastic r package, sorry I wasn't clear, I meant the crantastic website http://crantastic.org/. If you meant the description of plyr then if the description looks useful then click the link taking you to the package documentation and read it. Same for any of the othe

Re: [R] Data Manipulation

2010-01-22 Thread Peter Rote
Thank you Don for the code, but I get the following error massage: > by(AlexETF,AlexETF$Industry,function(a) {filename = paste("C:/ab/",gsub(" > ","",a$Industry[1]),".txt",sep="") + print(filename) + write.table(a[,3,drop=FALSE],quote=FALSE,col.names=FALSE,row.names=FALSE) + }

[R] column selection in list

2010-01-22 Thread Ivan Calandra
Hi everybody! I have a (stupid) question but I cannot find a way to do it! I have a list like: > SPECSHOR_tx_Asfc $cotau SPECSHOR Asfc.median 38cotau381.0247 39cotau154.6280 40cotau303.3219 41cotau351.2933 42cotau156.5327 $eqgre SPECSHOR Asfc.median

Re: [R] exact wilcox test and Bonferroni correction

2010-01-22 Thread Peter Dalgaard
netrunner wrote: > Dear Peter, > thank you for your explanations! > > Originally, my idea was to apply pairwise.wilcox.test, but sincerely I do > not know how have to use my data to do that. I read the documentation for > the function, but I did not understand how I have to arrange my data set. >

Re: [R] Once again: Error: cannot allocate vector of size

2010-01-22 Thread Steve Lianoglou
Hi Werner, On Thu, Jan 21, 2010 at 9:23 PM, Werner W. wrote: > Hi, > > I have browsed the help list and looked at the FAQ but I don't find > conclusive evidence if this is normal or I am doing something wrong. > I am running a lm() on a data.frame with 27136 observations of 6 variables (3 > num

[R] selecting random points within a buffer

2010-01-22 Thread anto.r
helloo let me try rephrase my previous post this way. I have a distribution of points ( with cords) and I want to select only or two points that fall within a buffer distance from each point. I guess there should be some way to do this in R. Can someone help or suggest where I might find a solutio

Re: [R] Anova unequal variance

2010-01-22 Thread Peng Yu
On Fri, Jan 22, 2010 at 3:33 PM, Dennis Murphy wrote: > Hi: > > On Thu, Jan 21, 2010 at 1:06 PM, Peng Yu wrote: >> >> On Thu, Jan 21, 2010 at 2:41 PM, Dennis Murphy wrote: >> > Hi: >> > >> > On Thu, Jan 21, 2010 at 12:29 PM, Peng Yu wrote: >> >> >> >> On Thu, Jan 21, 2010 at 2:16 PM, Dennis Mur

Re: [R] confidence intervals for mean (GLM)

2010-01-22 Thread Walmes Zeviani
Access the information in help(predict) help(fitted) With your reproducible code, run the following predict(model1) predict(model1, type="response") predict(model1, type="response", se.fit=TRUE) require(lattice) xyplot(value+fitted(model1)~treatments, data=mydata1, distribute.type=TRUE

Re: [R] loop on list levels and names

2010-01-22 Thread Don MacQueen
Without reading all the details of your question, it looks like maybe split() is what you want. split( dataset, paste(dataset$SPECSHOR,dataset$BONE) ) or split( dataset[,3], paste(dataset$SPECSHOR,dataset$BONE) ) -Don At 5:12 PM +0100 1/21/10, Ivan Calandra wrote: Hi everybody! To use s

Re: [R] Extract R-squared from summary of lm

2010-01-22 Thread Peter Dalgaard
Trafim Vanishek wrote: > Dear all, > > I cannot find to explicitly get the R-squared or adjusted R-squared from > summary(lm()) > > names(summary(RegModel.1)) [1] "call" "terms" "residuals" "coefficients" [5] "aliased" "sigma" "df""r.squared" [9]

Re: [R] Extract R-squared from summary of lm

2010-01-22 Thread Chuck Cleland
On 1/22/2010 10:10 AM, Trafim Vanishek wrote: > Dear all, > > I cannot find to explicitly get the R-squared or adjusted R-squared from > summary(lm()) fm1 <- lm(Sepal.Length ~ Sepal.Width, data=iris) summary(fm1) str(summary(fm1)) summary(fm1)$r.squared ?str > Thanks a lot! > > [[alte

Re: [R] Calling FING.EXE under RGui.EXE for windows.

2010-01-22 Thread Duncan Murdoch
On 10/01/2010 1:51 PM, Duncan Murdoch wrote: On 10/01/2010 1:42 PM, Gabor Grothendieck wrote: > Perhaps you can add it to the bug list before you leave it including > what you tried in case its a symptom of some larger underlying > problem. This list is archived, so there's a record. But I thin

Re: [R] Data Manipulation

2010-01-22 Thread Don MacQueen
Does this example help? a <- matrix(letters[1:12], ncol=3) a [,1] [,2] [,3] [1,] "a" "e" "i" [2,] "b" "f" "j" [3,] "c" "g" "k" [4,] "d" "h" "l" write.table(a[,3,drop=FALSE],quote=FALSE,col.names=FALSE,row.names=FALSE) i j k l At 4:11 PM -0800 1/21/10, Peter Rote wrote: T

Re: [R] Extract R-squared from summary of lm

2010-01-22 Thread Jorge Ivan Velez
Hi Trafim, Take a look at the following example: set.seed(123) x <- runif(100) y <- 3 + 1.5*x + rnorm(100) fit <- lm(y ~ x) summary(fit) str(summary(fit)) summary(fit)$r.squared HTH, Jorge On Fri, Jan 22, 2010 at 10:10 AM, Trafim Vanishek <> wrote: > Dear all, > > I cannot find to explicitly

Re: [R] Mutliple sets of data in one dataset....Need a loop?

2010-01-22 Thread Mario Valle
Great example Glen! I want to add simply a small thing that could be useful to someone. Suppose in your last step you want to change the line color for each chart. Using a for loop it is simple to use the integer index to access the df.lst elements and set the color: for(i in 1:length(df.lst)

Re: [R] Extract R-squared from summary of lm

2010-01-22 Thread Paul Hiemstra
Trafim Vanishek wrote: Dear all, I cannot find to explicitly get the R-squared or adjusted R-squared from summary(lm()) Thanks a lot! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/list

Re: [R] exact wilcox test and Bonferroni correction

2010-01-22 Thread netrunner
Dear Peter, thank you for your explanations! Originally, my idea was to apply pairwise.wilcox.test, but sincerely I do not know how have to use my data to do that. I read the documentation for the function, but I did not understand how I have to arrange my data set. Can you help me? I have two g

[R] Extract R-squared from summary of lm

2010-01-22 Thread Trafim Vanishek
Dear all, I cannot find to explicitly get the R-squared or adjusted R-squared from summary(lm()) Thanks a lot! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do rea

Re: [R] Na.omit on matrix, does the matrix have to have a limited size

2010-01-22 Thread anna
yes I am using the rollMean function with trim =false and na.rm = true, it works but it removes the na's from the results... -- View this message in context: http://n4.nabble.com/Na-omit-on-matrix-does-the-matrix-have-to-have-a-limited-size-tp1068000p1100114.html Sent from the R help mailing lis

Re: [R] loop on list levels and names

2010-01-22 Thread Ivan Calandra
I didn't know about crantastic actually. I've looked what it is exactly and it indeed looks interesting, but I don't really see how I would know that it would help me for the task. There's a description of what it was built for, but how can I then know which function from this package can help

Re: [R] exact wilcox test and Bonferroni correction

2010-01-22 Thread Peter Dalgaard
netrunner wrote: > Dear Michael, > thank you very much for your help. > > I perfomed the wilcox.exact function on each of the 8 items for the two > groups that I am analysing (that is, I performed 8 times the wilcox test). > Here an example for the values (ratings from a questionnaire) of one of t

[R] confidence intervals for mean (GLM)

2010-01-22 Thread Rafael Moral
Dear useRs, How could I obtain the confidence intervals for the means of my treatments, when my data was fitted to a GLM? I need the CI's for the Poisson and Negative Binomial distributions. Here's what I have: mydata1 <- data.frame('treatments'=gl(4,20), 'value'=rpois(80, 1)) model1 <- glm(val

  1   2   >