Re: [R] Calculate Range

2013-11-16 Thread Jim Lemon
On 11/17/2013 08:49 AM, SCRIPTHAM wrote: Hi My R version is the current version as at 15 Nov 2013. I have tried to calculate range using tapply() with FUN=range. tapply() returns two fields, the ID field and a field of two text items one is the maximum and the other is the minimum. I take as th

Re: [R] The smallest enclosing ball problem

2013-11-16 Thread Berend Hasselman
Forgot to forward my answer to R-help. Berend On 16-11-2013, at 13:11, Hans W.Borchers wrote: > I wanted to solve the following geometric optimization problem, sometimes > called the "enclosing ball problem": > > Given a set P = {p_1, ..., p_n} of n points in R^d, find a point p_0 such >

Re: [R] r documentation rugarch egarch

2013-11-16 Thread Jeff Newmiller
You don't seem to read very well. The rugarch vignette that you said you read clearly states that questions on that package should be directed to the R-sig-finance mailing list. This is not that list. Before you go deliver this screed to that forum, you may want to give yourself some time to co

Re: [R] order() function, decreasing=TRUE unexpected behaviour

2013-11-16 Thread Jeff Newmiller
I think you are confused, and there is no problem with the order function. Keep in mind that order returns the index values in a sequence such that when the result of the order function is used as indexes for the original sequence then the data will be sorted as desired. You may see the error of

Re: [R] R for a stats intro for undergrads in the US?

2013-11-16 Thread Spencer Graves
Hi, Umair Durrani: Thanks very much for the quick reply. The course you mentioned does not feature "psychology", that I could see. However, my friend might be able to use pieces of that course in hers. Thanks again. Spencer On 11/16/2013 7:58 PM, umair durrani wrote: >

Re: [R] R for a stats intro for undergrads in the US?

2013-11-16 Thread umair durrani
Hi Spencer, I would definitely recommend R for introductory stats. course because it is free and easy to learn. You can visit www.twotorials.com for two-minute tutorials on R. Also www.coursera.org offers many free courses on R, for intro stats check this out: https://www.coursera.org/course/sta

[R] R for a stats intro for undergrads in the US?

2013-11-16 Thread Spencer Graves
Hello, All: Would anyone recommend R for an introductory statistics class for freshman psychology students in the US? If yes, might there be any notes for such available? I just checked r-projects.org and CRAN contributed documentation and found nothing. I have a frie

[R] selecting optimal cluster validation score

2013-11-16 Thread email
Hi: I have calculated the Silhouette score and Dunn score after hierarchical clustering for 3 clusters: #Distance measure d <- dist(USArrests, method = "euclidean") #Hierarchical clustering hc <- hclust(dist(USArrests), "ave") #calculating silhouette value for 3 clusters sil<- silhouette(cutree(h

[R] r documentation rugarch egarch

2013-11-16 Thread randomsamson
Hi, I`m about to switch from STATA to R and have serious troubles to find proper documentations on the internet. Right now I try to find a proper documentation of the eGARCH model being part of the rugarch package. Neither here http://cran.r-project.org/web/packages/rugarch/vignettes/Introduction

[R] order() function, decreasing=TRUE unexpected behaviour

2013-11-16 Thread Hawthorne Beyer
There appears to be an issue with the decreasing=TRUE option on the order() function that indicates either a bug or perhaps a design flaw (potentially flawed because I would suggest the majority of users would expect different behaviour). # demonstration of problem: x <- c(2,1,3,4,5) order(x) o

Re: [R] Apply function to one specific column / Alternative to for loop

2013-11-16 Thread arun
Hi, Try: indx <- grep("Test",test_df[,1])  ##assuming that there is some pattern  res <- within(test_df[-indx,],titel <- rep(test_df$titel[indx], diff(c(indx,nrow(test_df)+1))-1)) ## If you need to change the class res[] <- lapply(res,function(x) if(any(grepl("[[:alpha:]]",x))) as.character(x)

[R] Calculate Range

2013-11-16 Thread SCRIPTHAM
Hi My R version is the current version as at 15 Nov 2013. I have tried to calculate range using tapply() with FUN=range. tapply() returns two fields, the ID field and a field of two text items one is the maximum and the other is the minimum. I take as the difference max - min, does R use a differ

Re: [R] Bug in predict.lm?

2013-11-16 Thread jlh.membership
This definitely looks like a bug and should really be reported. Denes' diagnosis is right on. I get the bug here: > z <- lm(rnorm(10)~I(1:10)) > > predict(z, int="conf", scale=1) Error in predict.lm(z, int = "conf", scale = 1) : object 'w' not found And also here: > z <- lm(rnorm(10)~I(1:10))

Re: [R] Apply function to one specific column / Alternative to for loop

2013-11-16 Thread umair durrani
This might be of some use : http://nsaunders.wordpress.com/2010/08/20/a-brief-introduction-to-apply-in-r/ Umair Durrani email: umairdurr...@outlook.com > Date: Sat, 16 Nov 2013 07:30:29 -0800 > From: ron...@gmx.net > To: r-help@r-project.org > Subject: [R] Apply function to one specific column

Re: [R] 2SLS for panel data, re

2013-11-16 Thread Phdstudent2
Hi Millo Giovanni, Thanks for your response. In regards to my STATA code it would be: xi:xtiverg wecon polrightsreversed lnrgdpch execleft mulim2 c100rat c1100rat i.year (trade fdistockgdp = lnpop lnarea devcountrycomlanguage bitcum), re. Any suggestions will help so much.. Regards On

[R] repeated-measures multiple regression/ANCOVA/MANCOVA

2013-11-16 Thread Jakub Szewczyk
Dear List, I am trying to analyze a dataset where I have 1 continuous between-item variable (C), and 2 factorial within-item variables (3- and 2-level: F3, F2). I'm interested in whether slope of C is different from 0 at different combinations of F3 and F2, and whether it varies between these comb

Re: [R] Change date time to epoch time

2013-11-16 Thread Jeff Newmiller
There are many epochs. Which one are you interested in? If you are interested in the POSIX time_t epoch, then you could look at ?DateTimeClasses to find out about ?as.POSIXct. You might also find my email on inputting zones informative [1]. Also, per the Posting Guide, please don't post in html

Re: [R] Change date time to epoch time

2013-11-16 Thread David Winsemius
On Nov 16, 2013, at 8:46 PM, vivek kumar singh wrote: Hi All, I have time series data in (Year-month-date-hour-minute-second) format and i want to convert it to epoch time. I have tried the following: *> Sys.time()** **[1] "2013-11-17 10:39:46 MYT"** **> as.numeric(Sys.time())** **[1] 1384656

[R] Change date time to epoch time

2013-11-16 Thread vivek kumar singh
Hi All, I have time series data in (Year-month-date-hour-minute-second) format and i want to convert it to epoch time. I have tried the following: *> Sys.time()** **[1] "2013-11-17 10:39:46 MYT"** **> as.numeric(Sys.time())** **[1] 1384656006** **> as.numeric("2013-11-17 10:39:46 MYT")** **[1] N

Re: [R] optimization

2013-11-16 Thread Rolf Turner
On 11/17/13 11:49, Dennis Murphy wrote: There are lots of errors in your code. In particular, the optimization routines do not like functions that ignore the parameters. I would like to nominate this delicious riposte as a fortune candidate. Anyone to second the motion? Indeed. I so second!

Re: [R] optimization

2013-11-16 Thread Dennis Murphy
> There are lots of errors in your code. In particular, the optimization > routines do not like functions that ignore the parameters. I would like to nominate this delicious riposte as a fortune candidate. Anyone to second the motion? Dennis On Sat, Nov 16, 2013 at 1:26 PM, Prof J C Nash (U30A)

Re: [R] optimization

2013-11-16 Thread Prof J C Nash (U30A)
There are lots of errors in your code. In particular, the optimization routines do not like functions that ignore the parameters. And you have not provided out or out1 to the optimizer -- they are returned as elements of func(), but not correctly. Please try some of the examples for optim or opti

Re: [R] contour plot axis correspondence

2013-11-16 Thread William Dunlap
filled.contour() makes two plots (the contour plot and the legend) and must adjust some par() parameters to do that. It appears to set them back to a state where you cannot easily add things to the plot. There is a trick mentioned in Stackoverflow a while back about how to use the plot.title argu

[R] contour plot axis correspondence

2013-11-16 Thread ivo welch
I am struggling with a contour plot. I want to place a cross over the minimum. alas, I don't seem to be able to map axes appropriately. here is what I mean: N <- 1000 rm <- rnorm(N, mean=0.0, sd=0.4) rx <- rnorm(N, mean=0.0, sd=0.4) rt <- rnorm(N, mean=0.0, sd=0.4) exploss <- function(hdgM,hdg

Re: [R] export vector with write() introduces line breaks

2013-11-16 Thread Bert Gunter
1. Read ?write carefully. Note what it says about write() writing to columns and the link to cat(). 2. Use cat() with appropriate arguments to write your file instead. e.g. cat(1:600, file=yourfile,fill=FALSE) Cheers, Bert On Sat, Nov 16, 2013 at 11:20 AM, Martin Batholdy wrote: > Hi, > > I h

[R] export vector with write() introduces line breaks

2013-11-16 Thread Martin Batholdy
Hi, I have a long vector which I want to export as a simple ascii text file via write(1:600, file='test.txt', sep=',') When I open the text file with my text editor I see that the data is structured in columns. So it seems that line breaks are introduced. How can I prevent this? Thank you! _

Re: [R] variable standardization in manova() call

2013-11-16 Thread Sergio Fonda
thank you for your reply. However, your remark was not so clear to me so I attach a short script I tried to launch. The comparison between results got from MANOVA() call with the non-standardized and standardized version of the same data frame, convinced me that it is not necessary to standardize

Re: [R] Double Pareto Log Normal Distribution DPLN

2013-11-16 Thread b. alzahrani
Guys Any help in this please. Regards Bander > On 14 Nov 2013, at 09:29 pm, "David R Forrest" wrote: > > Hi Bander, > > I'm pushing this discussion back to the list, because I'm not sure of the > shape/rate parameters for rpareto and rexp and how they'd be applied across > this mix of typo

Re: [R] there is no package called 'boot'

2013-11-16 Thread Uwe Ligges
On 14.10.2013 21:59, Christian Hoffmann wrote: Hi, R CMD mypackage /Users/hoffmann/R/cwhmisc check --as-cran gives me * checking Rd cross-references ... WARNING Error in find.package(package, lib.loc) : there is no package called 'boot' although there is no textual reference to 'boot'

Re: [R] R 2.14.2 - Installation problem - could not load lattice

2013-11-16 Thread Uwe Ligges
On 16.11.2013 09:36, Yael Inbar wrote: Hello, I'm new to R, and have a problem related to spss integration with R (but is actually related to the R installation): I have windows 8, 64bit, and installed R 2.14.2, and then the R plug in for spss (spss version 21). When I tried to run somthing in

[R] Apply function to one specific column / Alternative to for loop

2013-11-16 Thread Stageexp
Hi guys, I am a total newbie to R, so I hope this isn't a totally dumb question. I have a dataframe with a title in one row and the corresponding values in the next rows. Let's take this example: test_df <- data.frame(cbind(titel = "", x = 4:5, y = 1:2)) test_df = rbind(cbind(titel="1.Test", x=""

[R] R 2.14.2 - Installation problem - could not load lattice

2013-11-16 Thread Yael Inbar
Hello, I'm new to R, and have a problem related to spss integration with R (but is actually related to the R installation): I have windows 8, 64bit, and installed R 2.14.2, and then the R plug in for spss (spss version 21). When I tried to run somthing in spss, I got the following error messgae

Re: [R] Help

2013-11-16 Thread Bert Gunter
Sorry to do this to you, but questions about mixed models(especially lmer) are better handled on the mixed models list, r-sig-mixed-models . So subscribe and post this there. Cheers, Bert On Fri, Nov 15, 2013 at 3:30 PM, Dalal Hanna wrote: > Hi, > > I tried to post the below message and it was r

[R] The smallest enclosing ball problem

2013-11-16 Thread Hans W.Borchers
I wanted to solve the following geometric optimization problem, sometimes called the "enclosing ball problem": Given a set P = {p_1, ..., p_n} of n points in R^d, find a point p_0 such that max ||p_i - p_0|| is minimized. A known algorithm to solve this as a Qudratic Programming task is

Re: [R] Bug in predict.lm?

2013-11-16 Thread peter dalgaard
On 16 Nov 2013, at 03:06 , Charles Berry wrote: > Rolf Turner auckland.ac.nz> writes: > >> >> >> I *do* see the same phenomenon that Bert describes and the code of >> predict.lm() >> *does* appear to contain a bug. There is a line: >> > [snip] > >> >> The operative difference between my