[R] What does class "call" mean? How do I make class "formula" into a "call"?

2011-06-25 Thread StellathePug
Hello R Users! I have a list called "tabs" that I would like to have the same structure as my list "eqSystem." The two look like they have the same structure but they are different because when I look at their attributes, class(eqSystem[[1]]) is "call" but class(tabs[[1]]) is "formula". I want to

[R] Need help on a R script part

2011-06-25 Thread Lusk Aris
Hi all, I need all your help on this. I have the next part of code:e1=x1-mean(x1)e2=x2-mean(x2)n1=length(x1)n2=length(x2N=(n1 + n2)nu2=sum( c( ( x1 -mean(x1) )^2 , ( x2-mean(x2) )^2 ) )/Nss=c(e1,e2) b3= N*sum(ss^4)/ (sum( ss^2)^2)what do lines 6-8 (mathematical notati

[R] Error in qr.solve(crossprod(xsar), t(xsar)) when using SpatialFiltering

2011-06-25 Thread Aquarius
I am using the R function SpatialFiltering to my land value dataset. I compute a 500 by 500 binary spatial weight matrix (W) based on the x and y coordinates in my land value dataset. The nearest 6 neighbours were given a value of 1. By construction Wii=0. So my weight matrix look like 0 ..1 0 0 .

[R] a Weighted Least Square model for a binary response variable

2011-06-25 Thread Vivian Zhuang
Dear R Users, I would like to use R to fit a Weighted Least Square model for a binary response variable, say Y. The model is actually the model widely used for a binary dependent variable when the logistic model has not been invented. The weight is 1/(E(Y)(1-E(Y)). Could someone help me out? Tha

Re: [R] Extract character from the end of a string

2011-06-25 Thread jwehr
Thank you, Joshua! I got what I was looking for using this command: as.numeric(grepl("\\*$", qb$Player)) Where the variable name is "Player" in dataset "qb". -- View this message in context: http://r.789695.n4.nabble.com/Extract-character-from-the-end-of-a-string-tp3621732p3624124.html Sent fr

[R] about partial response and partial residual

2011-06-25 Thread pigpigmeow
i use "mgcv" package First, what is the different between partial response and partial residual plot? actually, is it partial response is as same as partial regression? second, if I use "log-link fuction", how to plot partial response and partial residual plot by R? Finally, If I want to plot p

Re: [R] Fastest way of finding if any members of vector x fall in the range of the rows of matrix y

2011-06-25 Thread Dimitris Rizopoulos
yet another solution is: v <- c(1, 2, 6, 5) w <- matrix(c(1, 4, 3, 5, 8, 10), ncol = 2, byrow = TRUE) check <- outer(w[, 1], v, "-") * outer(w[, 2], v, "-") v[which(check <= 0, arr.ind = TRUE)[, 2]] Best, Dimitris On 6/24/2011 10:05 PM, Martin Morgan wrote: On 06/24/2011 11:12 AM, Dennis Mu

Re: [R] On .. glibc detected home/sguha/lib64/R/bin/exec/R: realloc(): invalid next size: 0x000000000209e210 ***

2011-06-25 Thread Hugo Mildenberger
Saptarshi, if you look at the sheer number of shared libraries involved, heap corruption may have happened due to errors in any of these. Finding the reason for such problems is usually difficult, but almost impossible without a reproducible example. If you could boil it down to a minimal exam

[R] Access R functions from web

2011-06-25 Thread Orvalho Augusto
I need a way to send R objects and call R functions from web. Is there any project close or similar to that? I want to be able to send an HTTP rquest from an existing application with some data. And obtain a plot from R. Thanks in advance Caveman [[alternative HTML version deleted]] ___

Re: [R] On .. glibc detected home/sguha/lib64/R/bin/exec/R: realloc(): invalid next size: 0x000000000209e210 ***

2011-06-25 Thread Uwe Ligges
On 25.06.2011 02:12, Saptarshi Guha wrote: Hello, I'm trying to use rjson to parse a JSON object. The object can be found here http://pastebin.com/np0s5hgM (you'll probably need to add quotes around the content) fromJSON returns the error glibc detected home/sguha/lib64/R/bin/exec/R: rea

[R] Problems setting language in R-2.13.0 and opening RData

2011-06-25 Thread Manabu Sakamoto
Dear list, I just recently installed R-2.13.0 on my Windows7. I used to run R-2.10.0. First of all, I used to be able to install R in English (in R-2.10.0) during the installation procedure. My PC is in a Japanese environment but I want R to be in English because I won't be able to interpret any

Re: [R] Extract character from the end of a string

2011-06-25 Thread Uwe Ligges
1. Please always quote the original message when sending messages to this *mailing list*. 2. Please send your answers and comments also to the original poster who may not be aware you posted to the list. Uwe Ligges On 25.06.2011 06:55, jwehr wrote: Thank you, Joshua! I got what I was look

Re: [R] Time-series analysis with treatment effects - statistical approach

2011-06-25 Thread Mike Marchywka
> Date: Thu, 23 Jun 2011 15:41:25 -0700 > From: jmo...@student.canterbury.ac.nz > To: r-help@r-project.org > Subject: Re: [R] Time-series analysis with treatment effects - statistical > approach > > > Mike Marchywka wrote: > > > >> I discovered a way to do repetitive tasks that can be conci

Re: [R] Need help on a R script part

2011-06-25 Thread Hugo Mildenberger
Lusk, if I were in your business, I would tackle such a problem with help from a little formatting ... e1=x1-mean(x1) e2=x2-mean(x2) n1=length(x1) n2=length(x2) N=(n1 + n2) nu2=sum( c( ( x1 -mean(x1) )^2 , ( x2-mean(x2) )^2 ) )/N ss=c(e1,e2) b3=N*sum(ss^4)/(sum( ss^2)^2)

Re: [R] Competing-risks nomogram

2011-06-25 Thread Firas Abdollah
Many thanks for the prompt response. However, I am afraid that it is not completely clear for me. I apologize, I am not a statistician. Sorry, may be what I will say make totally non sense, but what I understood is the following: Let's suppose that I need to predict cancer-specific survival using t

Re: [R] Access R functions from web

2011-06-25 Thread Mike Marchywka
> From: orvaq...@gmail.com > To: r-help@r-project.org > Subject: [R] Access R functions from web > > I need a way to send R objects and call R functions from web. Is there any > project close or similar to that? > > I want to be able to send an HTTP rquest from an existing application with >

Re: [R] Problems setting language in R-2.13.0 and opening RData

2011-06-25 Thread Uwe Ligges
On 25.06.2011 11:48, Manabu Sakamoto wrote: Dear list, I just recently installed R-2.13.0 on my Windows7. I used to run R-2.10.0. First of all, I used to be able to install R in English (in R-2.10.0) during the installation procedure. My PC is in a Japanese environment but I want R to be in E

Re: [R] try to generate graph for each element of my list

2011-06-25 Thread Uwe Ligges
On 24.06.2011 21:29, n.via...@libero.it wrote: Dear all, I have the following problem. I have a List of time series dataframe.I'm trying to produce specific graph for each element of my list. The code is: This is my list: Lista_import<-lapply(Lista_import, function(x){ x2<-subset(x, select=c("A

Re: [R] What does class "call" mean? How do I make class "formula" into a "call"?

2011-06-25 Thread David Winsemius
On Jun 24, 2011, at 6:12 PM, StellathePug wrote: Hello R Users! I have a list called "tabs" that I would like to have the same structure as my list "eqSystem." The two look like they have the same structure but they are different because when I look at their attributes, class(eqSystem[[1]

Re: [R] Installation of bigmemory fails

2011-06-25 Thread Jay Emerson
Premal, Package authors generally welcome direct emails. We've been away from this project since the release of 2.13.0 and I only just noticed the build errors. These generally occur because of some (usually small and solvable) problem with compilers and the BOOST libraries. We'll look at it an

[R] AUTO: Chalk, Alan has a new email address

2011-06-25 Thread Alan Chalk
I am out of the office until 01/05/2012. Please note that I have changed email address. You can contact me at alan.ch...@uk.rsagroup.com Note: This is an automated response to your message "R-help Digest, Vol 100, Issue 26 [Virus checked]" sent on 25/06/2011 11:00:11. This is the only notif

Re: [R] texi2dvi runs but produces no output

2011-06-25 Thread David Hewitt
Christiaan, Sorry I did not respond earlier. I have been away on vacation. With all the changes in LyX 2.x to make Sweave stuff easier, I suspect this problem should go away. I have not upgraded my system, but a couple folks that have done so reported no problems with a setup like yours. Probably

Re: [R] Need help on a R script part

2011-06-25 Thread Mike Miller
I'm curious about what would cause this (see below), if it isn't a joke. Is it possible that it didn't look ridiculous in the deleted HTML but the text looked bad? It's almost unreadable. I guess the HTML gets deleted because it is a waste of space, but I received a 14 MB message from this li

[R] integration function

2011-06-25 Thread li li
Hi all, Can anyone please take a look at the following two functions. The answer does not seem to be right. Thank you very much! f1 <- function(x) {integrand <- function (x, mu){ dnorm(x, mean=mu, sd=1)*dnorm(mu, mean=2, sd=1) } integrate(in

[R] Vector with factors inside lists/tuples

2011-06-25 Thread Håvard Wahl Kongsgård
Hi, this seems like a strange question, but in R is there a function that can handle vectors containing factors inside lists/tuples? Or is there some other approach/functions I can use? Like for example V1 "{"Harry","Brown")" "{"Brown","Harry")" I want to use these variables in a machine learning

Re: [R] integration function

2011-06-25 Thread Peter Ehlers
On 2011-06-25 08:48, li li wrote: Hi all, Can anyone please take a look at the following two functions. The answer does not seem to be right. Thank you very much! f1<- function(x) {integrand<- function (x, mu){ dnorm(x, mean=mu, sd=1)*dnorm(mu, mean=2, sd=1)

Re: [R] Vector with factors inside lists/tuples

2011-06-25 Thread Håvard Wahl Kongsgård
Well, when a think of it using an array would be a simple solution. But to what extent are arrays supported by other R functions? -Håvard 2011/6/25 Håvard Wahl Kongsgård > Hi, this seems like a strange question, but in R is there a function that > can handle vectors containing factors inside li

Re: [R] Vector with factors inside lists/tuples

2011-06-25 Thread David Winsemius
On Jun 25, 2011, at 12:49 PM, Håvard Wahl Kongsgård wrote: Hi, this seems like a strange question, but in R is there a function that can handle vectors containing factors inside lists/tuples? Yes, A very strange question, indeed ... since dataframes are lists that commonly contain vectors

[R] How to export to pdf in landscape orientation?

2011-06-25 Thread Juan Andres Hernandez
Does anybody know how to get a pdf file with landscape orientation?. pdf(file= 'my_file.pdf' ,onefile=T,paper='A4') plot(sin, -pi, 2*pi) dev.off() Thank's in advance Juan A. Hernandez Spain [[alternative HTML version deleted]] __ R-h

Re: [R] Vector with factors inside lists/tuples

2011-06-25 Thread David Winsemius
On Jun 25, 2011, at 1:33 PM, Håvard Wahl Kongsgård wrote: Well, when a think of it using an array would be a simple solution. But to what extent are arrays supported by other R functions? Arrays are well supported by arithmetic, logical and accessor functions. Your questions seem very unfoc

Re: [R] How to export to pdf in landscape orientation?

2011-06-25 Thread Rainer Schuermann
Tell PDF the size of your piece of paper - here is what works for me: pdf( file = "result.pdf", width = 28, height = 18 ) # numbers are cm some( stuff ) dev.off() Hope it helps, Rainer On Saturday 25 June 2011 18:46:28 Juan Andres Hernandez wrote: > Does anybody know how to get a pd

Re: [R] How to export to pdf in landscape orientation?

2011-06-25 Thread Sarah Goslee
>From the help for pdf: paper: the target paper size. The choices are ‘"a4"’, ‘"letter"’, ‘"legal"’ (or ‘"us"’) and ‘"executive"’ (and these can be capitalized), or ‘"a4r"’ and ‘"USr"’ for rotated (‘landscape’). So I'd use paper='a4r'. You can also set the width a

Re: [R] Vector with factors inside lists/tuples

2011-06-25 Thread Håvard Wahl Kongsgård
Hi, sorry my question was not really clear  |Are you very early in efforts at learning R? No, have been a long term user of R, but only use R for the statistical stuff. The heart of the issue is that I have list of keywords that I want to analyse with a machine learning algorithm (20 000 keywords

Re: [R] Vector with factors inside lists/tuples

2011-06-25 Thread David Winsemius
On Jun 25, 2011, at 2:13 PM, Håvard Wahl Kongsgård wrote: Hi, sorry my question was not really clear |Are you very early in efforts at learning R? No, have been a long term user of R, but only use R for the statistical stuff. The heart of the issue is that I have list of keywords that I w

Re: [R] Problems setting language in R-2.13.0 and opening RData

2011-06-25 Thread Prof Brian Ripley
Please see the rw-FAQ. And your claims about 2.10.0 are simply not true. There only ever has been an option to choose the language of the installer: see the rw-FAQ. On Sat, 25 Jun 2011, Manabu Sakamoto wrote: Dear list, I just recently installed R-2.13.0 on my Windows7. I used to run R-2.

Re: [R] Need help on a R script part

2011-06-25 Thread Duncan Murdoch
On 11-06-25 11:33 AM, Mike Miller wrote: I'm curious about what would cause this (see below), if it isn't a joke. Is it possible that it didn't look ridiculous in the deleted HTML but the text looked bad? It's almost unreadable. I guess the HTML gets deleted because it is a waste of space, but

Re: [R] Access R functions from web

2011-06-25 Thread Tobias Verbeke
Hi Caveman, On 06/25/2011 11:18 AM, Orvalho Augusto wrote: I need a way to send R objects and call R functions from web. Is there any project close or similar to that? I want to be able to send an HTTP rquest from an existing application with some data. And obtain a plot from R. This is one

Re: [R] Competing-risks nomogram

2011-06-25 Thread Frank Harrell
Yes you use the linear predictor from your regression as the dependent variable in the rms package's ols function. You will get an R^2 of 1.0. You can depict the ols model with nomogram(). Note that there are so many statistical issues in competing risks that doing this without a statistician is

Re: [R] Vector with factors inside lists/tuples

2011-06-25 Thread Håvard Wahl Kongsgård
>> glm( V0 ~ "HARRY"  + "KLINE" + "Brown" + "Larry") > > No. You are mistaken. Assuming that V0 is defined and has the same length as > there are rows in that data.frame, then V1 and V2 would be the arguments in > the formula and they would not be quoted. > > ?glm   # and work through the examples

Re: [R] What does class "call" mean? How do I make class "formula" into a "call"?

2011-06-25 Thread peter dalgaard
On Jun 25, 2011, at 15:24 , David Winsemius wrote: > > On Jun 24, 2011, at 6:12 PM, StellathePug wrote: > >> Hello R Users! >> I have a list called "tabs" that I would like to have the same structure as >> my list "eqSystem." The two look like they have the same structure but they >> are differ

Re: [R] Vector with factors inside lists/tuples

2011-06-25 Thread David Winsemius
On Jun 25, 2011, at 4:01 PM, Håvard Wahl Kongsgård wrote: glm( V0 ~ "HARRY" + "KLINE" + "Brown" + "Larry") No. You are mistaken. Assuming that V0 is defined and has the same length as there are rows in that data.frame, then V1 and V2 would be the arguments in the formula and they would

Re: [R] How to export to pdf in landscape orientation?

2011-06-25 Thread Berry Boessenkool
Hey Juan, paper="a4r" or "USr" for rotated (‘landscape’)) i.e. pdf(file='my_file.pdf', onefile=T, paper='A4r') plot(sin, -pi, 2*pi) ; dev.off() Greetings from Potsdam University, Germany, Berry Boessenkool > From: jhernandezcabr...@gmail.com > Date: Sat, 25 Jun 2011 18:46:28 +0100 > To

[R] Moving average in a data table

2011-06-25 Thread Roman Naumenko
Hi, I'm trying to figure out common approach on calculating MA on a dataset that contains column "time". After digging around, I believe functions rollmean and rollaply should be used. However I don't quite understand the requirements for the underlying data. Should it be zoo object type? Fo

Re: [R] Competing-risks nomogram

2011-06-25 Thread Firas Abdollah
Many thanks On Sat, Jun 25, 2011 at 10:00 PM, Frank Harrell [via R] wrote: > Yes you use the linear predictor from your regression as the dependent > variable in the rms package's ols function.  You will get an R^2 of 1.0. >  You can depict the ols model with nomogram().  Note that there are s

[R] log-link function problem

2011-06-25 Thread pigpigmeow
y<-gam(a~s(b),family=gaussian(link=log),data) y<-gam(loga~s(b), family =gaussian (link=identity),data) y<-gam(loga~s(b),family=gaussian(link=log),data) what are the diffent these 3 equations? -- View this message in context: http://r.789695.n4.nabble.com/log-link-function-problem-tp3625014p3625

[R] Multivariate normal density in C for R

2011-06-25 Thread zerfetzen
Does anyone know of a package that uses C code to calculate a multivariate normal density? My goal is to find a faster way to calculate MVN densities and avoid R loops or apply functions, such as when X and mu are N x K matrices, as opposed to vectors, and in this particular case, speed really mat

[R] calling R from C

2011-06-25 Thread Desi Ap
I read R extensions on calling R within c code. I am on windows vista, cygwin and R-2.13.0.I can compile & link the c code with following commands$gcc -I/cygdrive/c/Progra~1/R/R-2.13.0/include -c -ggdb Rhello.c gcc-L/cygdrive/c/Progra~1/R/R-2.13.0/bin/i386 -oRhello Rhello.o -lR However I cant run

Re: [R] ggplot2 month and year boxplot x axis order problem

2011-06-25 Thread philipharrison
Hi, Thanks, although I dont think it was the Date.Time variable that was the problem because my x variable was Month.Year. I realise now that this month variable was a factor and I changed the order of the factor using the following : fish$MonthYr<-factor(fish$MOYR,levels=c("05,2010","06,2010",

Re: [R] Moving average in a data table

2011-06-25 Thread Gabor Grothendieck
On Sat, Jun 25, 2011 at 3:15 PM, Roman Naumenko wrote: > Hi, > > I'm trying to figure out common approach on calculating MA on a dataset that > contains column "time". > > After digging around, I believe functions rollmean and rollaply should be > used. > However I don't quite understand the requi

Re: [R] What does class "call" mean? How do I make class "formula" into a "call"?

2011-06-25 Thread David Winsemius
On Jun 25, 2011, at 4:33 PM, peter dalgaard wrote: On Jun 25, 2011, at 15:24 , David Winsemius wrote: On Jun 24, 2011, at 6:12 PM, StellathePug wrote: Hello R Users! I have a list called "tabs" that I would like to have the same structure as my list "eqSystem." The two look like they ha

Re: [R] calling R from C

2011-06-25 Thread David Winsemius
On Jun 25, 2011, at 11:18 AM, Desi Ap wrote: I read R extensions on calling R within c code. I am on windows vista, cygwin and R-2.13.0.I can compile & link the c code with following commands$gcc -I/cygdrive/c/Progra~1/R/R-2.13.0/include -c - ggdb Rhello.c gcc-L/cygdrive/c/Progra~1/R/R-2.1

Re: [R] calling R from C

2011-06-25 Thread Barry Rowlingson
On Sat, Jun 25, 2011 at 4:18 PM, Desi Ap wrote: > I read R extensions on calling R within c code. I am on windows vista, cygwin > and R-2.13.0.I can compile & link the c code with following commands$gcc > -I/cygdrive/c/Progra~1/R/R-2.13.0/include -c -ggdb Rhello.c > gcc-L/cygdrive/c/Progra~1/R/R

Re: [R] reading data from password protected url

2011-06-25 Thread Duncan Temple Lang
Hi Steve RCurl can help you when you need to have more control over Web requests. The details vary from Web site to Web site and the different ways to specify passwords, etc. If the JSESSIONID and NCES_JSESSIONID are regular cookies and returned in the first request as cookies, then you can ju

Re: [R] calling R from C

2011-06-25 Thread Desi Ap
hey David:Newbie here. will avoid duplicates next time. thanks... -krishna --- On Sat, 6/25/11, David Winsemius wrote: From: David Winsemius Subject: Re: [R] calling R from C To: "Desi Ap" Cc: r-help@r-project.org Date: Saturday, June 25, 2011, 10:38 PM On Jun 25, 2011, at 11:18 AM, Desi Ap

[R] i want to unsubscribe

2011-06-25 Thread elisheva corn
how do i unsubscribe [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minim

Re: [R] i want to unsubscribe

2011-06-25 Thread Ista Zahn
See the footer to this (and every R-help) message... On Sun, Jun 26, 2011 at 2:17 AM, elisheva corn wrote: > how do i unsubscribe > >        [[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list > https://staterythz.ch/mailman/

Re: [R] i want to unsubscribe

2011-06-25 Thread Jorge Ivan Velez
Check "R-help Subscribers" at https://stat.ethz.ch/mailman/listinfo/r-help HTH, Jorge On Sun, Jun 26, 2011 at 2:17 AM, elisheva corn <> wrote: > how do i unsubscribe > >[[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing

Re: [R] i want to unsubscribe

2011-06-25 Thread Ista Zahn
Another option is http://lmgtfy.com/?q=R-help+unsubscribe Best, Ista On Sun, Jun 26, 2011 at 2:25 AM, Jorge Ivan Velez wrote: > Check "R-help Subscribers" at https://stat.ethz.ch/mailman/listinfo/r-help > > HTH, > Jorge > > > On Sun, Jun 26, 2011 at 2:17 AM, elisheva corn <> wrote: > >> how do

[R] cluster() or frailty() in coxph

2011-06-25 Thread Ehsan Karim
Dear List, Can anyone please explain the difference between cluster() and frailty() in a coxph? I am a bit puzzled about it. Would appreciate any useful reference or direction. cheers, Ehsan > marginal.model <- coxph(Surv(time, status) ~ rx + cluster(litter), rats) > frailty.model <- coxph(S

[R] Why is looping in R inefficient, but in C not?

2011-06-25 Thread Alexander Engelhardt
Hey, I just read another post about calling R from C. Someone on stackoverflow (DWin makes me suspect its David W.?) referenced this: http://www.math.univ-montp2.fr/~pudlo/R_files/call_R.pdf Which made me think: Why is a loop in R bad, but in C not? And where exactly does looping cost the most