[R] Mapedit::selectMap in shiny map.

2018-02-22 Thread nevil amos
I would like to select polygons from an existing spatial polygon data set interactively in a shiny leaflet map. The process is straightforward in leaflet/ mapedit, however I need to include the procedure in a shiny app map interface. I cannot work out how to incorporate the selectMap() in the shiny

Re: [R] alternative for multiple if_else statements

2018-02-22 Thread Kevin Wamae
Dear Eric, thank you for that observation. I realised that some of the participants have duplicated “survey_start” dates and when I corrected this, the code works. Regards -- Kevin Wamae From: Eric Berger Date: Thursday, 22 February 2018 at 15:16 To: Kevin Wamae Cc: "R-help@r-p

Re: [R] alternative for multiple if_else statements

2018-02-22 Thread Kevin Wamae
Dear Ista, thank you. Let me see how best I can implement this. Regards -- Kevin Wamae On 22/02/2018, 16:58, "Ista Zahn" wrote: I don't fully understand the logic you are trying to implement, but something along the lines of foo <- cut(trialData$date,

Re: [R] How to Save the residuals of an LM object greater or less than a certin value to an R object?

2018-02-22 Thread Jeff Newmiller
Residuals are stored as a numeric vector. The R software comes with a document "Introduction to R" that discusses basic math functions and logical operators that can create logical vectors: abs( stdresiduals ) > 2.5 It also discusses indexing using logical vectors: stdresiduals[ abs( stdresidu

Re: [R] Modified Band Depth

2018-02-22 Thread Boris Steipe
Please keep the list CC'd. In order to use the algorithms, I would assume you need to understand them. I hope you find it a productive challenge to express your understanding in code. Note that the article apparently spells out what you need very explicitly in pseudocode. If you really need to

[R] How to Save the residuals of an LM object greater or less than a certin value to an R object?

2018-02-22 Thread faiz rasool
Dear list members, I want to save residuals above or less than a certain value to an R object. I have performed a multiple linear regression, and now I want to find out which cases have a residual of above + 2.5 and – 2.5. Below I provide the R commands I have used. Reg<-lm(a~b+c+d+e+f) # perf

Re: [R] Problem with geterrmessage()

2018-02-22 Thread Bert Gunter
Please read ?try (again) carefully.In paticular note (under Value): "The value of the expression if expr is evaluated without error, but an invisible object of class "try-error"containing the error message, and the error condition as the "condition" attribute, if it fails." so: attr(ERRORMESSAGE

Re: [R] Problem with geterrmessage()

2018-02-22 Thread Dennis Fisher
Luke Thanks — I revised the code to: ERRORMESSAGE <- try(source(USERSCRIPTFILE, local=T), silent=T) print(ERRORMESSAGE) now returns: $value [1] 0 $visible [1] FALSE Not clear what to make of that. Dennis Dennis Fisher MD P < (The "P Less Than" Company) Phone / Fax: 1-866-PLessThan (

Re: [R] Problem with geterrmessage()

2018-02-22 Thread luke-tierney
Only the default error handler puts the error message in a buffer where it can be retrieved with geterrmessage. try() replaces the default error handler. Either look at the value returned by try() or use tryCatch with conditionMessage. Best, luke On Thu, 22 Feb 2018, Dennis Fisher wrote: R 3.

[R] Problem with geterrmessage()

2018-02-22 Thread Dennis Fisher
R 3.4.3 OS X Colleagues I have a 20K line script in which I encounter an unexpected problem. If the script detects presence of a particular file USERCODE.txt, it executes: source(“USERCODE.txt”) If that file is not present, the script executes without a problem. There might be syntax er

Re: [R] alternative for multiple if_else statements

2018-02-22 Thread Ista Zahn
I don't fully understand the logic you are trying to implement, but something along the lines of foo <- cut(trialData$date, breaks = as.Date(c("2007-01-01", "2008-05-01", "2009-04-01", "2010-05-01"

Re: [R] alternative for multiple if_else statements

2018-02-22 Thread Eric Berger
Hi Kevin, I ran the code on the full data set and was able to reproduce the problem that you are facing. My guess is that you have an error in your intuition and/or logic, and that this relates to the use of the subscript [1]. Specifically, on the full dataset, the condition trialData$date[trialDat

Re: [R] Calculate LC50

2018-02-22 Thread Eik Vettorazzi
Have a look at the drc-package. btw. a linear model does not fit your data very well. Cheers. Am 22.02.2018 um 08:20 schrieb AbouEl-Makarim Aboueissa: > Dear All: good morning > > > I need helps with the calculation of the *LC50* from the data below > > > x<-c(0,0.3,0.7,1,4,10) > y<-c(100,

Re: [R] alternative for multiple if_else statements

2018-02-22 Thread Eric Berger
Hi, 1. I think the reason that the different ordering leads to different results is because of the following: date[ some condition is true ][1] will give you an NA if there are no rows where 'some condition holds'. In the code that 'works' you don't have such a situation, but in the cod