Re: [R] (no subject)

2011-02-21 Thread Jim Lemon
On 02/22/2011 03:31 AM, Schmidt, Lindsey C (MU-Student) wrote: What is plot.new? and how can i get it to work so i can load other data? Hi Lindsey, It looks to me as though spelling mistakes in your code are causing failures to generate some of the objects that you then pass to "plot". The pl

Re: [R] S3 classes and building a package

2011-02-21 Thread Prof Brian Ripley
setClass created an S4 class, not an S3 class, and classes are not objects (so don't try to use it in package.skeleton). [*] Are you going to have "buzz" methods for S4 generics? If not, you don't need the setClass line. If you do, you need to put the line yourself in an R file in the packag

[R] How to find Term-to-Term association matrix

2011-02-21 Thread makhdoomi
hi, i am using* tm package* for text mining. i have filtered two sets of terms whose frequency is greater than 5 in two separate files. now i want to find associations between every term of file1 with every term of file2 in the form of matrix of descending order in which rows represent terms of fi

[R] why no "probabilities" from svm.predict?

2011-02-21 Thread Angel Russo
> library(ROCR) > library(e1071) svmres.prob <- svm(traindx, traindy, probability=TRUE) svmpred.prob <- predict(svmres.prob, testdx, probability = TRUE, decision.values = TRUE, type="prob") > print(length(attr(svmpred.prob, "probabilities"))) [1] 0 > print(attr(svmpred.prob, "probabilities")) NULL

Re: [R] Calculate a mean for several months for several years

2011-02-21 Thread D Kelly O'Day
Pete The original question "I would like to calculate the average of the mean temperature for the summer months (Juli, August, September) for each of the 20 years" Your codes gives mean for each of the 3 months, not for the 20 summers. Here is a way to get the summer average for each of the 20

[R] S3 classes and building a package

2011-02-21 Thread Laura Smith
Hi List! Suppose I have the following, please: > setClass("buzz",representation(x="numeric"),S3methods=TRUE) [1] "buzz" > x <- rnorm(10) > class(x) <- "buzz" > plot.buzz <- function(x,y,...) { + plot.default(x,type="l",col="blue") + } > f <- function(x) { + return(x^2) + } > package.skeleton(list

Re: [R] Calculate a mean for several months for several years

2011-02-21 Thread Dennis Murphy
Hi: Here's one way: # Manufacture some monthly data over 20 years df <- data.frame(year = rep(1981:2000, each = 12), month = factor(rep(month.abb, 20), levels = month.abb), meantemp = rnorm(240, mean = rep(c(30, 35, 40, 50, 60, 70, 75, 80

Re: [R] Calculate a mean for several months for several years

2011-02-21 Thread Pete Brecknock
For 5 years set.seed = 1 d=data.frame(year=rep(2007:2011,each=12), month=rep(1:12,5), meanTemp = rnorm(60,10,5)) meanByMonth = ave(d$meanTemp, d$month, FUN = mean)[7:9] HTH Pete -- View this message in context: http://r.789695.n4.nabble.com/Calculate-a-mean-for-several-months-for-several

[R] Calculate a mean for several months for several years

2011-02-21 Thread saba
Hello everyone, I have a dataset with 3 colums (Year, Month, MeanTemp). Now I would like to calculate the average of the mean temperature for the summer months (Juli, August, September) for each of the 20 years. I'm sure it's somehow possible with a loop, but all I tried so far didn't worked and

[R] regsubsets {leaps}

2011-02-21 Thread fgg
Hi, I'd like to run regsubsets for model selection by exhaustive search. I have a list with 20 potential explanatory variables, which represent the real and the imaginary parts of 10 "kinds" of complex numbers: x <- list(r1=r1, r2=r2, r3=r3, ..., r10=r10, i1=i1, i2=i2, i3=i3, ..., i10=i10) Is

[R] Adjusting for autocorrelation in a panel model

2011-02-21 Thread David Kennedy
I am working with panel data. I am using the plm package to do this. I would like to do be able to adjust for autocorrelation, as one does with glm models and correlation structures (eg corr=corARMA(q=4)) . In particular, I want to employ MA(4) error structure. Is there a way of doing thi

[R] Plotting a functional time series

2011-02-21 Thread Eduardo de Oliveira Horta
Hello, I'm willing to plot a sequence of densities on a 3d graph, something like - x <- sapply(1:10, function(i)rnorm(1000)) f <- sapply(1:10, function(i)density(x[,i], from=-5,to=5)$y) grid <- density(x[,1], from=-5,to=5)$x win.gr

Re: [R] question about solving equation using bisection method

2011-02-21 Thread li li
Hi all, I wrote the following code for the problem I posted before. Can some one recommend a better way to do this? f1 <- function(lambda,z,p1){ lambda*(p1*exp(-3*z-9/2)+(0.2-p1)*exp(4*z-8))-(1-lambda)*0.8} f2 <- function(p1,cl, cu){ 0.8*(pnorm(cl)+(1-pnorm(cu)))/(0.8*(pnorm(cl)+(1-pnorm(cu)

Re: [R] naming vectors

2011-02-21 Thread Peter Ehlers
On 2011-02-21 07:17, Francois Rousseu wrote: I guess I will just get over my laziness and use the rep function instead! But my goal was more to point out the weird names attribution behaviour. Maybe not all that weird. Do str(x) between your names<- assignments: x <- 1:10 str(x) names(x

[R] Cochrane-Orcutt Prais Winsten

2011-02-21 Thread Hock Ann Lim
Dear R users,    May I know is there a package that implements the Cochrane-Orcutt Prais Winsten itterative for dealing with autocorrelation in a regression model? I understand that gls in nlme package does it properly, my question is will this two methods provide the same answer for linear mod

Re: [R] Delete Comment Lines from SQL String as a Vector

2011-02-21 Thread jim holtman
Here is the way I usually write my SQL: > x <- c(' + select comm, count(*) -- count the number of comms +from myDF-- this is the dataframe +group by comm -- grouping argument + ') > x # as vector [1] "\nselect comm, count(*) -- count the number of comms\n from myDF-- this i

Re: [R] How to delete rows with specific values on all columns(variables)?

2011-02-21 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of David Winsemius > Sent: Monday, February 21, 2011 3:11 PM > To: David Winsemius > Cc: r-help@r-project.org; IgnacioQM > Subject: Re: [R] How to delete rows with specific values o

Re: [R] Delete Comment Lines from SQL String as a Vector

2011-02-21 Thread David Winsemius
On Feb 21, 2011, at 6:14 PM, Phil Spector wrote: Mai - sql=c("-- This is a comment line", + "select sysdate -- This is a comment Text" , + " from dual ") use = sub('--.*$','',sql) use[use != ''] [1] "select sysdate " " from dual " Although to get it to print the way yo

Re: [R] How to delete rows with specific values on all columns (variables)?

2011-02-21 Thread David Winsemius
On Feb 21, 2011, at 6:05 PM, David Winsemius wrote: On Feb 21, 2011, at 4:03 PM, IgnacioQM wrote: I need to filter my data: I think its easy but i'm stuck so i'll appreciate some help: I have a data frame with 14 variables and 6 million rows. About half of this rows have a value of "0" in

Re: [R] Delete Comment Lines from SQL String as a Vector

2011-02-21 Thread Phil Spector
Mai - sql=c("-- This is a comment line", + "select sysdate -- This is a comment Text" , + " from dual ") use = sub('--.*$','',sql) use[use != ''] [1] "select sysdate " " from dual " Although to get it to print the way you listed, you need to reduce the width of the line:

[R] Delete Comment Lines from SQL String as a Vector

2011-02-21 Thread Mai Dang
Hi, I tried to remove the text starts by "--" to the end of the line as below sql=c("-- This is a comment line", "select sysdate -- This is a comment Text" , " from dual ") >sql [1] "-- This is a comment line" [2] "select sysdate -- This is a comment Text" [3] " from dual "

Re: [R] How to delete rows with specific values on all columns (variables)?

2011-02-21 Thread David Winsemius
On Feb 21, 2011, at 4:03 PM, IgnacioQM wrote: Hi, I need to filter my data: I think its easy but i'm stuck so i'll appreciate some help: I have a data frame with 14 variables and 6 million rows. About half of this rows have a value of "0" in 12 variables (the other two variables always h

[R] How to delete rows with specific values on all columns (variables)?

2011-02-21 Thread IgnacioQM
Hi, I need to filter my data: I think its easy but i'm stuck so i'll appreciate some help: I have a data frame with 14 variables and 6 million rows. About half of this rows have a value of "0" in 12 variables (the other two variables always have values). How can I delete the rows in which all 12

Re: [R] Generating uniformly distributed correlated data.

2011-02-21 Thread Ted Harding
[OOPS! The example I gave before does not correspond to the stated seed. At the end is a revised example where I have checked that it does correspond. Sorry. ] On 21-Feb-11 21:38:11, Ted Harding wrote: > [See at end] > > On 21-Feb-11 17:13:03, Larry Hotchkiss wrote: >> Hi list: >> Here is one

[R] ROC from R-SVM?

2011-02-21 Thread Angel Russo
*Hi, *Does anyone know how can I show an *ROC curve for R-SVM*? I understand in R-SVM we are not optimizing over SVM cost parameter. Any example ROC for R-SVM code or guidance can be really useful. Thanks, Angel. [[alternative HTML version deleted]] _

[R] question about solving equation using bisection method

2011-02-21 Thread li li
Hi all, I have the following two function f1 and f2. f1 <- function(lambda,z,p1){ lambda*(p1*exp(-3*z-9/2)+(0.2-p1)*exp(4*z-8))-(1-lambda)*0.8} f2 <- function(p1,cl, cu){ 0.8*(pnorm(cl)+(1-pnorm(cu)))/(0.8*(pnorm(cl)+(1-pnorm(cu)))+p1*(pnorm(cl+3)+(1-pnorm(cu+3)))+(0.2-p1)*(pnorm(cl-4)+(1-p

Re: [R] Interpreting the example given by Prof Frank Harrell in {Design} validate.cph

2011-02-21 Thread Frank Harrell
Don't worry about the sign. When predicting relative log hazard, high hazard means short survival time so Dxy is negative. When predicting survival probability (u specified), high prob. means long survival time so Dxy is positive. You can just reverse the sign when u is not specified. I did no

Re: [R] Generating uniformly distributed correlated data.

2011-02-21 Thread Ted Harding
[See at end] On 21-Feb-11 17:13:03, Larry Hotchkiss wrote: > Hi list: > Here is one approach that will generate two uniformly distributed > variables with a correlation of 0.5 -- > [snip] >> > -Urspr?ngliche Nachricht- >> > Von:r-help-boun...@r-project.org >> > [mailto:r-help-boun..

Re: [R] Transforming relational data

2011-02-21 Thread Matthew Dowle
Thanks for the attempt and required output. How about this? firststep = DT[,cbind(expand.grid(B,B),v=1/length(B)),by=C][Var1!=Var2] setkey(firststep,Var1,Var2,C) firststep = firststep[,transform(.SD,cv=cumsum(v)),by=list(Var1,Var2)] setkey(firststep,Var1,Var2,C) DT[, {x=data.table(expand.grid(B,B

Re: [R] Equivalent of log file in R?

2011-02-21 Thread Dennis Murphy
Hi: Perhaps another possibility is ?capture.output Dennis On Mon, Feb 21, 2011 at 10:26 AM, Tatyana Deryugina wrote: > Thanks, Ista! I looked at sink() and it looks like it might work. > However, it seems as though you need to use it with the "print" > command. I have a lot of regression output

Re: [R] Equivalent of log file in R?

2011-02-21 Thread Spencer Graves
If I read the help file correctly, another alternative is as follows: sink(file="my_R_log.txt", split=TRUE) "split = logical: if TRUE, output will be sent to the new sink and to the current output stream" Hope this helps, Spencer On 2/21/2011 11:45 AM

Re: [R] plot numerous functions in one figure with different values of x per function

2011-02-21 Thread Dennis Murphy
Hi: Here's one way: f <- function(x) sin(x) + pi/4 g <- function(x) { sin(x) * (x >= 0 & x <= pi) + sin(x) * (x >= -2 * pi & x <= -pi) - (pi/4) * (x > -pi & x < 0) - pi/4 * (x > pi & x < 2 * pi) } x <- seq(-2 * pi, 2 * pi, length = 200) plot(x, f(x), type = 'l', col = 'blue', yli

Re: [R] (no subject)

2011-02-21 Thread Phil Spector
Please start R and enter the following commands: library(splancs) area = 6*4 lambda = 1.5 N = rpois(1,lambda*area) u = runif(N,-2,4) v = runif(N,0,4) h = chull(u,v) h = c(h,h[1]) plot(u[h],v[h],"l",asp=1) points(u,v) If you do not get the plot you're expecting, then repost 1) adding an informa

Re: [R] Species accumulation curves with differential sampling effort

2011-02-21 Thread Dennis Murphy
Hi: Try the vegan and biodiversityR packages; both contain functions for producing species accumulation curves. On Mon, Feb 21, 2011 at 9:38 AM, Vanessa Francisco wrote: > Hello! I'm a PhD student working with coral reef fish diversity in Mexico. > I want to do species accumulation curves but I

Re: [R] Mutiplying a data frame to a list

2011-02-21 Thread Phil Spector
Rohit- If I understand you correctly, and your list's name is mylist, then mapply('*',mylist,as.numeric(names(mylist))) will do what you want. In the future, please provide a reproducible example. - Phil Spector

Re: [R] Species accumulation curves with differential sampling effort

2011-02-21 Thread David Winsemius
On Feb 21, 2011, at 12:38 PM, Vanessa Francisco wrote: Hello! I'm a PhD student working with coral reef fish diversity in Mexico. Are you hiring? I want to do species accumulation curves but I have differential sampling effort for each "sample". Do you know or have developed an R script

Re: [R] Equivalent of log file in R?

2011-02-21 Thread Ista Zahn
Hi Tatyana, Well, most things are implicitly printed. For the most part you should be able to just sink(file="my_R_log.txt") and write your r-code as you normally would. Anything that would usually be printed to the screen is instead sent to my_R_log.txt instead, including things that are implici

Re: [R] difference in pairs ?

2011-02-21 Thread Dennis Murphy
Hi: Assuming dd is the name of your data frame, > dd$diff <- with(dd, q2 - q1) > dd TIME ID q1 q2 diff 11 1187 3 2 -1 21 1706 3 30 31 1741 2 42 42 1187 3 2 -1 52 1706 3 30 62 1741 2 42 is one way to do it. HTH, Dennis On Mon, Feb 21,

Re: [R] Problem with writing a file in UTF-8

2011-02-21 Thread David Heffernan
Windows is perfectly capable of handling UTF-8, but its native encoding is UTF-16LE. Applications on Windows are meant to work with text data in the UTF-16LE encoding. If it needs to be converted to or from another encoding then there are services that do this (which work). There are countless pro

[R] Reg : help using nnet parameters

2011-02-21 Thread Raji
Hi R-helpers, I am using nnet package for Neural Network. I have understood almost all the basic parameters and the way they are used. I would like to know how to give the followinf parameters as input. 1.weights 2.wts 3.mask 4.contrasts 5.subset 6.For which kind of datasets we can set entropy

[R] r-square for cluster

2011-02-21 Thread Yan Boulanger
Dear forumities, It's seem that there is no straight forward way to calculate R2 of a cluster solution in R. So, I would like to know if I'm right when calculating a R2-like statistic for a given clustering solution. In fact, I have different cluster solution for a given set of data. I would l

Re: [R] output selectively change the font

2011-02-21 Thread Rob Tirrell
If I understand you correctly - you can add a column to the output table for your color variable?. Otherwise, if you need to write the *text* in a different color, that's probably something you want to do outside of R... Rob Tirrell On Mon, Feb 21, 2011 at 10:14, Yan Jiao wrote: > Dear brainy

Re: [R] Equivalent of log file in R?

2011-02-21 Thread Tatyana Deryugina
Thanks, Ista! I looked at sink() and it looks like it might work. However, it seems as though you need to use it with the "print" command. I have a lot of regression output that I would like to store in a log file. How do I use sink with that? Best, Tatyana

[R] wrong lines in auto.key xyplot

2011-02-21 Thread arysar
Hi all, I'm having a problem with the auto.key function in xyplot. This is simplified version of my data: q Weeks Dq -10 1 2.1122 1 1 1.9904 10 1 1.739 -10 3 2.5942 1 3 1.9714 10 3 1.8745 -10 5 2.5743 1 5

[R] Mutiplying a data frame to a list

2011-02-21 Thread Rohit Pandey
Hi R community, I have a question I'm sure is very simple for most of you. I have a list, with each element being a matrix and the names of the elements are numbers (like 1,3,...). I can extract the matrices and the names individually. Now, I want to multiply each of the names to the individual l

Re: [R] question about generics

2011-02-21 Thread rex.dwyer
?InternalMethods ?S3groupGeneric ?S4groupGeneric -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Erin Hodgess Sent: Friday, February 18, 2011 10:45 PM To: R help Subject: [R] question about generics Dear R People: Is there a way

[R] plot numerous functions in one figure with different values of x per function

2011-02-21 Thread Gloria_M
To the more experienced R users, I am not a professional programmer so please excuse me if my questions seem naive. I have only begun using R to solve some problems and I'm already regretting it 1. I am trying to plot different functions in the same figure. The first function f(x)= sin(x)+(pi/

[R] (no subject)

2011-02-21 Thread Schmidt, Lindsey C (MU-Student)
What is plot.new? and how can i get it to work so i can load other data? > library(splancs) > area = 6*4 > lambda = 1.5 > N = rpois(1,lambda*area) > u = runif(N,-2,4) > v = runif(N,0,4) > plot(u,v,asp=1) > h = chull(u,v) > h = c(h,h[1]) > plot(u[h],v[h],"1",asp=1) Error in plot.xy(xy, type, ...) :

Re: [R] NPMC - replacement has 0 rows (multiple comparisons)

2011-02-21 Thread Mark Difford
On 2011-02-20 20:02, Karmatose wrote: >> I'm trying to include multiple variables in a non-parametric analysis >> (hah!). So far what I've managed to >> figure out is that the NPMC package from CRAN MIGHT be able to do what I >> need... Also look at packages nparcomp and coin (+ multcomp). Both

[R] Species accumulation curves with differential sampling effort

2011-02-21 Thread Vanessa Francisco
Hello! I'm a PhD student working with coral reef fish diversity in Mexico. I want to do species accumulation curves but I have differential sampling effort for each "sample". Do you know or have developed an R script that consider the differential effort of each sample? PRIMER and other programs us

[R] panel data

2011-02-21 Thread Andreas Sveding Otterström
Hello I have a question about how to regress panel data in R. What are the appropriate commands and preparations that need to be made when regressing panel data? /Andreas Otterstrom [[alternative HTML version deleted]] _

Re: [R] Bootstraps standard error

2011-02-21 Thread danielepippo
Hi R-users, I've found the error In these rows: # Model (a) testtemp <- lm.bp(doctorco~sex+age+income, prescrib~sex+age+income, data=bootdata) betafound <- c(testtemp$beta,testtemp$beta3) results[i,] <- betafound betafound must to be equal to: betafound <- c(testtemp$beta1,testtemp$beta

Re: [R] Conditional sum

2011-02-21 Thread mathijsdevaan
I am still struggling (I'm an R novice). Basically I just want to sum the values per group if the year condition is met. I have the feeling that using a loop would work, but I am not really familiar with loops. Something like this? for(DF$C in 1:length(DF$C)) { DF<-which(DF$year

Re: [R] Interpreting the example given by Prof Frank Harrell in {Design} validate.cph

2011-02-21 Thread vikkiyft
Thank you very much Prof Harrell! Sorry that I am new to this forum, and so ain't familiar with how to post message appropriately. I repeated the same procedure using a dataset from the {survival} package. This time I used the {rms} package, and 100 bootstrap samples: > library(rms) > library(s

[R] difference in pairs ?

2011-02-21 Thread Vlatka Matkovic Puljic
Dear all, I want to perform paired Wilcoxon signed ranks test on my data. I have pairs defined by ID and TIME variables. How can I calculate difference in variables q1, q2 in each pair? TIME ID q1 q2 1 1187 3 2 1 1706 3 3 1 1741 2 4 2 1187 3 2 2 1706 3 3 2 1741 2 4 Please, any clue! :) -- **

[R] OT: R Square Help (this debate again, i know!) and The Experimental Unit

2011-02-21 Thread Bert Gunter
Dieter (et. al.) I am weak and therefore yield to temptation... This is OT for R, so stop reading and discard now if you're looking for real R Help. (see also one inline coment below) Mount soapbox; begin rant http://ift.confex.com/ift/2005/techprogram/paper_27139.htm The importance of this ide

[R] output selectively change the font

2011-02-21 Thread Yan Jiao
Dear brainy R users, I need to output a matrix, with two colors , meaning some elements using different color I normally use write.table(table.m, file="table file name.csv", sep=","), how could I pass the index for the color ? Many thanks yan **

Re: [R] Problem with writing a file in UTF-8

2011-02-21 Thread Prof Brian Ripley
This is asking FAR too much under Windows, which has no UTF-8 locales. In particular, cat() (on which write() is based) will convert to the native locale, even if you manage to input the string as an R UTF-8 string. And conversion is a OS service, so you are getting the conversion Windows see

Re: [R] assign value to multiple objects with a given ls pattern

2011-02-21 Thread Ivan Calandra
As I partially showed, I guess that the problem of assigning the value 99 to any object in the workspace can be dealt with a more precise regular expression. Maybe that would do: ls(pattern="^a[1-9]$") or ls(pattern="^a[0-9]+$") In any case, I agree that alternatives are better Ivan Le 2/21

Re: [R] assign value to multiple objects with a given ls pattern

2011-02-21 Thread Greg Snow
If instead of having a1, a2, etc. as global variables you put them into a list then this becomes simple. The general rule is that if you ever want to do the same (or similar) think to a set of variable, then they should not have been separate variables, but part of a bigger one. Lists work wel

[R] Generating uniformly distributed correlated data.

2011-02-21 Thread Larry Hotchkiss
Hi list: Here is one approach that will generate two uniformly distributed variables with a correlation of 0.5 -- > N <- 1000 > x <- sample(1:9,N,replace=TRUE) > uni <- runif(N) > y <- (uni<0.5)*x+(uni>0.5)*sort(x) > (y.freq <- table(y) ) y 1 2 3 4 5 6 7 8 9

Re: [R] assign value to multiple objects with a given ls pattern

2011-02-21 Thread Ivan Calandra
Hi, This works for me: pat <- ls(pattern="^a") ## I would anchor "a" to the beginning with "^" for safety! for (i in seq_along(pat))assign(pat[i], value=99) Or this with lapply: lapply(pat, FUN=function(x) assign(x, value=99, envir=.GlobalEnv)) See ?assign HTH, Ivan Le 2/21/2011 17:22, Nuno

Re: [R] Generating uniformly distributed correlated data.

2011-02-21 Thread David Winsemius
On Feb 21, 2011, at 9:53 AM, Erich Neuwirth wrote: We want to generate a distribution on the unit square with the following properties * It is concentrated on a "reasonable" subset of the square, and the restricted distribution is uniform on this subset. * Both marginal distributions are uni

Re: [R] assign value to multiple objects with a given ls pattern

2011-02-21 Thread Ista Zahn
Hi Nuno, Yes, you can do for(i in ls(pattern="a")) { assign(i, 99) } but honestly this is a bad idea. It will try to assign the value of 99 to any object in your workspace that contains an a, which sounds really scary to me. Better I think to use a list: ab.list <- list(a1=1, a2=2, a3=3, a4=4

Re: [R] Problem with writing a file in UTF-8

2011-02-21 Thread Matt Shotwell
Thomas, I wasn't able to reproduce your finding. The last two characters in my 'out.txt' file were just as expected. But, I'm in an UTF-8 locale. Your locale affects the encoding of characters on your platform. If you're not in a UTF-8 locale, then characters are converted from your native encodi

Re: [R] J48 / Transform from numeric to nominal

2011-02-21 Thread Ista Zahn
Hi Patrick, You didn't say how exactly you tried to "Discretize" your variable, but have you tried ?factor ?as.character ? Best, Ista On Mon, Feb 21, 2011 at 3:34 PM, Patrick Skorupka wrote: > Hi everyone, > > I am new to field of data mining as well as particularly using R respectively > RWe

Re: [R] Equivalent of log file in R?

2011-02-21 Thread Ista Zahn
Hi Tatyana, I think you are looking for ?sink Best, Ista On Mon, Feb 21, 2011 at 2:11 PM, Tatyana Deryugina wrote: > Hi everyone, > > Is there a way to make R save the workspace output (just the results, > not the objects themselves) as you go? I'm running analysis that takes > a long time to ru

Re: [R] fitting logit to data

2011-02-21 Thread Philipp Pagel
On Mon, Feb 21, 2011 at 12:13:09PM +0100, Sylvia Tippmann wrote: > Hello, > > I'd like to fit a logit function to my data. > The data is distributed like a logit (like in this plot on wikipedia > http://en.wikipedia.org/wiki/File:Logit.png) > but the values on the x-axis are not between 0 and 1.

[R] assign value to multiple objects with a given ls pattern

2011-02-21 Thread Nuno Prista
Dear R colleagues, This seems pretty straight forward but I have been banging my head on this for some time and can't seem to find a solution suppose I have something like a1<-1; a2<-2; a3<-3; a4<-4; b1<-3; b2<-4 I would like to quickly assign to objects with a certain pattern, e.g., those in

Re: [R] Building an array from matrix blocks

2011-02-21 Thread Eduardo de Oliveira Horta
Thanks! On Mon, Feb 21, 2011 at 11:40 AM, wrote: > Well, you can lose B by just adding to X in the first for-loop, can't you? > For (...) X <- X + A[...] > > But if you want elegance, you could try: > > X = Reduce("+",lapply(1:(p+1), function(i) A[i:(n-p-1+i),i:(n-p-1+i)])) > > I imagine someone

[R] J48 / Transform from numeric to nominal

2011-02-21 Thread Patrick Skorupka
Hi everyone, I am new to field of data mining as well as particularly using R respectively RWeka for writing my master thesis. I intend to create some specific J48 classification trees with the RWeka_classifiers_tree function. When I run the source code it says “cannot handle numeric class”. I

[R] wrong lines in auto.key xyplot

2011-02-21 Thread arysar
Hi all, I'm having a problem with the auto.key function in xyplot. I changed the symbols an lines styles using these commands trellis.par.set(superpose.symbol=list(pch=c(0,1,2,3,4,5,6,8,15,16))) trellis.par.set(superpose.symbol=list(col=c(rep("black",11 trellis.par.set(superpose.symbol=list(

Re: [R] Plot of set

2011-02-21 Thread Greg Snow
Here is a solution using contour: x <- y <- seq(-1.5,1.5,length=100) z <- outer(x, y, function(x,y) x^2+y^2) contour(x,y,z, levels=1) -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help

Re: [R] Generating uniformly distributed correlated data.

2011-02-21 Thread Kjetil Halvorsen
one simple idea is to generate correlated normals (vector multivariate normal), and then use the cumulative distribution function F_i of component i such: F_i(X_i), which is uniform. Kjetil (this will not preserve tha value of the correlation coefficient, so you must experiment) On Mon, Feb 21,

Re: [R] naming vectors

2011-02-21 Thread Francois Rousseu
I guess I will just get over my laziness and use the rep function instead! But my goal was more to point out the weird names attribution behaviour. I'm using named vectors of dates that can be associated to 2 stages (incubation and rearing in nesting birds) to overlay a vector of observed d

Re: [R] Generating uniformly distributed correlated data.

2011-02-21 Thread Mike Marchywka
> Date: Mon, 21 Feb 2011 15:53:26 +0100 > From: erich.neuwi...@univie.ac.at > To: marchy...@hotmail.com > CC: soren.fau...@biology.au.dk; r-help@r-project.org > Subject: Re: [R] Generating uniformly distributed correlated data. > > We want to generate

Re: [R] Fiting a beta distribution in R

2011-02-21 Thread Daróczi Gergely
Hi, Sure. Check fitdistr from MASS or fitdist from fitdistrplus package. Best, Gergely On Mon, Feb 21, 2011 at 3:29 PM, Jim Silverton wrote: > Is there any R package that can fit a beta distribution in R? > > -- > Thanks, > Jim. > >[[alternative HTML version deleted]] > > __

Re: [R] naming vectors

2011-02-21 Thread Ivan Calandra
It is indeed an interesting behavior and I have no idea what you could do except what you did, though I would use: names(x) <- rep("A", length(x)) But I don't really understand why you want to give the same name to all elements? There might be another way around depending on your goal Ivan L

Re: [R] Building an array from matrix blocks

2011-02-21 Thread rex.dwyer
Well, you can lose B by just adding to X in the first for-loop, can't you? For (...) X <- X + A[...] But if you want elegance, you could try: X = Reduce("+",lapply(1:(p+1), function(i) A[i:(n-p-1+i),i:(n-p-1+i)])) I imagine someone can be even more eleganter than this. rad -Original Messag

Re: [R] Generating uniformly distributed correlated data.

2011-02-21 Thread Erich Neuwirth
We want to generate a distribution on the unit square with the following properties * It is concentrated on a "reasonable" subset of the square, and the restricted distribution is uniform on this subset. * Both marginal distributions are uniform on the unit interval. * All horizontal and all vert

Re: [R] naming vectors

2011-02-21 Thread Henrique Dallazuanna
Try this: names(x) <- rep("A", length(x)) On Mon, Feb 21, 2011 at 11:44 AM, Francois Rousseu < francoisrous...@hotmail.com> wrote: > > Hello R users > > I was trying to find a less annoying way of naming vectors than: > > x<-1:10 > names(x)[1:length(x)]<-"A" > > So I tried: > > x<-1:10 > names(

Re: [R] Console output

2011-02-21 Thread Ivan Calandra
It's nice to see all those solutions, but I'm wondering how it would be helpful to have the display like this. I'm a bit curious because for me the R output formatting is not very important. Ivan Le 2/21/2011 15:09, (Ted Harding) a écrit : On 21-Feb-11 13:55:24, Peter Ehlers wrote: On 2011-0

[R] naming vectors

2011-02-21 Thread Francois Rousseu
Hello R users I was trying to find a less annoying way of naming vectors than: x<-1:10 names(x)[1:length(x)]<-"A" So I tried: x<-1:10 names(x)<-"A" #but this gave only the first element named (as described in the help files) and x<-1:10 names(x)[]<-"A" #but this gave all element

[R] Equivalent of log file in R?

2011-02-21 Thread Tatyana Deryugina
Hi everyone, Is there a way to make R save the workspace output (just the results, not the objects themselves) as you go? I'm running analysis that takes a long time to run and I want to be able to interrupt it without losing all the output to date. Is there an alternative to putting "save.image()

Re: [R] Fiting a beta distribution in R

2011-02-21 Thread Jim Silverton
Is there any R package that can fit a beta distribution in R? -- Thanks, Jim. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-

Re: [R] Plotting individual trajectories from individual growth model

2011-02-21 Thread dadrivr
Hi Dennis, That's very helpful. The plot appears appears to be of the data and not the fitted linear trajectories, however, as the lines are not linear. Is it possible to plot the fitted linear trajectories (according to the fixed/random intercepts and slopes of the lme model)? Thanks again! -

[R] How to source() a .R file which was saved using UTF-8 encoding on Windows?

2011-02-21 Thread Tony Breyal
Dear all, [Note: This was originally posted over at Stack Overflow, but it was suggested that the problem may be an error in R on Windows, so I have cross posted over here too. ref: http://goo.gl/pd54D) The following, when copied and pasted directly into R works fine: > character_test <- functio

Re: [R] Regarding Soft Independent Modeling Computational Analysis

2011-02-21 Thread Mike Marchywka
> Date: Mon, 21 Feb 2011 10:45:17 +0530 > From: reynoldspravin...@gmail.com > To: r-help@r-project.org > Subject: [R] Regarding Soft Independent Modeling Computational Analysis > > Hi > I'm a B.E student pursuing my Project in the CEERI unit of the Counci

[R] linear regression and t-distribution

2011-02-21 Thread Rosario Garcia Gil
Hello I have a data set with outlier and it is not normally distributed. I would instead like to use a more robust distribution like t-distribution. My question is if the coefficients of the regression are different from zero, but assuming a t-distribution. Could someone hint me what package t

[R] fitting logit to data

2011-02-21 Thread Sylvia Tippmann
Hello, I'd like to fit a logit function to my data. The data is distributed like a logit (like in this plot on wikipedia http://en.wikipedia.org/wiki/File:Logit.png) but the values on the x-axis are not between 0 and 1. I don't think using a glm is the solution because I simply want to infer th

[R] Function within functions and MLE

2011-02-21 Thread dpender
Hi, I am trying to determine the MLE of the following function: http://r.789695.n4.nabble.com/file/n3317341/untitled.bmp I have defined both parts of the equation as separate functions and looped over the t and G values to get summations of each part. The lamda function has 3 unknowns which

Re: [R] how to calculate standard error for the predicted value from geeglm?

2011-02-21 Thread AB29
Dear Sue, I am also having problems with this. As far as I can gather the predict function will work with geeglm to give you predicted values from the model but it does not produce the standard errors automatically. I have posted a similar question and have had no answers. However, I know that

Re: [R] Console output

2011-02-21 Thread Ted Harding
On 21-Feb-11 13:55:24, Peter Ehlers wrote: > On 2011-02-21 04:21, Antje Niederlein wrote: >> Thanks for every helpful answer :-) ! >> I thought it was something "easier" but as long as there is a solution >> it's fine for me. >> >> Ciao, >> Antje > > Here's one more that I use: > > cat( 1:10, sep

Re: [R] Segfaults of eigen with blas-atlas at x86_64-pc-linux-gnu systems

2011-02-21 Thread Karl Ove Hufthammer
Juergen Rose wrote: > What are the differences between blas-reference, blas-atlas and > blas-goto. They are different. The reference BLAS is (relatively) slow; the other ones are fast. If you’re happy with the performance of the reference BLAS, or don’t use much matrix algebra-dependent code, t

Re: [R] Console output

2011-02-21 Thread Peter Ehlers
On 2011-02-21 04:21, Antje Niederlein wrote: Thanks for every helpful answer :-) ! I thought it was something "easier" but as long as there is a solution it's fine for me. Ciao, Antje Here's one more that I use: cat( 1:10, sep="\n" ) But this won't give you the row numbers. [I keep a functio

Re: [R] NPMC - replacement has 0 rows (multiple comparisons)

2011-02-21 Thread Peter Ehlers
On 2011-02-20 20:02, Karmatose wrote: Hi folks, sorry if this has been answered before, I searched long and hard before deciding to make a thread. I'm trying to include multiple variables in a non-parametric analysis (hah!). So far what I've managed to figure out is that the NPMC package from C

Re: [R] Plot

2011-02-21 Thread K. Elo
Hi! 21.02.2011 08:50, Schmidt, Lindsey C (MU-Student) wrote: > What is plot.new? How can I fix this data or add plot.new so it works? ?plot.new ?plot plot(u[h],v[h],type="l",asp=1) seems to work for me... HTH, Kimmo __ R-help@r-project.org mailing li

Re: [R] Segfaults of eigen with blas-atlas at x86_64-pc-linux-gnu systems

2011-02-21 Thread Juergen Rose
Am Montag, den 21.02.2011, 11:25 +0100 schrieb Karl Ove Hufthammer: > Juergen Rose wrote: > > >> eigen(D) > > > > *** caught segfault *** > > address (nil), cause 'unknown' > > > > Traceback: > > 1: .Call("La_rs", x, only.values, PACKAGE = "base") > > 2: eigen(D) > > > > All systems are Gentoo

Re: [R] Query: matrix definition

2011-02-21 Thread jim holtman
By careful programming practices you should be able to avoid the problem. There is no way to prevent it since the program is only doing what you ask it to do and if you make a mistake and ask it do to something, it is not the program's fault. One of the nice things (& bad things) about R is that

Re: [R] Generating uniformly distributed correlated data.

2011-02-21 Thread Mike Marchywka
> Date: Mon, 21 Feb 2011 13:03:53 +0100 > From: erich.neuwi...@univie.ac.at > To: soren.fau...@biology.au.dk; r-help@r-project.org > Subject: Re: [R] Generating uniformly distributed correlated data. > > hw<-function(r){ > (3-sqrt(1+8*r))/4 > } > > >

  1   2   >