Re: [R] Problem in Starting R Server - object of type 'closure' is not subsettable

2012-11-27 Thread Barry Rowlingson
On Tue, Nov 27, 2012 at 6:33 AM, Manoj G wrote: > Hi All, > > I am trying to start R Server to run some Java Script in my local machine > using the library, 'Rook'. I use Windows 7. > > And my codes are following, > >> library(Rook) > >> myD3dir <- 'D:\\STUDIES\\Java script\\d3-master' >> s <- Rht

[R] install the ggplot2 package

2012-11-27 Thread Jonsson
Has one try to install the ggplot2 package recently? I tried to install it on my new system and had trouble: I tried a different CRAN mirror but didn't work library(ggplot2) Error in loadNamespace(i, c(lib.loc, .libPaths())) : there is no package called ‘stringr’ In addition: Warning messag

Re: [R] install the ggplot2 package

2012-11-27 Thread Pascal Oettli
Hello, Probably you should upgrade your version of R and install the package 'stringr'. To not miss dependencies, try 'install.packages("ggplot2", dependencies=TRUE)'. Regards, Pascal Le 12/11/27 17:30, Jonsson a écrit : Has one try to install the ggplot2 package recently? I tried to insta

Re: [R] cosine curve fit

2012-11-27 Thread Marc Girondot
Le 26/11/12 18:19, dysonsphere a écrit : does anybody have a suggestion as to how to use R to fit some date to a cosine function and then have some output statistics that will evaluate the fit? You could take a look at the package phenology. It fits several periodic functions (cosine) onto ti

[R] Anova

2012-11-27 Thread humming-bird
Hi everyone, I am new to this forum and also new to statistics and I would appreciated it if someone would take some time to answer my question. I am analyzing companies in regard to their leverage. I categorized the companies into 3 groups: small, mid and large. For the group small, I have 55 de

[R] Problem installing knitr 0.5 or higher in Ubuntu

2012-11-27 Thread ATANU
Hi, I am using Rstudio in Ubuntu . While installing R from the terminal I got the version R 2.13.1 . But the problem is that knitr 0.5 requires higher versions. So is there any way to get the latest version of R in ubuntu (or 2.13.1 is the maximum I can get)? In case the higher R version is not

[R] sum per day

2012-11-27 Thread Tagmarie
Hello, I have a data frame somewhat like this one: myframe <- data.frame (Timestamp=c("24.09.2012 09:00", "24.09.2012 10:00", "24.09.2012 11:00", "25.09.2012 09:00", "25.09.2012 10:00", "25.09.2012 11:00"), Hunger=c(1,1,1,2,2,1) )

Re: [R] Problem in Starting R Server - object of type 'closure' is not subsettable

2012-11-27 Thread Manoj G
Thank you so much Barry for pointing out my mistake. Manoj G -- View this message in context: http://r.789695.n4.nabble.com/Problem-in-Starting-R-Server-object-of-type-closure-is-not-subsettable-tp4650931p4650938.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] Help R

2012-11-27 Thread Jim Lemon
On 11/26/2012 09:38 PM, alanaro...@sapo.pt wrote: Goodmorning, I'moneafazrtrbhoquhasa variablefactorcomtwoNivesCandH.Queoaatravésdlinear regressionrelationshipetrehaSaerifthe variablespthiedoseogmerparawanttheHtothatanddouCrespctinteRaficthat showsthe two curvesHandCLIRand Selecionar tudo Thank y

Re: [R] sum per day

2012-11-27 Thread Rui Barradas
Hello, Try aggregate(Hunger ~ cut(myframe2$myframestime, "day"), data = myframe2, FUN = sum) Hope this helps, Rui Barradas Em 27-11-2012 09:13, Tagmarie escreveu: Hello, I have a data frame somewhat like this one: myframe <- data.frame (Timestamp=c("24.09.2012 09:00", "24.09.2012 10:00",

[R] order.max specification problem in the ar.ols function

2012-11-27 Thread soham chakraborty
Hello I am facing a curious problem.I have a time series data with which i want to fit auto-regressive model of order p, where p runs from 1:9.I am using a for loop which will fit an AR(p) model for each value of p using the *ar.ols* function. I am using the following code for ( p in 1:9){ a=ar.ol

Re: [R] R strange behaviour when building huge concatenation

2012-11-27 Thread Rui Barradas
Hello, That instruction gave me no problems. I've tried it with and without the useless end semi-colon and all went well. Something to do with your R session? Try it in a new session to see if it works. Hope this helps, Rui Barradas Em 26-11-2012 21:24, angeloimm escreveu: Any idea on the r

Re: [R] Problem installing knitr 0.5 or higher in Ubuntu

2012-11-27 Thread Pascal Oettli
Hello, http://cran.at.r-project.org/bin/linux/ubuntu/README.html Regards, Pascal Le 27/11/2012 19:27, ATANU a écrit : Hi, I am using Rstudio in Ubuntu . While installing R from the terminal I got the version R 2.13.1 . But the problem is that knitr 0.5 requires higher versions. So is there

Re: [R] Problem installing knitr 0.5 or higher in Ubuntu

2012-11-27 Thread Berend Hasselman
On 27-11-2012, at 11:27, ATANU wrote: > > Hi, > > I am using Rstudio in Ubuntu . While installing R from the terminal I got > the version R 2.13.1 . > But the problem is that knitr 0.5 requires higher versions. > So is there any way to get the latest version of R in ubuntu (or 2.13.1 is > the m

Re: [R] Problem installing knitr 0.5 or higher in Ubuntu

2012-11-27 Thread Rui Barradas
Hello, How did you install R? I've installed it from the terminal and got the latest version, R 2.15.2 The commands I've used were sudo apt-get update sudo apt-get install r-base sudo apt-get install rbase-dev Hope this helps, Rui Barradas Em 27-11-2012 10:27, ATANU escreveu: Hi, I am usi

Re: [R] Help with graphics in gamm4 library

2012-11-27 Thread Simon Wood
I would approach something like this using predict(fit41$gam,...) (see ?predict.gam) to produce the data needed for the plots. Another possibility is to use s(Time,trt,bs="fs") (but see ?factor.smooth.interaction first). Note that gamm4 does not have a correlation argument, because lme4 does

Re: [R] Error in Random Effect Panel

2012-11-27 Thread Hard Core
up -- View this message in context: http://r.789695.n4.nabble.com/Error-in-Random-Effect-Panel-Negative-variance-tp4650654p4650948.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch

[R] Effect of each term in the accuracy of Nonlinear multivariate regression fitting equation

2012-11-27 Thread dsfakianakis
Dear all, I have a set of data with 4 inputs (independent variables) and one output (dependent variable). I want to perform a regression analysis in order to fit these data to a regression model, however due to the non-linearity of the model I do not have a clue which equation to use. I am thinkin

Re: [R] how to input a string without quote

2012-11-27 Thread snawy ben
Wow, you are so lazy... But sometimes R is just designed for lazy guys... ## f = function(a) { s = substitute(a) as.character(s) } ## Yihui Cheers, Yihui, nearly 4 years after your post this still works like a charm. ps: of course I am not lazy, I simply want to avoid error prone input!

Re: [R] question about A2R

2012-11-27 Thread dmatshalaga
DID YOU SOLVE THE PROBLEM? -- View this message in context: http://r.789695.n4.nabble.com/question-about-A2R-tp4640539p4650952.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mai

Re: [R] order.max specification problem in the ar.ols function

2012-11-27 Thread Rui Barradas
Hello, Just set argument aic = FALSE. From the help page: |aic| Logical flag. If |TRUE| then the Akaike Information Criterion is used to choose the order of the autoregressive model. If |FALSE|, the model of order |order.max| is fitted. Hope this helps, Rui Barradas Em 27-11-2012 10:36, soh

Re: [R] Anova

2012-11-27 Thread Jose Iparraguirre
Hi, You can use the car package and choose Type-III test. Also, have a look at the package easyanova. Regards, José José Iparraguirre Chief Economist Age UK -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of humming-bird Sent: 27 N

Re: [R] Help on function please

2012-11-27 Thread Jean V Adams
Andras, What do you want your code to do? Give us a little explanation with your code. When I try to run your code, I get Error: could not find function "genoud". Either supply the code for the functions included in your code, or tell us what packages we need to run it. Jean Andras

[R] loop with date

2012-11-27 Thread Tagmarie
Hello, I tried to construct my very first loop today and completly failed :-( Maybe someone can help me? I have a dataframe somewhat like this one: myframe <- data.frame (Timestamp=c("24.09.2012 09:00", "24.09.2012 10:00", "24.09.2012 11:00", "25.09.2012 09:0

Re: [R] error of runing R in R 2.15.2 w/o graphes generated

2012-11-27 Thread John Kane
It works for me. See http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example for some suggestions on how to report the problem in more detail. Your sessionInfo() is probably an absolute necessity here. Good luck John Kane Kingston ON Canada > -Original Mes

Re: [R] loop with date

2012-11-27 Thread R. Michael Weylandt
On Tuesday, November 27, 2012, Tagmarie wrote: > Hello, > I tried to construct my very first loop today and completly failed :-( > Maybe someone can help me? > I have a dataframe somewhat like this one: > > myframe <- data.frame (Timestamp=c("24.09.2012 09:00", "24.09.2012 10:00", > "24.09.2012 11

Re: [R] Effect of each term in the accuracy of Nonlinear multivariate regression fitting equation

2012-11-27 Thread Keith Jewell
In this context, "linear model" means linear in the _coefficients_ not (necessarily) linear in the predictors, so your model: JIM ~ z1*A + z2*B + z3*A*B^2 + z4*C*D^3 + z5*A^2*B^2 ... is a linear model (in z1, z2, ...). So you don't need to use nls, lm is probably favourite. You can use all t

Re: [R] R strange behaviour when building huge concatenation

2012-11-27 Thread John Kane
No idea. It seems fine to me. Perhaps a bit more information would be useful expecially your sessionInfo() See http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example for some suggestions on forming questions. John Kane Kingston ON Canada > -Original Messa

Re: [R] Effect of each term in the accuracy of Nonlinear multivariate regression fitting equation

2012-11-27 Thread David Winsemius
On Nov 27, 2012, at 7:44 AM, Keith Jewell wrote: In this context, "linear model" means linear in the _coefficients_ not (necessarily) linear in the predictors, so your model: JIM ~ z1*A + z2*B + z3*A*B^2 + z4*C*D^3 + z5*A^2*B^2 ... is a linear model (in z1, z2, ...). So you don't need to u

Re: [R] Anova

2012-11-27 Thread S Ellison
> Now my question: Am I allowed to use these functions given > that my data is unbalanced? Unusually, Yes, assuming all the other requisite assumptions are reasonably well satisfied. One-way ANOVA interpretation is not much affected by imbalance because (among other things) with only one facto

Re: [R] loop with date

2012-11-27 Thread jim holtman
Here is an example of an approach: > myframe <- data.frame (Timestamp=c("24.09.2012 09:00", "24.09.2012 10:00", + "24.09.2012 11:00", +"25.09.2012 09:00", "25.09.2012 10:00", + "25.09.2012 11:00"), + Speed=c(1,1,2,5,1,6)) > myframestime <

Re: [R] order.max specification problem in the ar.ols function

2012-11-27 Thread soham chakraborty
Thank you very much for the advice.It works that way. Soham Chakraborty -- View this message in context: http://r.789695.n4.nabble.com/order-max-specification-problem-in-the-ar-ols-function-tp4650942p4650957.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] sum per day

2012-11-27 Thread arun
HI, Try this: library(plyr) res<-ddply(myframe2,.(Timestamp=as.Date(myframe2$myframestime)),function(x) sum(x$Hunger))  names(res)[2]<-"sumHunger"  res[,1]<-format(res[,1],"%d.%m.%Y")  res #   Timestamp sumHunger #1 24.09.2012 3 #2 25.09.2012 5 A.K. - Original Message -

Re: [R] loop with date

2012-11-27 Thread arun
HI, If you want to do daily mean, sum etc. you could try ?tapply(), ?ave(), ?aggregate(), ?ddply() etc. For e.g.  ave(myframe2$Speed,as.Date(myframe2$myframestime),FUN=sum) #[1]  4  4  4 12 12 12 tapply(myframe2$Speed,as.Date(myframe2$myframestime),FUN=mean) #2012-09-24 2012-09-25  # 1.33   4.

[R] Variance component estimation in glmmPQL

2012-11-27 Thread nblarson
Hi all, I've been attempting to fit a logistic glmm using glmmPQL in order to estimate variance components for a score test, where the model is of the form logit(mu) = X*a+ Z1*b1 + Z2*b2. Z1 and Z2 are actually reduced rank square root matrices of the assumed covariance structure (up to a constan

Re: [R] R strange behaviour when building huge concatenation

2012-11-27 Thread angeloimm
Hello John It seems correct to me too but in my R console it seems to not be working Here there is what I did: i copied the statement on one row (leaving and removing the final useless semi colomn) i tried to execute it in the R console (in order to open my R console I simply opened a terminal wind

Re: [R] Problems with nls

2012-11-27 Thread Yifen
Hi all, I am encountering the same problem when I use nls to estimate the Bass diffusion model. I used similar code in the previous replies and it works with the data in this original post. However, I got an error when I use my own data. Error in nls(formula = Bass.Model, start = c(p = 0.03, q =

Re: [R] confidence intervals with glmmPQL

2012-11-27 Thread Sally_roman
Hi - Thanks for the reply. I provided answers below. Sally Sally_roman umassd.edu> writes: > Hi - I am using R version 2.13.0. I have run several GLMMs using > the glmmPQL function to model the proportion of fish caught in one > net to the total caught in both nets by length. I started with

[R] in par(mfrow=c(1, 2)), how to keep one half plot static and the other half changing

2012-11-27 Thread Baoqiang Cao
Hi, I'm trying to plot something in the following way and would like if you could help: I'd like in a same plot window, two plots are shown, the left one is a bird-view plot of the whole data, the right half keep changing, i.e., different plots will be shown up on request, so that when I select/c

Re: [R] binning by frequency

2012-11-27 Thread Rui Barradas
Hello, I'm not sure I ubderstand but, h <- hist(b1,brea=100) which.max(h$counts) # max frequency findInterval(b1, h$breaks) Hope this helps, Rui Barradas Em 27-11-2012 14:59, Santosh escreveu: Dear Rxperts, is there way to identify intervals from continuous data (having some kind of a pa

[R] best HDF5 package: h5r or rhdf5?

2012-11-27 Thread Johann Hibschman
What is the current best package for manipulating HDF5 data files? I tried "hdf5" a long time ago, but I ran into memory problems. "h5r" is on CRAN now, and "rhdf5" is part of bioconductor. Ideally, I'd like to read simple vectors or tables, either the entire thing or a subset of rows. I don't ne

Re: [R] glm convergence warning

2012-11-27 Thread Jean V Adams
It could be that for some levels of your independent factor variables (WS, SS), the response is either all zeroes or all ones. Or, for your continuous independent variables (DV, DS), there is a clean break between the zeroes and ones. For example, if all the CIDs are one when DS <= 18 but all

Re: [R] Accumulate objects in list after try()

2012-11-27 Thread Jean V Adams
Create an empty list called "result" before you run the loop. Then store the results of the loop in the list. For example: result <- vector(mode="list", length=1000) for(i in 1:1000){ result[[i]] <- try(harvest(i)) } Jean mdvaan wrote on 11/27/2012 12:09:38 AM: > > Hi, >

Re: [R] Help with optimization problem

2012-11-27 Thread Berend Hasselman
Jorge, First of all, I really do think that questions such as these should be posted directly to R-help. More people will then see it with a greater chance of getting useful replies. I am subscribed to R-help so will see posts. I have cc'ed this reply to R-help so that you may get more answers

Re: [R] loop with date

2012-11-27 Thread Tagmarie
Ok, sorry, I thought the more complex details might be confusing and nobody might answer. Here is something which looks more like my real dataframe and also what I want to do with it: That's my data frame: myframe <- data.frame (Timestamp=c("24.09.2012 09:00", "24.09.2012 10:00", "24.09.2012 1

Re: [R] aggregate() runs out of memory

2012-11-27 Thread Sam Steingold
> * Steve Lianoglou [2012-11-26 19:47:25 > -0500]: > > On Monday, November 26, 2012, Sam Steingold wrote: > [snip] > >> >> there is precisely one country for each id. >> i.e., unique(country) is the same as country[1]. >> thanks a lot for the suggestion! >> >> > R> result <- f[, list(min=min(dela

Re: [R] install the ggplot2 package

2012-11-27 Thread Jonsson
I did upgrade but that did not solve the problem -- View this message in context: http://r.789695.n4.nabble.com/install-the-ggplot2-package-tp4650935p4650985.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailin

[R] calling c function from R

2012-11-27 Thread Li Shangru
Hello I want to call C function from R. I follow the instruction below using the example of foo.c http://www.stat.umn.edu/~charlie/rc/ I saved the foo.c in my work directory. Then I entered the command R CMD SHLIB foo.c , I got the following message Error: unexpected symbol in "R CMD" How d

[R] error of installing a R package on Win 7

2012-11-27 Thread Jack Bryan
Hi, I am trying to run R 2.15.2 on Win 7. I am trying to run some example R code of the book :Portfolio Optimization with R/Rmetrics I was told that : To install all packages required for the examples of this ebook we recommendthat you install the bundle package ebookPortfolio. This can be do

[R] R.dll problem during loading the package lme4

2012-11-27 Thread Prasenjit
Greetings, I am using R 2.14.1 and while loading package lme4 I am getting the error message: the procedure entry point R_Check_class_etc could not be located in the dynamic link library R.dll. Could anybody help me on this? Thanks and Regards, Roy -- View this message in context: http://r.789

[R] Stuck trying to modify a function

2012-11-27 Thread Benjamin Ward (ENV)
Hi, I have the following data: Path_Number <- 5 ID.Path <- c(1:Path_Number) # Make vector of ID's. No_of_X <- sample(50:550, length(ID.Path), replace=TRUE) # X <- split(sample(1:1, sum(No_of_X), replace=TRUE), rep(ID.Path, No_of_X)) Y <- lapply(X,function(x) sample(x, round(runif(1, min=10, m

[R] interactions in GAMs

2012-11-27 Thread chirleu
Hi all, I wonder if it's possible to include a double interaction in a GAM formula. Example: If I do this: mod=gam(energy~s(size, *by=color, by=sex*, k=5) + temperature, ...) I get the interaction betwen size*color and size*sex. But I need size*color*sex, being size a smoother. I've created a n

Re: [R] binning by frequency

2012-11-27 Thread Mark Lamias
You might find the binning function in the sm package helpful here. --Mark Lamias From: Santosh To: r-help Sent: Tuesday, November 27, 2012 9:59 AM Subject: [R] binning by frequency Dear Rxperts, is there way to identify intervals from continuous data (hav

Re: [R] interactions in GAMs

2012-11-27 Thread Simon Wood
David, I think that the colorsex approach is the right one, and colorsex should initially be included as a main effect, because the smooths are centred for factor by variables (see e.g. ?gam.models). Whether you then choose to drop this main effect, as it appears to be non-significant, is a m

Re: [R] Using cumsum with 'group by' ?

2012-11-27 Thread peter dalgaard
On Nov 27, 2012, at 14:30 , TheRealJimShady wrote: > Thanks everyone for your help. All good now. Once I'd got the data I > ended up doing this (replaced with real column names rather than the > fakes before). > > microaeth_data$date<-as.Date(microaeth_data$date_time,format="%Y-%m-%d > %H:%M:%S"

[R] Concordant und Discordant Paars of Logistic Regression

2012-11-27 Thread Marcus Tullius
Hallo there, can anymore show me how to get results about konkordant und diskordant paars (Sommer-D, Gudman-Krustal-Gama, Kendall-Tau-a) within a logistic regression) in R? Thanks a lot. MT [[alternative HTML version deleted]] __ R-help@r

Re: [R] R strange behaviour when building huge concatenation

2012-11-27 Thread Jagat.K.Sheth
You probably hit a buffer limit in X11/xterm on your ubuntu machine with copy and paste. I get that behavior with Putty using your vector or when pasting (long) commands into Putty. If you really prefer copy and paste for this vector then try something like > eval(parse(text=scan("clipboard",

Re: [R] Help with graphics in gamm4 library

2012-11-27 Thread MurphFL
Thank you so much! I really appreciate the rapid response, and I was able to solve my issues with this advice! -- View this message in context: http://r.789695.n4.nabble.com/Help-with-graphics-in-gamm4-library-tp4650908p4650993.html Sent from the R help mailing list archive at Nabble.com.

[R] Fitting and plotting a coxph with survfit, package(surv)

2012-11-27 Thread Maziar Mohaddes
Hi Dear R-users I have a database with 18000 observations and 20 variables. I am running cox regression on five variables and trying to use survfit to plot the survival based on a specific variable without success. Lets say I have the following coxph: >library(survival) >fit <- coxph(Surv(futime,

Re: [R] calling c function from R

2012-11-27 Thread Berend Hasselman
On 27-11-2012, at 17:21, Li Shangru wrote: > Hello > > I want to call C function from R. I follow the instruction below using the > example of foo.c > http://www.stat.umn.edu/~charlie/rc/ > > I saved the foo.c in my work directory. Then I entered the command > > R CMD SHLIB foo.c , I got the f

[R] loop command to matrix

2012-11-27 Thread eliza botto
Dear UseRs,Extremely sorry for a basic question. I have a matrix of 19 rows and 365 columns. what i want to do is the following...First i want to leave out column number 1 and want to calculate the row wise mean of the remaining columns, which will obviously give me 365 values in one column, an

Re: [R] R strange behaviour when building huge concatenation

2012-11-27 Thread Milan Bouchet-Valat
Le mardi 27 novembre 2012 à 07:04 -0800, angeloimm a écrit : > Hello John > It seems correct to me too but in my R console it seems to not be working > Here there is what I did: > i copied the statement on one row (leaving and removing the final useless > semi colomn) > i tried to execute it in the

Re: [R] aggregate() runs out of memory

2012-11-27 Thread Steve Lianoglou
Hi, On Tue, Nov 27, 2012 at 11:29 AM, Sam Steingold wrote: >> * Steve Lianoglou [2012-11-26 19:47:25 >> -0500]: [snip] >> It just occurred to me that this is even better: >> >> R> setkeyv(f, c("share.id", "delay")) >> R> result <- f[, list(min=delay[1L], max=delay[.N], count=.N, >> country=cou

[R] Some questions about chron package..

2012-11-27 Thread 박상규
Hello, I have questions while reviewing "chron" package(e.g.,chron.R). 1. What is the differences between 3 kinds of function definition ? 1) "name" <- function(... 2) 'name' <- function(... 3) name <- function(... Do you know Why author used various kinds of definitions ? Is there no fu

Re: [R] loop command to matrix

2012-11-27 Thread Rui Barradas
Hello, Try x <- matrix(1:18, ncol = 6) sapply(seq_len(ncol(x)), function(i) x[, i] - rowMeans(x[, -i])) Hope this helps, Rui Barradas Em 27-11-2012 17:51, eliza botto escreveu: Dear UseRs,Extremely sorry for a basic question. I have a matrix of 19 rows and 365 columns. what i want to do is

Re: [R] loop command to matrix

2012-11-27 Thread eliza botto
thanks rui!! how can it be that you advise something and it doesn't work :) eliza > Date: Tue, 27 Nov 2012 18:14:41 + > From: ruipbarra...@sapo.pt > To: eliza_bo...@hotmail.com > CC: r-help@r-project.org > Subject: Re: [R] loop command to matrix > > Hello, > > Try > > x <- matrix(1:18, n

Re: [R] loop with date

2012-11-27 Thread Tagmarie
Sorry again, project is part of the rgdal package. Tagmarie -- View this message in context: http://r.789695.n4.nabble.com/loop-with-date-tp4650961p4651005.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

Re: [R] loop command to matrix

2012-11-27 Thread arun
HI, May be this helps you: set.seed(5) mat1<-matrix(sample(1:400,80,replace=TRUE),ncol=8,nrow=10)  split(mat1,col(mat1)) t(do.call(rbind,lapply(lapply(split(mat1,col(mat1)),function(x) cbind(matrix(x,ncol=1),mat1)),function(x){ res1<-rowMeans(t(apply(x,1,function(x) x[!(duplicated(x)|duplicated(

Re: [R] aggregate() runs out of memory

2012-11-27 Thread Sam Steingold
> * Steve Lianoglou [2012-11-27 12:53:23 > -0500]: > On Tue, Nov 27, 2012 at 11:29 AM, Sam Steingold wrote: >>> * Steve Lianoglou [2012-11-26 19:47:25 >>> -0500]: > [snip] >>> It just occurred to me that this is even better: >>> >>> R> setkeyv(f, c("share.id", "delay")) >>> R> result <- f[, l

[R] GLM Coding Issue

2012-11-27 Thread Craig P O'Connell
Dear all,    I am having a recurring problem when I attempt to conduct a GLM.  Here is what I am attempting (with fake data): First, I created a txt file, changed the directory in R (to the proper folder containing the file) and loaded the file: #avoid<-read.table("avoid.txt",header=TRU

[R] Error: R could not find "listDescription"

2012-11-27 Thread Jack Bryan
Hi, I am running R on Win 7. I got error for > listDescription(fPortfolio) Error: could not find function "listDescription" What do I need to install for solving this ? Any help will be appreciated. Thanks [[alternative HTML version delet

[R] Books for fully understanding internal logics on some packages(quantmod, xts, zoo and chron)

2012-11-27 Thread 박상규
Hello, I'm very interested in using financial time series data, but I'm a beginner of R programming. I'd like to fully understand internal logics on several time-series related packages such as quantmod, xts, zoo, chron, etc. So, I read some books, 'R Cookbook' and 'Art of R Programming' and an

Re: [R] Error: R could not find "listDescription"

2012-11-27 Thread Rui Barradas
Hello, There are two packages with a function listDescription, package fBasics and package fUtilities. You probably need to install one of them, which I can tell. install.packages('fUtilities') # for instance, run this only once library(fUtilities) # load it into R session Hope this helps

Re: [R] Error: R could not find "listDescription"

2012-11-27 Thread Sarah Goslee
Where did you get the document that tells you to use that code? Does it also tell you to load particular packages? www.rseek.org turns up a listDescription() function in the fBasics package, but that isn't necessarily the one you need for whatever application you're pursuing. Sarah On Tue, Nov 2

Re: [R] Error: R could not find "listDescription"

2012-11-27 Thread Jack Bryan
Hi, Thanks for your reply. I am trying to run R 2.15.2 on Win 7. I am trying to run some example R code of the book :Portfolio Optimization with R/Rmetrics fPortfolio package is included in ebookPortfolio. >From the book, I was told that : To install all packages required for the exampl

Re: [R] binning by frequency

2012-11-27 Thread Santosh
Thanks for your response. Was wondering if there are any R functions/packages to perform optimal binning of continuous data. Thanks, again. Santosh. On Tue, Nov 27, 2012 at 9:09 AM, Mark Lamias wrote: > You might find the binning function in the sm package helpful here. > > --Mark Lamias > >

Re: [R] Some questions about chron package..

2012-11-27 Thread Rui Barradas
Hello, Inline. Em 27-11-2012 18:06, 박상규 escreveu: Hello, I have questions while reviewing "chron" package(e.g.,chron.R). 1. What is the differences between 3 kinds of function definition ? 1) "name" <- function(... 2) 'name' <- function(... 3) name <- function(... Do you know Why auth

Re: [R] Error: R could not find "listDescription"

2012-11-27 Thread Sarah Goslee
The website given no longer exists. The usual first approach is to contact the author of the books to ask if there's a new location. You could also try installing fPortfolio directly from CRAN: install.packages("fPortfolio") Sarah On Tue, Nov 27, 2012 at 2:57 PM, Jack Bryan wrote: > Hi, > > Th

Re: [R] Error: R could not find "listDescription"

2012-11-27 Thread Rui Barradas
Hello, Inline. Em 27-11-2012 19:44, Rui Barradas escreveu: Hello, There are two packages with a function listDescription, package fBasics and package fUtilities. You probably need to install one of them, which I can tell. Sorry, it's obviously "can't" Rui Barradas install.packages('fUtil

Re: [R] binning by frequency

2012-11-27 Thread William Dunlap
You might look at the 'mdlp' function in the 'discretization' package. (SPSS has a procedure called 'optimal binning' that uses the 'minimum description length principle' to do the binning.) Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun..

Re: [R] Error: R could not find "listDescription"

2012-11-27 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Sarah Goslee > Sent: Tuesday, November 27, 2012 12:10 PM > To: Jack Bryan > Cc: r help > Subject: Re: [R] Error: R could not find "listDescription" > > The website given no longe

Re: [R] Books for fully understanding internal logics on some packages(quantmod, xts, zoo and chron)

2012-11-27 Thread Patrick Burns
One place to look would be the archives of the r-sig-finance list. A blog post with suggestions on how to achieve that is: http://www.portfolioprobe.com/2012/01/19/how-to-search-the-r-sig-finance-archives/ Pat On 27/11/2012 19:41, 박상규 wrote: Hello, I'm very interested in using financial ti

Re: [R] problem with svyglm

2012-11-27 Thread Pablo Menese
I colud not, even without attach the dataset. The thing is, when I use this On Fri, Nov 23, 2012 at 5:56 PM, David Winsemius wrote: > > On Nov 23, 2012, at 12:08 PM, Pablo Menese wrote: > > I have this problem. >> >> test <- svydesign(id=~1,weights=~peso) >> >> logit <- svyglm(bach ~ job2 +

Re: [R] problem with svyglm

2012-11-27 Thread Pablo Menese
Sorry, it send it alone... When I use it: logit <- glm(bach ~ egp4 + programa, weight=wst7, family=quasibinomial(link"logit")) I reach the same betas that in STATA, but the hypothesis test, the t value, and the std. error is different. I think that the solution can't be so far from this...

Re: [R] Problems with weight

2012-11-27 Thread Pablo Menese
I can't ... I don't know why but I can't When I use it: logit <- glm(bach ~ egp4 + programa, weight=wst7, family=quasibinomial(link"logit")) I reach the same betas that in STATA, but the hypothesis test, the t value, and the std. error is different. I think that the solution can't be so far fro

Re: [R] Stuck trying to modify a function

2012-11-27 Thread Milan Bouchet-Valat
Le mardi 27 novembre 2012 à 16:45 +, Benjamin Ward (ENV) a écrit : > Hi, > > I have the following data: > > Path_Number <- 5 > ID.Path <- c(1:Path_Number) # Make vector of ID's. > No_of_X <- sample(50:550, length(ID.Path), replace=TRUE) # > X <- split(sample(1:1, sum(No_of_X), replace=TRU

Re: [R] Problems with weight

2012-11-27 Thread Milan Bouchet-Valat
Le mardi 27 novembre 2012 à 18:33 -0300, Pablo Menese a écrit : > I can't ... I don't know why but I can't > > When I use it: > > logit <- glm(bach ~ egp4 + programa, weight=wst7, > family=quasibinomial(link"logit")) You were advised to use svyglm(), not glm(). It's usually considered polite to r

Re: [R] Stuck trying to modify a function

2012-11-27 Thread Jean V Adams
Ben, You can use the sample() function to randomly add -1, 0, or 1 to each observation, and control for the probability of mutation at the same time. Then you can use the match() function to make sure that any mutations in X are carried through to Y in the same way. I wrote the function to do

Re: [R] Some questions about chron package..

2012-11-27 Thread Jeff Newmiller
1. I am not aware of a difference, and don't know why the various forms were used. 2. That handles identifying the correct function to call based on the types of arguments supplied when the function was called. Read about the S4 object-oriented programming features to learn about method dispatc

[R] Finding values in one column and

2012-11-27 Thread Steven Ranney
All - I have a data frame data.a ID valueA valueB 6 12 12 17 15 14 58 18 16 98 11 12 73 19 20 84 19 14 58 20 14 24 11 12 81 15 16 21 15 14 62 14 12 67 13 14 78 13

Re: [R] R strange behaviour when building huge concatenation

2012-11-27 Thread John Kane
I am currently getting the very strange results that if I paste your orginal data from your first message into my R terminal I get the same errors you do. By the way that ";" is not needed in R. If I paste the same data into Rstudo, either into the editor or the console it works fine. If I pa

Re: [R] Finding values in one column and

2012-11-27 Thread John Kane
Have a look at ?merge John Kane Kingston ON Canada > -Original Message- > From: steven.ran...@gmail.com > Sent: Tue, 27 Nov 2012 15:17:58 -0700 > To: r-help@r-project.org > Subject: [R] Finding values in one column and > > All - > > I have a data frame > > data.a > IDvalueA value

Re: [R] Finding values in one column and

2012-11-27 Thread Steven Ranney
Thanks. Soon after I posted this question, I discovered merge(). Steven H. Ranney On Tue, Nov 27, 2012 at 3:26 PM, John Kane wrote: > Have a look at ?merge > > John Kane > Kingston ON Canada > > >> -Original Message- >> From: steven.ran...@gmail.com >> Sent: Tue, 27 Nov 2012 15:17:58 -

Re: [R] GLM Coding Issue

2012-11-27 Thread Steve Lianoglou
Hi, Comments inline: On Tue, Nov 27, 2012 at 1:00 PM, Craig P O'Connell wrote: > > > Dear all, > >I am having a recurring problem when I attempt to conduct a GLM. Here is > what I am attempting (with fake data): > First, I created a txt file, changed the directory in R (to the proper folde

Re: [R] Finding values in one column and

2012-11-27 Thread arun
Hi, Try ?merge(), ?join() from library(plyr) data.a<-read.table(text=" ID    valueA    valueB 6    12    12 17    15    14 58    18    16 98    11    12 73    19    20 84    19    14 58    20    14 24    11    12 81    15    16 21    15    14 62    14    12 67    13    14 78    13    17 35    10   

Re: [R] Finding values in one column and

2012-11-27 Thread John Kane
Come to think of it the plyr package and the data.table packages also offer similar tools. For large merges (joins) I think the data.table package is much faster. John Kane Kingston ON Canada > -Original Message- > From: steven.ran...@gmail.com > Sent: Tue, 27 Nov 2012 15:28:57 -0700

[R] Plot from a jpeg

2012-11-27 Thread bgnumis
Hi all, I know that I can for instance draw to plots in one using nf<-layout(matrix(c(1,2),1,2,byrow=FALSE)) Imagine I have 3 files: plot1.jpeg plot2.jpeg plot3.jpeg Anyone knows if I can read them and put on one colum and three rows reading directly from the jpeg file? Many Thanks [

[R] For-loop,string variables, and the $-operator

2012-11-27 Thread Allan Schwade
Hi all, First time poster, so sorry if I commit some breech of posting etiquette. My problem is as follows. I have a data frame where each column represents a category and the individual data points in each category are binary responses (in this case they are actually 1's and 0's). What I want to

[R] CCA plot

2012-11-27 Thread Maria Kernecker
Hi, I have a couple questions about fitting environmental (land use factors, plant species presence-absence, and soil variables) constraints to my CCA biplot. 1. After successfully plotting species and site scores in my CCA, I have been trying to insert the biplot arrows of the environmental constr

[R] code optimisation problem

2012-11-27 Thread 47
I'd like to write a function that has a vector and a (pos.) number as inputs and returns what is on the picture below (arithmetic means of (k) consecutive elements of a given vector). The problem is it works too slow for long vectors and i know it can be done without "for" loop. However, i've got n

  1   2   >