Re: [R] Question

2018-04-19 Thread Keith Jewell
On 15/04/2018 17:26, Marc Girondot via R-help wrote: Le 15/04/2018 à 17:56, alireza daneshvar a écrit : break-down point Can you explain more what you plan to do and give an example of what you have tried to do until now to do a "break down point" in R. Perhaps a "break down point" is common

Re: [R] Problem with choose.files(default=..., multi=FALSE)

2017-05-10 Thread Keith Jewell
nally (Windows Server 2008 R2 x64) and also in Windows 10 x64 Keith Jewell On 09/05/2017 17:49, Duncan Murdoch wrote: On 09/05/2017 12:06 PM, Keith Jewell wrote: I'm very hesitant to suggest that there's a bug in such a venerable R function, but I can't see what I'm doin

[R] Problem with choose.files(default=..., multi=FALSE)

2017-05-09 Thread Keith Jewell
I'm very hesitant to suggest that there's a bug in such a venerable R function, but I can't see what I'm doing wrong. Any comments are welcome When using choose.files() where: default = something multi = FALSE selected file path is shorter than the default ... then the returned value

Re: [R] Antwort: Re: RStudio: Place for Storing Options

2017-02-23 Thread Keith Jewell
RStudio seems to not pay due regard to the distinction between APPDATA and LOCALAPPDATA. See https://support.rstudio.com/hc/en-us/community/posts/200650543-File-history-and-project-history-stored-in-LOCALAPPDATA On 23/02/2017 08:00, g.maub...@weinwolf.de wrote: Hi Martin, the command %loca

Re: [R] Strange message after reading multiple scripts from one folder

2016-07-29 Thread Keith Jewell
I can't immediately see it in the help text but it seems that source returns a list with two named elements; value and visible. I surmise that it is returned using withVisible (qv). KJ On 29/07/2016 13:26, jim holtman wrote: Hard to tell without seeing the scripts. Do you have a matrix in yo

Re: [R] [FORGED] Re: Generate list if sequence form two vector element

2016-06-22 Thread Keith Jewell
or as a one-liner mapply(pmin(a, b), pmax(a,b), FUN=seq, SIMPLIFY=FALSE) On 22/06/2016 10:23, peter dalgaard wrote: There's also mapply(a, b, FUN=seq, SIMPLIFY=FALSE) (turn off simplication so that you don't unexpectedly get a matrix whenever all elements of results have same length. This als

[R] expand.model.frame issue

2016-06-09 Thread Keith Jewell
Following on from a stackoverflow question "Why does this simple function calling `lm(..., subset)` fail?" -- myfun <- function(form., data., subs.) lm(form., data., subs.) myfun(mpg ~ cyl + hp, mtcars, TRUE) ## Error in eval(expr, envir, encl

Re: [R] formula argument evaluation

2016-04-12 Thread Keith Jewell
On 12/04/2016 11:24, Adrian Dușa wrote: I have a simple function such as: foo <- function(x) { call <- lapply(match.call(), deparse) testit <- capture.output(tryCatch(eval(x), error = function(e) e)) if (grepl("Error", testit)) { return(call$x) } } and I would like

Re: [R] Issue with results from 'summary' function in R

2015-09-18 Thread Keith Jewell
On 18/09/2015 13:08, Praveen Surendran wrote: Hi all, Attached table (that contains summary for a genetic association study) was read using the command: test <- read.table('testDat.txt',header=FALSE,stringsAsFactors=FALSE) Results from the summary of the attached table is provided below: su

[R] predict.poly for multivariate data

2015-07-10 Thread Keith Jewell
I've got the wrong end of the stick and/or my suggestions can be improved so I welcome correction. Otherwise, how do I go about getting these changes implemented? I see stats is maintained by R Core Team. Are they likely to pick it up from here, or do I need to take any othe

Re: [R] Problem with particular file in XML package?

2015-05-28 Thread Keith Jewell
The OP asked "Has anyone else had trouble with the XML package lately and if so, how did you resolve it?" For what it's worth... I failed to install XML using install() with the defaults; I can't remember the exact error message, something about access denied. Downloading XML_3.98-1.1.zip wi

Re: [R] rgl::writeWebGL( , prefix = , )

2015-02-03 Thread Keith Jewell
lt;http://cran.r-project.org/src/contrib/rgl_0.95.1201.tar.gz> [5] stringr_0.6.2 svSocket_0.9-55 TinnR_1.0-5 R2HTML_2.3.1 [9] Hmisc_3.12-2Formula_1.1-1 survival_2.37-7 loaded via a namespace (and not attached): [1] cluster_1.15.3 devtools_1.6.1

Re: [R] Is it possible to define another kind of NA

2014-11-13 Thread Keith Jewell
On 13/11/2014 11:08, Marc Girondot wrote: Le 13/11/2014 01:26, MacQueen, Don a écrit : Along the lines of what Bert Gunter said, the ideal way to represent I agree that LDL is a special case of what could be named ODL (Out of detection limit). To answer to Bert Gunter, indeed if LDL (or ODL) va

Re: [R] Is xyz point inside 3d convex hull?

2014-10-13 Thread Keith Jewell
Back in 2009 I posted some code to this list, see: I submitted the function 'inhull' to the geometry package maintainer, but I don't think it was ever included. HTH Keith J On 12/10/2014 21:24, Don McKenzie wrote: Check the R-news a

Re: [R] How to check to see if a variable is within a range of another variable

2014-10-02 Thread Keith Jewell
On 01/10/2014 23:54, Peter Alspach wrote: Tena koe Kate If kateDF is a data.frame with your data, then apply(kateDF, 1, function(x) isTRUE(all.equal(x[2], x[1], check.attributes = FALSE, tolerance=0.1))) comes close to (what I think) you want (but not to what you have illustrated in your 'ev

Re: [R] Windows R doesn't recognize shortcuts ?

2014-07-24 Thread Keith Jewell
On 23/07/2014 14:21, Duncan Murdoch wrote: On 23/07/2014 9:08 AM, ce wrote: Hi All, In Windows 7 , R installation: R version 3.1.1 Patched (2014-07-14 r66149) -- "Sock it to Me" Copyright (C) 2014 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit) it doesn't

Re: [R] Equation of a curve

2014-04-04 Thread Keith Jewell
On 03/04/2014 16:26, Frances Cheesman wrote: Hi all, I have a number of bacterial growth curves I would like to find the equations for these and then integrate them to find the area under the curves for me to do stats on later. Is there any way I can do this in R? Thanks, Frances [[a

Re: [R] A vector of normal distributed values with a sum-to-zero constraint

2014-04-01 Thread Keith Jewell
It seems so simple to me, that I must be missing something. Subject to Jeff Newmiller's reminder of FAQ 7.31; if the sum is zero then the mean is zero and vice versa. The OP's original attempt of: - l <- 100 aux <- rnorm(l,0,0.5) s <- sum(aux)/l aux2 <- aux-s sum(aux2)

Re: [R] princomp/prcomp packages not available for 3.0.2

2014-02-19 Thread Keith Jewell
On 19/02/2014 15:47, Rich Shepard wrote: Running 3.0.2 on Slackware here. Tried to install.packages() for both princomp and prcomp (Principal Components Analysis) but R responded by telling me neither is available for this version of R. Has anyone an idea when either (but especially prcomp

Re: [R] grep for multiple pattern?

2014-02-13 Thread Keith Jewell
On 13/02/2014 15:51, Marc Schwartz wrote: On Feb 13, 2014, at 8:43 AM, Rainer M Krug wrote: Hi I want to search for multiple pattern as grep is doing for a single pattern, but this obviously not work: grep("an", month.name) [1] 1 grep("em", month.name) [1] 9 11 12 grep("eb", month.nam

Re: [R] More Columns than column names Error

2013-10-22 Thread Keith Jewell
Carl is right. Going to the nabble post and looking in the source data file I see the headings row has 'Material' tab 'Weight...' tab 'Percent'. Each of the data rows has 1 tab character between the 'Material' and 'Weight' columns and 3

Re: [R] Problem with converting F to FALSE

2013-09-05 Thread Keith Jewell
Depending what you're doing with the data, you might want colClasses=c("factor","numeric") On 05/09/2013 13:58, Joshua Wiley wrote: Hi, You can either manually specify colClasses or the asis argument. See ?read.csv for more details. If you just had those two columns, something like:

Re: [R] XLSX package + Excel creation question

2013-09-04 Thread Keith Jewell
I'll skip over the courtesy implications of double posting/pointing to stackoverflow. The stackoverflow thread makes it look as if you need to learn more Excel. Do you really not know what an Excel template is? It sounds as if you want what Excel calls "conditional formatting" which you can

Re: [R] just a small variable-naming question

2013-08-27 Thread Keith Jewell
In case the OP wanted to append columns, rather than rename existing columns: cbind(myData, var1=NA, var2=NA, var3=NA) col1 col2 col3 var1 var2 var3 1123 NA NA NA 2234 NA NA NA 3345 NA NA NA On 24/08/2013 17:22, arun wrote: Hi, You could

Re: [R] nls: example code throws error

2013-04-26 Thread Keith Jewell
On 26/04/2013 00:16, Steven LeBlanc wrote: > Greets, > > I'm trying to learn to use nls and was running the example code for an exponential model: > > > > Perhaps also, a pointer to a comprehensive and correct document that details model formulae syntax if someone has one? > > Thanks& Best

Re: [R] approxfun values

2013-02-14 Thread Keith Jewell
Alternatively, with approx() use xout to specify which interpolated values you want returned: approx(dat, xout=dat$V1[is.na(dat$V2)]) KJ On 14/02/2013 11:43, Rui Barradas wrote: Hello, In what follows I've changed your df name to 'dat', to save some keystrokes. approxfun returns a function,

Re: [R] function coverage

2013-01-15 Thread Keith Jewell
On 14/01/2013 22:25, Hadley Wickham wrote: I think codetools could do this reasonably well with the walkCode function, but I've never done it so I don't have sample code, and walkCode is mostly an internal function. There are a couple of approaches here: http://stackoverflow.com/questions/14276

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] Mailing List

2012-09-05 Thread Keith Jewell
You might prefer to read list via the web or a news reader or an RSS feed, in which case http://dir.gmane.org/gmane.comp.lang.r.general might be helpful. Keith J On 05/09/2012 13:47, David Winsemius wrote: On Sep 5, 2012, at 3:00 AM, Marcus Tullius wrote: Hello there, is there a way I can

Re: [R] Tendonitis and R users

2012-09-04 Thread Keith Jewell
When I suffered from wrist pain I found changing from a standard mouse to a cordless trackball gave rapid and complete relief. Your mileage may vary. Keith J I think I've avoided tendonitis by carefully stretching the affected area when I begin to feel discomfort and, as John suggests, "Caref

Re: [R] precision warning in delaunayn function

2012-07-26 Thread Keith Jewell
Does > delaunayn(scale(coord),options="Qbb") help? Keith J On 26/07/2012 08:26, Jean-Luc Dupouey wrote: Dear R helpers, I try to use the 'delaunayn' function in the 'geometry' package for Delaunay triangulation in 2 dimensions. For the four following points, I get a warning message : > co

Re: [R] Interpreting Q-Q Plots

2012-05-15 Thread Keith Jewell
On 14/05/2012 23:21, Rich Shepard wrote: On Tue, 15 May 2012, Peter Alspach wrote: Probably highly skewed to the right, with discrete values (perhaps due to the limitations in the accuracy of the assessment equipment). Peter, Most of these data are near zero or the lower detection limit.

Re: [R] Problem with 'nls' fitting logistic model (5PL)

2012-05-03 Thread Keith Jewell
> ?nls.control > fit<- nls(MFI~a + b/((1+(nom/c)^d)^f), data=x, weights=x$weights, + start=c(a=100, b=1, c=100, d=-1, f=1), control=nls.control(warnOnly=TRUE)) Warning message: In nls(MFI ~ a + b/((1 + (nom/c)^d)^f), data = x, weights = x$weights, : step factor 0.000488281 reduced below '

Re: [R] Area between 2 curves

2012-04-30 Thread Keith Jewell
A quick Google suggests that sintegral is in the Bolstad2 package: http://cran.r-project.org/web/packages/Bolstad2/ "R. Michael Weylandt" wrote in message news:CAAmySGOCtNxWNHJDka=68criphxnppwap6fm7ufkhtx7xsz...@mail.gmail.com... > You can't just decide a command exists and try to use it by you

Re: [R] Different varable lengths

2012-04-30 Thread Keith Jewell
Missing comma between -1.180620213 and -0.525964648 "Saint" wrote in message news:1335779012548-4597768.p...@n4.nabble.com... > Hi! > > I'm trying to do a lm() test on three objects. My problem is that R > protests > and says that the variable lengths differ for one of the objects > (Sweden.GD

Re: [R] Creating polygons from scattered points

2012-03-14 Thread Keith Jewell
No time to really think about this, but: a) to "convert scattered point distributions to polygons" you might look at convex hulls; e.g. convhulln {geometry} b) to identify islands some kind of cluster analysis Hope that helps a little. KJ "Louise Mair" wrote in message news:camkzt57pep1zkpgm

Re: [R] how to run system command

2012-03-08 Thread Keith Jewell
urrent date is: Wed 03/07/2012 > Enter the new date: (mm-dd-yy) Warning messages: > 1: running command 'C:\Windows\system32\cmd.exe /c date' had status 1 > 2: In shell("date") : 'date' execution failed with error code 1 > > sessionInfo() does no

Re: [R] how to run system command

2012-03-07 Thread Keith Jewell
Works for me: -- > sessionInfo() R version 2.14.1 (2011-12-22) Platform: i386-pc-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252LC_MONETARY=English_United Kingdom.1252 [4] LC_NUMERIC=C

Re: [R] Sorting strings

2012-02-20 Thread Keith Jewell
"Petr Savicky" wrote in message news:20120220105153.gc21...@cs.cas.cz... > On Mon, Feb 20, 2012 at 02:18:42AM -0800, statquant2 wrote: >> Hi all, I am having difficulties to understand how R sort strings: >> >> If I do >> R) sort(c("X.","X0B")) >> [1] "X." "X0B" >> >> So for me, as far as lexic

Re: [R] unique combinations

2011-12-21 Thread Keith Jewell
d lead to a solution. I used "[", which I couldn't see suggested on ?expand.grid. I thought I'd missed a neater solution in the help pages, and hoped someone could point it out. Best regards, Keith Jewell -- "Uwe Ligges" wrote in message

Re: [R] unique combinations

2011-12-21 Thread Keith Jewell
OK, someone point it out to me; my wife tells me I can't see what's in front of me :-} I read ?expand.grid carefully, went to ?combn and ?choose but still couldn't see an easy way to get what the OP asked for. The neatest I can get (which isn't very neat!) is: > myVec <- c(1,2,3) > eg <- expan

Re: [R] Adding a year to existing date

2011-11-17 Thread Keith Jewell
Just looking at the ambiguity in "adding a year" > dates <- as.Date(c('2007-03-01','2008-02-29')) > tmp <- as.POSIXlt(dates) > tmp$year <- tmp$year+1 > dates2 <- as.Date(tmp) > dates2 [1] "2008-03-01" "2009-03-01" > dates2 - dates Time differences in days [1] 366 366 KJ "MacQueen, Don" wrote in

Re: [R] UNC Windows path beginning with backslashes

2011-08-19 Thread Keith Jewell
lid drive (e.g. 'Y:'): K at throw(Exception(...)) at throw.default("Argument 'drive' is not a valid drive (e.g. 'Y:'): ", drive) at throw("Argument 'drive' is not a valid drive (e.g. 'Y:'): ", drive) at method(static

Re: [R] UNC Windows path beginning with backslashes

2011-08-18 Thread Keith Jewell
("R_Libs_Site"))) ... which seems to do the job. It isn't pretty, and the .bat file will probably need changing in future versions of Windows. But by the time R has started there isn't a UNC path in sight. I still think I've probably re-invented a wheel and ended up with s

Re: [R] UNC Windows path beginning with backslashes: normalizePath bug??

2011-08-12 Thread Keith Jewell
uding mapping a drive where I can. I posted in the hope of learning from and perhaps helping those with similar problems. I hope that it is permissible to discuss non-canonical use of R on this list, I certainly did not intend disrespect for the R developers (or to make typing errors). Best regard

[R] UNC windows path beginning with backslashes: normalizePath bug??

2011-08-12 Thread Keith Jewell
s it goes, but it's all a bit messy! If .libPaths is called with a 'new' argument it will breaks things again. normalizePath seems to produce paths that don't work with Sys.glob. I have the feeling I'm being silly and making hard work of all this. Any comments? Suggest

[R] UNC windows path beginning with backslashes: normalizePath bug??

2011-08-11 Thread Keith Jewell
s it goes, but it's all a bit messy! If .libPaths is called with a 'new' argument it will breaks things again. normalizePath seems to produce paths that don't work with Sys.glob. I have the feeling I'm being silly and making hard work of all this. Any comments? Suggest

Re: [R] list.files recursively to find files in a specific way...

2011-07-20 Thread Keith Jewell
s. Was I correct? If so, I suggested an equivalent list.files construction (where I did escape '.') as: list.files(path=file.path(list.files(path=.libPaths(), full.names=TRUE), "etc"), pattern="^menus\\.txt$", full.names=TRUE) Does that look OK? Best regards, Keith Jew

[R] Sys.glob() doesn't handle a UNC windows path beginning with backslashes

2011-06-30 Thread Keith Jewell
ure? 3) Prescription: If not: a) is assign(".lib.loc", sub("Server02/stats", "L:", .libPaths(), ignore.case = TRUE), env=environment(.libPaths)) a reasonable workaround in a specific case? b) is list.files(path=file.path(list.files(path=.libPaths(), full.names=T

Re: [R] How to capture console output in a numeric format

2011-06-27 Thread Keith Jewell
502-2619 > email: rvarad...@jhmi.edu > > > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Keith Jewell > Sent: Friday, June 24, 2011 11:49 AM > To: r-h...@stat.math.ethz.ch > Subject: Re: [R] How to capture

Re: [R] How to capture console output in a numeric format

2011-06-24 Thread Keith Jewell
If you don't want the information as character, why are you printing it rather than storing it in a matrix? Why not something along the lines of this... fr <- function(x) { ## Rosenbrock Banana function on.exit(aMatrix <<- rbind(aMatrix,(cbind(x1, x2, f x1 <- x[1] x2 <- x[2]

Re: [R] QQ plot for normality testing

2011-05-03 Thread Keith Jewell
I have found this web page useful http://www.cms.murdoch.edu.au/areas/maths/statsnotes/samplestats/qqplot.html Your mileage may vary. Keith J "Matevz Pavlic" wrote in message news:ad5ca6183570b54f92aa45ce2619f9b901208...@gi-zrmk.si... > Hi all, > > > > I am trying to test wheater the distribu

Re: [R] error in nls, step factor reduced below minFactor

2011-03-29 Thread Keith Jewell
?nls.control warnOnly a logical specifying whether nls() should return instead of signalling an error in the case of termination before convergence. Termination before convergence happens upon completion of maxiter iterations, in the case of a singular gradient, and in the case that the s

Re: [R] extract printed value from a function

2011-02-24 Thread Keith Jewell
I don't think that third suggestion actually works: > x <- print( twotPermutation(c(2,3,4),c(3,6,5),plotit=F) ) [1] 0.289 NULL > x NULL twotPermutation returns the value of invisible() which is NULL: x <- print(invisible()) x This conflicts with the documented behaviour of twotPermutation which

Re: [R] A question on Duplicating

2011-02-10 Thread Keith Jewell
Unless I've made a mistake (it happens!) that gives FALSE on the data which the OP said should give TRUE. Ravi Varadhan suggested duplicated(a) & duplicated(b) but that gives the same result for b <- c("n", "m", "o", "m") for which I think the OP would like FALSE I think this may do it all(

Re: [R] subsets

2011-01-20 Thread Keith Jewell
I did try it. It gave me [[1]] id diagnosis 1 1ah 5 3ah 7 4ah 8 4 ihd 10 5 ihd [[2]] id diagnosis 1 1ah 2 2ah 5 3ah 7 4ah [[3]] id diagnosis 3 2 ihd 8 4 ihd 10 5 ihd Which isn't what t

Re: [R] subsets

2011-01-20 Thread Keith Jewell
I don't think Ivan's solution meets the OP's needs. I think you could do it using %in% and the approriate logical operations e.g. aDF <- data.frame(id=c(1,2,2,2,3,3,4,4,4,5), diagnosis=c("ah", "ah", "ihd", "im", "ah", "stroke", "ah", "ihd", "angina", "ihd")) aDF[with(aDF,(id %in% id[diagno

Re: [R] median by geometric mean -- are we missing what's important?

2011-01-18 Thread Keith Jewell
of a general problem with the geometric mean if there > are 0s or an odd number of negative numbers it becomes 0 or imaginary > (please do correct me if I'm wrong)? > > sqrt(prod(c(2, 0, 54))) > sqrt(prod(c(-2, 2))) > > >> Greg Snow, what is the scientific question? What

Re: [R] median by geometric mean

2011-01-17 Thread Keith Jewell
Just in case some of x are negative (the desired median still exists, as long as the two middle values are non -ve), how about: x <- runif(20, -1, 100) exp(median(log(pmax(0,x It'll give -Inf if the two middle values are negative, when I guess we should get NaN, but I can't see a 1-line way

Re: [R] how to wrap a long line in R scripts?

2011-01-10 Thread Keith Jewell
"Jonathan P Daily" wrote in message news:of588e803b.869e9aff-on85257814.004d298d-85257814.004d4...@usgs.gov... >a <- "rey lo >ong charrr" > > Although the indentation is just personal preference. > -- > J

Re: [R] String to array

2010-12-09 Thread Keith Jewell
"Romildo Martins" wrote in message news:aanlktinbiaexcobzyqdbtr62xr9q=kjvwaazaqi-k...@mail.gmail.com... > Hello, > > how convert x in xarray (numbers)? > >> x > [1] "0 - 13" >> y > [1] "11 - 23" >> z > [1] "220 - 9" >> xarray > [1] 0 13 >> yarray > [1] 11 23 >> zarray > [1] 220 9 > > > > Than

Re: [R] colname refered by a variable

2010-12-03 Thread Keith Jewell
or even shorter df[,paste("A","C",sep="")] "Santosh Srinivas" wrote in message news:aanlktikcjy7bvyfbwuwmrq4dhg4pbdau+qh_7+k+b...@mail.gmail.com... try this .. df[,colnames(df)==paste("A","C",sep="")] On Fri, Dec 3, 2010 at 12:05 PM, Yuan Jian wrote: > Hello, > > I tried to use a variable to

Re: [R] How to get a specific named element in a nested list

2010-11-11 Thread Keith Jewell
Neat! I think replacing out <- rmatch(el, name) with out <- Recall(el, name) will avoid the dependence of the code on the function name Keith J "Michael Bedward" wrote in message news:aanlktikv9zepxipbp7ftr8vmpgsjaptjyj_dudy-m...@mail.gmail.com... On 11 November 2010 21:08, Janko Thys

Re: [R] Installing R and an editor on a USB drive

2010-11-10 Thread Keith Jewell
As I recall (my memory may be faulty), Tinn-R installation required admin privileges, but running does not and the installation does not include the specific file path in any files. To make Tinn-R available on a machine where I do not have admin privileges I have a) installed onto a machine whe

Re: [R] Is there a way to have 'comment' keep a list?

2010-11-09 Thread Keith Jewell
I hadn't seen 'comment' before, so don't take my suggestion as authoritative. It looks useful, so I investigated a bit. This technique seems to work and is (perhaps?) easier than names: tlist <- list(a=c(1:3), b=7) comment(x) <- unlist(sapply(tlist, as.character)) or in one line comment

Re: [R] Changing sign on absolute numbers 0 problems

2010-10-21 Thread Keith Jewell
In case it helps... > test <- c("-0:00:53", "-0:01:10.", "-0:01:26.", "-0:01:38.", "-0:01:43", + "-0:01:59.", "-0:03:50.", "-0:04:46", "-0:05:01.", "-0:05:16.", + "3:41:33.0", "3:43:09.4", "3:44:26.3", "3:47:26.0", "3:48:19.3", + "3:52:13.4", "3:57:10.2", "4:29:37.6", "5:01:28.4", "5:08:45.6" ) >

Re: [R] Changing sign on absolute numbers 0 problems

2010-10-21 Thread Keith Jewell
"Sadz A" wrote in message news:419230.77523...@web24610.mail.ird.yahoo.com... > Hi, > > I am trying to do some calculations turning DMS data to decimal degrees > using > the formula (D+(M/60)+(S/3600)), some of the D's involve -ve numbers, the > easiest way to do the calculation is to use absol

Re: [R] Nonlinear Regression Parameter Shared Across Multiple DataSets

2010-10-15 Thread Keith Jewell
12, 2010 at 8:58 AM, Jared Blashka >> wrote: >> >>> Thanks so much! It works great. >>> >>> I had thought the way to do it relied on combining the data sets, but I >>> couldn't figure out how to alter the formula to work with the >>&

[R] Building ragged dataframe (was Re: Data Gaps)

2010-10-14 Thread Keith Jewell
> "Dennis Murphy" wrote in message > news:aanlktinraufrh71j9wpnfzvg_8jayackw1e8cpn=c...@mail.gmail.com... > Hi: > > The essential problem is that after you append items, the result is a list > with possibly unequal lengths. Trying to convert that into a data frame by > the 'usual' methods (do.call

Re: [R] Nonlinear Regression Parameter Shared Across Multiple Data Sets

2010-10-12 Thread Keith Jewell
"Jared Blashka" wrote in message news:aanlktinffmudugqnkudvr=fmf0wrrtsbjxjexuki_...@mail.gmail.com... > I'm working with 3 different data sets and applying this non-linear > regression formula to each of them. > > nls(Y ~ (upper)/(1+10^(X-LOGEC50)), data=std_no_outliers, > start=list(upper=max(s

Re: [R] boundary check

2010-09-24 Thread Keith Jewell
done exactly here. } } \details{ %% ~~ If necessary, more details than the description above ~~ } \value{ An integer vector of length n \tabular{rl}{ 1 \tab inside hull\cr -1 \tab inside hull\cr 0 \tab on hull (to precision indicated by tol) }} \references{ \url{http://www.mathworks.com/matl

Re: [R] efficient list indexing

2010-09-22 Thread Keith Jewell
Also, it may be that you want bigfred to be a list of 5 lists each of 2 elements (happy and name) rather than a list of 10 elements. Thus (also using double bracketing) fred<- list(happy = 1:10, name = "squash") bigfred <- replicate(5, fred, FALSE) bigfred[[2]][[2]] hth Keith J "Patrick Burns

Re: [R] How to generate a particular sequence ?

2010-09-13 Thread Keith Jewell
"Ted Harding" wrote in message news:xfmail.100913104250.ted.hard...@manchester.ac.uk... > On 13-Sep-10 09:19:21, Feng Li wrote: >> Dear R, >> I have a vector, say a = c(1,2,4,5,6,8). Can I generate a vector >> or array (2-by-3-by-3) of this form >> c(1,2,1,2,1,2,4,5,4,5,4,5,6,8,6,8,6,8) >> in wh

Re: [R] Calculating with tolerances (error propagation)

2010-09-09 Thread Keith Jewell
"Jan private" wrote in message news:1284029454.2740.361.ca...@localhost.localdomain... > Hello Bernardo, > > - > If I understood your problem this script solve your problem: > > q<-0.15 + c(-.1,0,.1) > h<-10 + c(-.1,0,.1) > 5*q*h > [1] 2.475 7.500 12.625 > - > > OK, this solves

Re: [R] Where the data file is stored?

2010-08-12 Thread Keith Jewell
You're not seeing the .Rdata file containing the data objects. Try: list.files(getwd(),full.name=TRUE, all.files=TRUE) "Stephen Liu" wrote in message news:961426.85478...@web113203.mail.gq1.yahoo.com... - Original Message From: Alain Guillet To: Stephen Liu Cc: r-help@r-project.org

Re: [R] nls with some coefficients fixed

2010-07-21 Thread Keith Jewell
"Gabor Grothendieck" wrote in message news:aanlktilszaicycu3lz2f5d_bxq1g8m8f7jsjsbj2l...@mail.gmail.com... > On Tue, Jul 20, 2010 at 9:58 AM, wrote: >> For nls, the fixing (or masking) of parameters is not, to my knowledge, >> possible. >> >> This is something I've been trying to get in such r

Re: [R] nls with some coefficients fixed

2010-07-21 Thread Keith Jewell
"Gabor Grothendieck" wrote in message news:aanlktilszaicycu3lz2f5d_bxq1g8m8f7jsjsbj2l...@mail.gmail.com... > On Tue, Jul 20, 2010 at 9:58 AM, wrote: >> For nls, the fixing (or masking) of parameters is not, to my knowledge, >> possible. >> >> This is something I've been trying to get in such r

Re: [R] nls with some coefficients fixed

2010-07-20 Thread Keith Jewell
wrote in message news:33466.129.6.253.2.1279634282.squir...@webmail02.uottawa.ca... > For nls, the fixing (or masking) of parameters is not, to my knowledge, > possible. > > This is something I've been trying to get in such routines for over 2 > decades. Masks are > available, but not yet well do

[R] nls with some coefficients fixed

2010-07-19 Thread Keith Jewell
I'm using nls to fit a variety of different models. Here I use SSgompertz as an example. I want the ability to fix one (or more) of the coefficients that would normally be optimised (e.g. fix b3=0.8). Examples; based on and using data from example(SSgompertz) #- # vanilla ca

Re: [R] Using if statement on function

2010-06-28 Thread Keith Jewell
You could also consider isTRUE(all.equal(FUN, mean)) > isTRUE(all.equal(mean, mean)) [1] TRUE > isTRUE(all.equal(mean, median)) [1] FALSE HTH Keith J "Patrick Burns" wrote in message news:4c28777f.1040...@pburns.seanet.com... > If I understand the problem properly, > you want something li

Re: [R] Capturing errors [not buffered output] from Rterm

2010-06-10 Thread Keith Jewell
potting it myself, thanks for treating me kindly! "Prof Brian Ripley" wrote in message news:alpine.lfd.2.00.1006101333520.25...@gannet.stats.ox.ac.uk... > On Thu, 10 Jun 2010, Keith Jewell wrote: > >> In MS Windows I >> a) invoke Rterm from a batch file (test.bat) &g

[R] Capturing buffered output from Rterm

2010-06-10 Thread Keith Jewell
) but I don't think this is available in R (?). Has anyone any suggestions? Thanks in advance, Keith Jewell --please do not edit the information below-- R Version: platform = i386-pc-mingw32 arch = i386 os = mingw32 system = i386, mingw32 status = major = 2 minor = 11.0 year = 2010

Re: [R] how to update R files included as"source" ?

2010-03-29 Thread Keith Jewell
Hi, I'm afraid I really don't have time to enter into a dialogue :-{ but this fragment from a function of mine might help... -- outfile <- sub("Rd$", "html", hfile, ignore.case=TRUE) # name of corresponding html out.mod <- file.info(outfile)[,"mtime"] # if html

Re: [R] Error Running TinnR with R

2010-03-12 Thread Keith Jewell
Many people seem to have trouble defining '.trPaths' which is the set of file names which TinnR uses to communicate with R; the user must be able to create/write/read these files/folders. In my Rprofile.site I have the single assingment: .trPaths <- paste(paste(Sys.getenv("APPDATA"), "\\Tinn-R\\

[R] update.packages with UNC library path

2010-02-26 Thread Keith Jewell
Hi all, I hit a small snag. Here is my workaround (copied verbatim from my aide memoire) in case it helps others. (or anyone knows a better way... ;-) Best regards, Keith Jewell. The site library file is defined (in Renviron.site R_LIBS_SITE=//Server02/stats/R/library

Re: [R] locfit: max number of predictors = 6? How interpolate in 5-10D?

2010-02-26 Thread Keith Jewell
fy neighbours??), and I don't want to re-invent wheels. Can anyone suggest an ALTERNATIVE route for INTERPOLATION in 5-10 DIMENSIONS? Best... (apologies for capitals, not shouting, just highlighting key points for those skimming quickly) Keith Jewell "Liaw, Andy" wrote in message

[R] locfit: max number of predictors?

2010-02-25 Thread Keith Jewell
ce of a 'crisp' upper limit on the number of predictors in locfit? If it is 5, or thereabouts, can anyone suggest an alternative which can handle a few more? (I'm using it for multidimensional interpolation). Best regards, Keith Jewell _

Re: [R] update.packages on MS Windows with //server/share paths

2010-01-26 Thread Keith Jewell
the same result, especially when (as in this case) the syntax of the file spec... > .libPaths()[1] [1] "//Server02/stats/R/library/2.10" ... is controlled by R (in this example the former fails with "...not found", the latter opens the folder in Windows Explo

[R] update.packages on MS Windows with //server/share paths

2010-01-26 Thread Keith Jewell
aths()), basename(.libPaths( > .libPaths() [1] "//Server02/stats/R/library/2.10" "//Server02/stats/R/R-Current/library" doesn't actually change the internal paths. I don't see the problem in V2.9.2 . I do see the problem in V2.10.1, V2.10.1 Patched (2010-01-24

Re: [R] find the corresponding mean y

2010-01-12 Thread Keith Jewell
Not very clear what you want, but perhaps... ?sortedXyData ...might help. hth KJ "luciferyan" wrote in message news:1263231740556-1011427.p...@n4.nabble.com... > > Hello, I have 49 paired data, x, y. > I have sampled x (where replacement is true), and find its mean. > How can I find the corresp

Re: [R] Problem with expand.grid

2009-12-22 Thread Keith Jewell
Thanks, Prof Ripley (and everyone else who's responding while I type this!). I thought I was being stupid. What I wanted was: expand.grid(lapply(dDF, unique)) which works fine! Seasonal greetings to all, Keith Jewell "Prof Brian Ripley" wrote in message

Re: [R] Problem with expand.grid

2009-12-22 Thread Keith Jewell
ent has 100 rows, data has 10 "Keith Jewell" wrote in message news:hgqqja$rk...@ger.gmane.org... > Hi All, > > This example code > > dDF <- structure(list(y = c(4.75587, 4.8451, 5.04139, 4.85733, 5.20412, > 5.92428, 5.69897, 4.78958, 4, 4), t = c(0,

[R] Problem with expand.grid

2009-12-22 Thread Keith Jewell
.9.0) 'stringsAsFactors' argument to expand.grid() was not working: it now does work but has default TRUE for backwards compatibility. but I don't think that's relevant, I have no factors. I'm probably being silly. Can anyone point out where? Best... Ke

Re: [R] mutlidimensional in.convex.hull(wasmultidimensionalpoint.in.polygon??)

2009-12-18 Thread Keith Jewell
Syntax suggestions implemented. Inhull's original author consulted. Function submitted for potential inclusion in geometry package. Seasons greetings to all. Keith Jewell - "baptiste auguie" wrote in message news:de4e29f50912180238m45c4b7c

Re: [R] mutlidimensional in.convex.hull (wasmultidimensionalpoint.in.polygon??)

2009-12-18 Thread Keith Jewell
, if anyone has comments, criticisms, suggestions for improvement I would be interested. Enjoy! Keith Jewell inhull <- function(testpts, calpts, hull=convhulln(calpts), tol=mean(mean(abs(calpts)))*sqrt(.Machine$double.eps)) { # # R implementation of the Matlab

Re: [R] mutlidimensional in.convex.hull (was multidimensionalpoint.in.polygon??)

2009-12-11 Thread Keith Jewell
in reason I thought it non-trival (for me) to code in R was my ignorance; lines like... nullsp = null(xyz(tess(i,2:end),:) - repmat(xyz(tess(i,1),:),p-1,1))'; ...seem important but I don't know what 'null' and 'repmat' do. I don't even understand the algebra bei

[R] mutlidimensional in.convex.hull (was multidimensional point.in.polygon??)

2009-12-10 Thread Keith Jewell
al/fileexchange/10226-inhull> of (what looks like) my algorithm. I don't speak Matlab, but this looks non-trivial to code in R. I'll do it if I have to, but if it already exists it would be nice. If I do have to code it, I'd really appreciate an expression in algebra rather than

Re: [R] multidimensional point.in.polygon??

2009-12-10 Thread Keith Jewell
are wandering in the dark :-( Any hints? Thanks in advance, Keith Jewell - "baptiste auguie" wrote in message news:de4e29f50912040550m71fbffafnfa1ed6e0f4451...@mail.gmail.com... Hi, Yet another one of my very naive ideas

[R] multidimensional point.in.polygon??

2009-12-04 Thread Keith Jewell
hink there must be a better way of testing for a point inside a polygon, I'd have thought convhulln must need to do that often! Thanks in advance for any pointers, Keith Jewell __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/list

[R] Problem with NLSstClosestX; and suggested fix

2009-10-14 Thread Keith Jewell
dev2) lim1 + (lim2 - lim1) * dev1/(dev1 + dev2) } # new line inserted } --- Comments/corrections welcome. Keith Jewell = > sessionInfo() R version 2.9.2 (2009-08-24)

  1   2   >