Re: [R] Not able to convert data.frame to numeric properly

2014-04-08 Thread Frede Aakmann Tøgersen
Now we are able to help you. What you see is an artefact of an object in T of class 'factor' > ## So please, see ?factor > ## first 2 columns subset of a factor > str(a) 'data.frame': 1 obs. of 4 variables: $ GHP: Factor w/ 51 levels "0.0944","0.1446",..: 33 $ GP : Factor w/ 51 levels "0.1

Re: [R] moses extreme reaction test

2014-04-08 Thread Berend Hasselman
On 09-04-2014, at 00:56, David Winsemius wrote: > > On Apr 8, 2014, at 2:41 PM, Bert Gunter wrote: > >> Just for the fun of it, I searched for "R package moses extreme >> reaction test" on google. The 8th hit was the package DescTools, but >> that included the 3 earlier hits and responses fro

Re: [R] Not able to convert data.frame to numeric properly

2014-04-08 Thread Sachinthaka Abeywardana
a is ofcourse a subset of data.frame, a ROW of the original table specifically. > str(a) 'data.frame': 1 obs. of 4 variables: $ GHP: Factor w/ 51 levels "0.0944","0.1446",..: 33 $ GP : Factor w/ 51 levels "0.1755","0.3582",..: 29 $ T : num 2.9 $ Tn : num 3.3 > dput(a) structure(list(GHP = st

Re: [R] Not able to convert data.frame to numeric properly

2014-04-08 Thread Frede Aakmann Tøgersen
We can't say because we don't know how a was created. Please email the output from str(a) and dput(a) Yours sincerely / Med venlig hilsen Frede Aakmann Tøgersen Specialist, M.Sc., Ph.D. Plant Performance & Modeling Technology & Service Solutions T +45 9730 5135 M +45 2547 6050 fr...@vest

[R] Not able to convert data.frame to numeric properly

2014-04-08 Thread Sachinthaka Abeywardana
I have the following: >a #note that the 28 is a row.name GHP GP T Tn 28 2.2194 2.6561 2.9007 3.2988 >min(as.numeric(a)) 2.9007 >min(as.numeric(as.character(a))) 2.9007 >as.numeric(as.character(a)) #What's going on here??? [1] 33. 29. 2.9007 3.298

Re: [R] Plotting does odd line thing

2014-04-08 Thread Frede Aakmann Tøgersen
See ? plot.default. Add the log = "y" to your call. Remember to set ylim to positive values since log only takes positive values, e.g. ylim = c(1e-6, 0.1). Yours sincerely / Med venlig hilsen Frede Aakmann Tøgersen Specialist, M.Sc., Ph.D. Plant Performance & Modeling Technology & Service Solu

Re: [R] Pull Stock Symbol Out of String

2014-04-08 Thread arun
Hi, You may try: library(qdap) str1 <- c("American Tower Corporation (REIT) (AMT)", "Aetna Inc. (AET)") unlist(lapply(bracketXtract(str1,"round"),tail,1),use.names=F) #[1] "AMT" "AET" A.K. On Tuesday, April 8, 2014 7:48 PM, "Sparks, John James" wrote: Dear R Helpers, My regex skills are beg

Re: [R] Label axis tick marks with a simple function of axis value

2014-04-08 Thread Hurr
This still puts tick marks at data points: h=c(1,2,3,4,5,6,7,8,9) v=c(9,8,7,6,5,4,3,2,1) plot(h,v,xaxt='n') x<-c(1.6,2.6,6.6,9.6,12.9) axis_labels<-1/pretty(x) axis(1,at=pretty(x),labels=axis_labels) How do I get the axis to approx 13 ? -- View this message in context: http://r.789695.n4.nabb

Re: [R] getting arg names in function calls?

2014-04-08 Thread William Dunlap
> I don't see how that solves > the example I gave of extracting "plot(x=0, y=1)" from tstFn <- > function()plot(0, 1). Try > match.call(definition=plot, call=body(tstFn)) plot(x = 0, y = 1) plot() is not a great example, since some of its methods do not have an argument called 'y' (e.g.,

Re: [R] getting arg names in function calls?

2014-04-08 Thread Hadley Wickham
You might find it helpful to read http://adv-r.had.co.nz/Expressions.html, and look at pryr:: standardise_call(). Hadley On Tue, Apr 8, 2014 at 6:52 PM, Spencer Graves wrote: > Hi, Bill: > > > Thanks for the reply. Unfortunately, I don't see how that solves the > example I gave of extract

Re: [R] moses extreme reaction test

2014-04-08 Thread Spencer Graves
On 4/8/2014 3:56 PM, David Winsemius wrote: On Apr 8, 2014, at 2:41 PM, Bert Gunter wrote: Just for the fun of it, I searched for "R package moses extreme reaction test" on google. The 8th hit was the package DescTools, but that included the 3 earlier hits and responses from r-help. So I gues

Re: [R] getting arg names in function calls?

2014-04-08 Thread Spencer Graves
Hi, Bill: Thanks for the reply. Unfortunately, I don't see how that solves the example I gave of extracting "plot(x=0, y=1)" from tstFn <- function()plot(0, 1). As I noted, body(tstFn) returns "plot(0, 1)" as an "language" object of class "call". My challenge is to convert th

Re: [R] browser always enters debug mode

2014-04-08 Thread Duncan Murdoch
On 08/04/2014, 6:05 PM, Paul Murtaugh wrote: It appears to be a difference between versions 2.* and 3.* in the way that a newline ('enter') is handled at the browser prompt. Formerly, it would continue execution of the function; now it kicks you into debugging mode. To get the old behavior, you

Re: [R] moses extreme reaction test

2014-04-08 Thread David Winsemius
On Apr 8, 2014, at 2:41 PM, Bert Gunter wrote: > Just for the fun of it, I searched for "R package moses extreme > reaction test" on google. The 8th hit was the package DescTools, but > that included the 3 earlier hits and responses from r-help. > > So I guess the point is that "Learn to Search

Re: [R] browser always enters debug mode

2014-04-08 Thread Paul Murtaugh
It appears to be a difference between versions 2.* and 3.* in the way that a newline ('enter') is handled at the browser prompt. Formerly, it would continue execution of the function; now it kicks you into debugging mode. To get the old behavior, you need to enter 'c' at the browser prompt.

[R] rJava not loading on Windows

2014-04-08 Thread Kishan Lachhani
I also have this problem, did you find a solution? [[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.htm

Re: [R] Label axis tick marks with a simple function of axis value

2014-04-08 Thread Jim Lemon
On 04/09/2014 02:06 AM, Hurr wrote: Don suggested something like this: h=c(1,2,3,4,5,6,7,8,9) v=c(9,8,7,6,5,4,3,2,1) plot(h,v,xaxt='n') xat=pretty(h) axis(1,at=xat,labels=1/xat) But it puts the tick marks at the data-x-locations. If the tick locations are not automatic or automatically separate f

Re: [R] xts Annual series

2014-04-08 Thread Michael Weylandt
On Apr 8, 2014, at 17:32, John Laing wrote: > > That doesn't feel very eXtensible to me. > xts is quite obviously past tense. ;-) The list of allowable index classes is found in is.timeBased IIRC and the exclusion of integers is because there's no obvious way to have them play nice with o

Re: [R] Pull Stock Symbol Out of String

2014-04-08 Thread Boris Steipe
You could try: # Use ?regexec and ?regmatches to return a list of grouped matches. # Use \\( and \\) to match literal parentheses. # Use ... to match three characters. # Use $ to match at end of string. s1 <- "American Tower Corporation (REIT) (AMT)" s2 <- "Aetna Inc. (AET)" getSym <- function

Re: [R] moses extreme reaction test

2014-04-08 Thread Bert Gunter
Just for the fun of it, I searched for "R package moses extreme reaction test" on google. The 8th hit was the package DescTools, but that included the 3 earlier hits and responses from r-help. So I guess the point is that "Learn to Search" may even be a bit over the top -- is there anyone on the

Re: [R] xts Annual series

2014-04-08 Thread John Laing
At first pass it would seem that 'integer' would make a perfectly fine year class. But for some reason it's disallowed: > xts(rnorm(8), 2000L:2007) Error in xts(rnorm(8), 2000L:2007) : order.by requires an appropriate time-based object Which is a bit unexpected, since xts descends from zoo and

Re: [R] browser always enters debug mode

2014-04-08 Thread Duncan Murdoch
On 08/04/2014 3:34 PM, Paul Murtaugh wrote: This is something peculiar about the environment on one particular linux box, because it doesn't happen on other computers. Whenever I invoke browser() inside a function, it automatically enters debugging mode, with line-by-line execution of code: >

Re: [R] xts Annual series

2014-04-08 Thread Michael Weylandt
On Apr 8, 2014, at 15:15, Erin Hodgess wrote: > Hello! > > If I have the following: > > x <- as.yearqtr(2000 + seq(0,7)/4) > x > [1] "2000 Q1" "2000 Q2" ... > > which is as it should be. > Then if I set up time as > time <- xts(1:8,x) > time > 2000 Q1 1 > 2000 Q2 2 > 2000 Q3 3 > . > . >

Re: [R] Need to download this data... can someone help?

2014-04-08 Thread Rui Barradas
Hello, Try the following. library(XML) URL <- "http://www.cmegroup.com/trading/interest-rates/stir/eurodollar_quotes_openOutcry.html"; dat <- readHTMLTable(readLines(URL), which=1, header=TRUE, na.strings = "-") str(dat) dat[4:10] <- lapply(dat[4:10], function(x) as.numeric(as.character(x)))

[R] browser always enters debug mode

2014-04-08 Thread Paul Murtaugh
This is something peculiar about the environment on one particular linux box, because it doesn't happen on other computers. Whenever I invoke browser() inside a function, it automatically enters debugging mode, with line-by-line execution of code: > dum <- function() { browser(); x <- rnorm(1

[R] Need to download this data... can someone help?

2014-04-08 Thread Christofer Bogaso
Hi again, I am looking some way to download this data: http://www.cmegroup.com/trading/interest-rates/stir/eurodollar_quotes_openOutcry.html So far I have tried following code: library(XML) data <- xmlParse(" http://www.cmegroup.com/trading/interest-rates/stir/eurodollar_quotes_openOutcry.html

Re: [R] moses extreme reaction test

2014-04-08 Thread Boris Steipe
Typo: "DescTools" ? On 2014-04-08, at 3:13 PM, José Trujillo wrote: > What's the problem with this:? > > package ‘DscTools’ is not available (for R version 3.1.0 beta) > > > > El 08/04/14 19:42, Marc Schwartz escribió: >> On Apr 8, 2014, at 12:37 PM, José Trujillo Carmona wrote: >> >>> Is

[R] xts Annual series

2014-04-08 Thread Erin Hodgess
Hello! If I have the following: x <- as.yearqtr(2000 + seq(0,7)/4) x [1] "2000 Q1" "2000 Q2" ... which is as it should be. Then if I set up time as time <- xts(1:8,x) time 2000 Q1 1 2000 Q2 2 2000 Q3 3 . . Also fine Now suppose I want to have an annual xts object. How do I go about settin

Re: [R] moses extreme reaction test

2014-04-08 Thread José Trujillo
What's the problem with this:? package ‘DscTools’ is not available (for R version 3.1.0 beta) El 08/04/14 19:42, Marc Schwartz escribió: On Apr 8, 2014, at 12:37 PM, José Trujillo Carmona wrote: Is there a package that contains "moses extreme reaction test"? Thank's A search using rseek

Re: [R] moses extreme reaction test

2014-04-08 Thread José Trujillo
Very useful. Very Thanks. El 08/04/14 19:43, David Winsemius escribió: On Apr 8, 2014, at 10:37 AM, José Trujillo Carmona wrote: Is there a package that contains "moses extreme reaction test"? Learn to search. install.packages("sos") library(sos) findFn("moses extreme") found 5 matches;

Re: [R] Pull Stock Symbol Out of String

2014-04-08 Thread William Dunlap
The following gets the last parenthesized sequence of non-parentheses > sub(".*(\\([^()]+\\))([^()]*)$", "\\1", c("Aetna(AET)", "American Tower Corp(REIT)(ATC)", "No Parens", "Qwerty Corp (ASD)(ZXC)(123) extra stuff")) [1] "(AET)" "(ATC)"

[R] ggplot2 and geom_tile

2014-04-08 Thread Øystein Godøy
Dear community, I have been using ggplot2 for visualisation and I am really impressed by this. I do however have a problem that returns when plotting various types of spatial datasets as raster images. This is probably due to me not fully understanding the package. When I am plotting images us

[R] Pull Stock Symbol Out of String

2014-04-08 Thread Sparks, John James
Dear R Helpers, My regex skills are beginner to intermediate and banging around the web has not resulted in a solution to the problem below so I hope that one of you who has mad skills can help me out. I want to extract the stock ticker--AMT-- out of the string American Tower Corporation (REIT)Â

Re: [R] Ignore escape characters in a string...

2014-04-08 Thread Jeff Newmiller
What is wrong with winpath <- readLines("clipboard ") ? If you want to show that as a literal in your code, then don't bother assigning it to a variable, but let it echo to output and copy THAT and put it in your source code. There is also file.choose()... ---

Re: [R] moses extreme reaction test

2014-04-08 Thread David Winsemius
On Apr 8, 2014, at 10:37 AM, José Trujillo Carmona wrote: > Is there a package that contains "moses extreme reaction test"? Learn to search. install.packages("sos") library(sos) findFn("moses extreme") found 5 matches; retrieving 1 page Downloaded 3 links in 1 packages -- David Winsemius

Re: [R] moses extreme reaction test

2014-04-08 Thread Marc Schwartz
On Apr 8, 2014, at 12:37 PM, José Trujillo Carmona wrote: > Is there a package that contains "moses extreme reaction test"? > > Thank's A search using rseek.org indicates that the DescTools package on CRAN contains a function called MosesTest() that appears to implement it. http://cran.

[R] moses extreme reaction test

2014-04-08 Thread José Trujillo Carmona
Is there a package that contains "moses extreme reaction test"? Thank's __ 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

Re: [R] Error logistic analysis

2014-04-08 Thread Marc Schwartz
On Apr 8, 2014, at 7:20 AM, lghansse wrote: > I'm trying to conduct a single level logistic analysis (as a beginning step > for a more advanced Multi-level analysis). However, when I try to run it, I > get following error: > > Warning messages: > 1: In model.response(mf, "numeric") : > using t

[R] Error logistic analysis

2014-04-08 Thread lghansse
I'm trying to conduct a single level logistic analysis (as a beginning step for a more advanced Multi-level analysis). However, when I try to run it, I get following error: Warning messages: 1: In model.response(mf, "numeric") : using type = "numeric" with a factor response will be ignored 2: In

Re: [R] Splitting columns and forming new data files in R

2014-04-08 Thread arun
Hi, Try: #Tmin,Tmax,Tmean,Precip #"Tmean" -999.9 in all files #working directory is "sample" #created folder "final" list.files() #[1] "coordinates.csv" "final" "Precip" "Tmax " #[5] "Tmin" Coord <- read.csv(list.files(pattern=".csv"),header=TRUE,stringsAsFactors=F

[R] Meta-analysis of prevalence at the country level with mgcv/gamm4

2014-04-08 Thread Julien Riou
Dear R community, I'm working on a meta-analysis of prevalence data. The aim is to get estimates of prevalence at the country level. The main issue is that the disease is highly correlated with age, and the sample ages of included studies are highly heterogeneous. Only median age is available for

Re: [R] locating a data value in 3-dimensional data set

2014-04-08 Thread mamuash bukana
Many thanks to you all; specially to Frede. which(3ddata$variablename>=x,arr.ind=TRUE) answers my question perfectly. Cheers! Bukana On Tue, Apr 8, 2014 at 11:33 AM, Frede Aakmann Tøgersen wrote: > Hi > > I know there is a arr.index (or something like that, I'm not near my R > right now) argum

Re: [R] Plotting does odd line thing

2014-04-08 Thread David Doyle
THANK you for the help!! One more question. Being I need to compare 4 different wells, I like to have them all at the same scale which I can do with the ylim=c(min,max). But so the low concentrations don't get washed out, I like to plot the y axis in log format. ie 0.001, 0.010, 0.100. Below

Re: [R] Ignore escape characters in a string...

2014-04-08 Thread Frede Aakmann Tøgersen
Thank you Barry, this explains some of the things going on on the different platforms. One of my colleague told me some time ago that in C#/.NET they have this "raw string" functionality as you call it. However there they use @ and not r. That could be a nice thing to have in R. Yours sincerely

Re: [R] Label axis tick marks with a simple function of axis value

2014-04-08 Thread Hurr
Don suggested something like this: h=c(1,2,3,4,5,6,7,8,9) v=c(9,8,7,6,5,4,3,2,1) plot(h,v,xaxt='n') xat=pretty(h) axis(1,at=xat,labels=1/xat) But it puts the tick marks at the data-x-locations. If the tick locations are not automatic or automatically separate from the data locations, then I want to

Re: [R] Ignore escape characters in a string...

2014-04-08 Thread Barry Rowlingson
On Tue, Apr 8, 2014 at 4:30 PM, Frede Aakmann Tøgersen wrote: > > I'm a bit surprised about the \\ on a linux OS. I'm also surprised that in > a file manager on Windows you can paste e.g. C:/users/frtog/Desktop and it > can find its way to the folder. Weird. > > Well, the clipboard contained a pa

Re: [R] Ignore escape characters in a string...

2014-04-08 Thread Rui Barradas
Hello, There is support for the clipboard on Windows 7. Also, note that on Windows your solution leaves a connection open so maybe the following is better. # copy the next line C:\Program Files\R\R-3.0.3 clipb <- file("clipboard") winpath <- readLines(clipb) close(clipb) And, just to avoid

Re: [R] Ignore escape characters in a string...

2014-04-08 Thread Frede Aakmann Tøgersen
Yes R on Windows have something like that you mentioned. I have only tried it in conjunction with read.table. I'm a bit surprised about the \\ on a linux OS. I'm also surprised that in a file manager on Windows you can paste e.g. C:/users/frtog/Desktop and it can find its way to the folder. Wei

Re: [R] Ignore escape characters in a string...

2014-04-08 Thread Barry Rowlingson
On Tue, Apr 8, 2014 at 4:00 PM, Jonathan Greenberg wrote: > C:\Program Files\R\R-3.0.3 Does R on windows have clipboard support? I can do this on Linux: > readLines(file("clipboard")) [1] "C:\\Program Files\\R\\R-3.0.3" - that's from a copy of a path with only single slashes in. But help(conn

[R] Ignore escape characters in a string...

2014-04-08 Thread Jonathan Greenberg
R-helpers: One of the minor irritations I have is copying paths from Windows explorer, which look like: C:\Program Files\R\R-3.0.3 and using them in a setwd() statement, since the "\" is, of course, interpreted as an escape character. I have to, at present, manually add in the double slashes or

Re: [R] locating a data value in 3-dimensional data set

2014-04-08 Thread Frede Aakmann Tøgersen
Sorry forgot to mention that you probably are better of using <= and >= instead of == Br. Frede Sendt fra Samsung mobil Oprindelig meddelelse Fra: mamuash bukana Dato:08/04/2014 15.51 (GMT+01:00) Til: r-help@r-project.org Emne: [R] locating a data value in 3-dimensional data

Re: [R] locating a data value in 3-dimensional data set

2014-04-08 Thread Frede Aakmann Tøgersen
Hi I know there is a arr.index (or something like that, I'm not near my R right now) argument to which (). I have used it for 2-dim arrays and never for higher dimensions. But try it out by setting the argument to TRUE. Br. Frede Sendt fra Samsung mobil Oprindelig meddelelse -

Re: [R] locating a data value in 3-dimensional data set

2014-04-08 Thread Kehl Dániel
Dear Mamuash Bukana, is this a data frame with variable names you indicated? you will need something like which(dataframename$variablename == x) but if you have more you might use > HTH kd Feladó: r-help-boun...@r-project.org [r-help-boun...@r-project.or

Re: [R] locating a data value in 3-dimensional data set

2014-04-08 Thread S Ellison
> I tried: > which(3ddata==x) # 3ddata is name of data set, x is the observed extreme > value But this couldn't help me. You'll need which(3ddata$long==x) if 3ddata is a data frame* with columns long, lat, time, or something like 3ddata[ ,'long'] if it's a matrix with dimnames or [,1] if just a

[R] locating a data value in 3-dimensional data set

2014-04-08 Thread mamuash bukana
I have a 3-dimentional data set with dimensions "longitude", "latitude", and "time". Unfortunately, when I look at the range of values in the data set, I noticed some very extremely large(positive and negative) values which are unexpected to be there. So I wanted to point-out the location (lon, lat

Re: [R] What Directs R to Executable Directory? [RESOLVED]

2014-04-08 Thread Rich Shepard
On Mon, 7 Apr 2014, Rich Shepard wrote: However, when I try to start R as either a user or as root it aborts because it cannot find /usr/local/bin/R. When I stepped back from the problem, but shutting down the laptop for the evening, it occurred to me that the system needed to be rebooted to

Re: [R] Time interactions for coxph object

2014-04-08 Thread Therneau, Terry M., Ph.D.
The very first step is to understand the possible nature of proportional hazards. This is parallel to the usual advice in linear models to graph the data before you start fitting complicated non-linear models. zp <- cox.zph(CSHR.shore.fly, transform="identity") plot(zp)# or plot(zp[3]) f

Re: [R] rpart and randomforest results

2014-04-08 Thread John Maindonald
The function rpart may well overfit if the value of the CP statistic is left at its default. Use the functions printcp() and plotcP() to check how the cross-validation estimate of relative ‘error’ (xerror) changes with the number of splits (NB that the CP that leads to a further split changes mono

Re: [R] {metafor} variance explaination for paired pre-test/posttest

2014-04-08 Thread John Williams
Prof. Viechtbauer, thanks for the articles. I appreciate your help. Yours, John John Williams ALB Candidate, Harvard University (Expected May 2014) johnwilli...@fas.harvard.edu jawilliam...@gmail.com -- View this message in context: http://r.789695.n4.nabble.com/metafor-variance-ex

Re: [R] {metafor} variance explaination for paired pre-test/posttest

2014-04-08 Thread Viechtbauer Wolfgang (STAT)
The standardized mean change using 'change score standardization' is described in this article: Gibbons, R. D., Hedeker, D. R., & Davis, J. M. (1993). Estimation of effect size from a series of experiments involving paired comparisons. Journal of Educational Statistics, 18(3), 271-279. For a c

Re: [R] Issues with fa() function in "psych"

2014-04-08 Thread Pascal Oettli
Hello, And what about submitting your suggestions directly to the package author/maintainer? And please don't post in HTML. Regards, Pascal On Tue, Apr 8, 2014 at 3:13 PM, sagnik chakravarty wrote: > Hi Team, > > I was using your "psych" package for factor analysis and was also comparing > the