[R] Help needed: gdal-configuration to install sf package in Mac OS Catalina

2020-04-05 Thread Bijesh Mishra
Hi,
I am using R in Mac. I was trying to install sf package but could not and
got error. Detail message of error is under this email. It seems like I
have to run gdal- configuration, but not sure what that means. Do you have
any idea about that?

This is the message I got while installing SF package:

configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘sf’
* removing
‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/sf’
Error: Failed to install 'sf' from GitHub:
  (converted from warning) installation of package
‘/var/folders/5_/74nhx31d521cjc_gjz58nh8rgn/T//RtmpO7v2bW/filea6321afd2c24/sf_0.9-1.tar.gz’
had non-zero exit status

-- 
Kind Regards,
Bijesh Mishra.
***

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, minimal, self-contained, reproducible code.


Re: [R] Curve fitting

2020-04-05 Thread J C Nash
Generally nlsr package has better reliability in getting parameter estimates
because it tries to use automatic derivatives rather than a rather poor 
numerical
estimate, and also uses a Levenberg-Marquardt stabilization of the linearized
model. However, nls() can sometimes be a bit more flexible.

JN

On 2020-04-05 3:20 p.m., Jeff Newmiller wrote:
> err... stats::nls...
> 
> On April 5, 2020 12:14:15 PM PDT, Jeff Newmiller  
> wrote:
>> stats::nlm?
>>
>> On April 5, 2020 11:53:10 AM PDT, Bernard Comcast
>>  wrote:
>>> Any recommendations on an R package to fit data to a nonlinear model
>>> Y=f(x) with a single x and y variable? 
>>>
>>> I want to be able to generate parameter uncertainty estimates and
>>> prediction uncertainties if possible.
>>>
>>> Bernard
>>> Sent from my iPhone so please excuse the spelling!"
>>> __
>>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>> 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, minimal, self-contained, reproducible code.
>

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, minimal, self-contained, reproducible code.


Re: [R] Curve fitting

2020-04-05 Thread Bernard Comcast
Thanks Jeff

Bernard
Sent from my iPhone so please excuse the spelling!"

> On Apr 5, 2020, at 3:14 PM, Jeff Newmiller  wrote:
> 
> stats::nlm?
> 
>> On April 5, 2020 11:53:10 AM PDT, Bernard Comcast 
>>  wrote:
>> Any recommendations on an R package to fit data to a nonlinear model
>> Y=f(x) with a single x and y variable? 
>> 
>> I want to be able to generate parameter uncertainty estimates and
>> prediction uncertainties if possible.
>> 
>> Bernard
>> Sent from my iPhone so please excuse the spelling!"
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> 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, minimal, self-contained, reproducible code.
> 
> -- 
> Sent from my phone. Please excuse my brevity.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, minimal, self-contained, reproducible code.


Re: [R] Curve fitting

2020-04-05 Thread Jeff Newmiller
err... stats::nls...

On April 5, 2020 12:14:15 PM PDT, Jeff Newmiller  
wrote:
>stats::nlm?
>
>On April 5, 2020 11:53:10 AM PDT, Bernard Comcast
> wrote:
>>Any recommendations on an R package to fit data to a nonlinear model
>>Y=f(x) with a single x and y variable? 
>>
>>I want to be able to generate parameter uncertainty estimates and
>>prediction uncertainties if possible.
>>
>>Bernard
>>Sent from my iPhone so please excuse the spelling!"
>>__
>>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>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, minimal, self-contained, reproducible code.

-- 
Sent from my phone. Please excuse my brevity.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, minimal, self-contained, reproducible code.


Re: [R] Curve fitting

2020-04-05 Thread Jeff Newmiller
stats::nlm?

On April 5, 2020 11:53:10 AM PDT, Bernard Comcast 
 wrote:
>Any recommendations on an R package to fit data to a nonlinear model
>Y=f(x) with a single x and y variable? 
>
>I want to be able to generate parameter uncertainty estimates and
>prediction uncertainties if possible.
>
>Bernard
>Sent from my iPhone so please excuse the spelling!"
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>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, minimal, self-contained, reproducible code.

-- 
Sent from my phone. Please excuse my brevity.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, minimal, self-contained, reproducible code.


[R] Curve fitting

2020-04-05 Thread Bernard Comcast
Any recommendations on an R package to fit data to a nonlinear model Y=f(x) 
with a single x and y variable? 

I want to be able to generate parameter uncertainty estimates and prediction 
uncertainties if possible.

Bernard
Sent from my iPhone so please excuse the spelling!"
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, minimal, self-contained, reproducible code.


Re: [R] ggplot stat smooth and poly

2020-04-05 Thread Deepayan Sarkar
On Thu, Apr 2, 2020 at 6:10 PM PIKAL Petr  wrote:

> Dear all
>
> I am not sure, but I believe that in past it was possible to add smoothing
> lines in ggplot even if some group did not have enough points to perform
> calculation (although I did not find any version which could deliver it).
>
> Here is the code and data
>
> library(ggplot2)
> p <- ggplot(test, aes(x=one, y=two, colour=three))
> p+geom_point(size=5)+stat_smooth(method="lm")
> ***line added to each group
>
> p+geom_point(size=5)+stat_smooth(method="lm", formula=y~poly(x,2))
> Warning message:
> Computation failed in `stat_smooth()`:
> 'degree' must be less than number of unique points
> ***no line added to any group
>
> test <- structure(list(one = 1:20, two = c(1L, 4L, 9L, 16L, 25L, 36L,
> 49L, 64L, 81L, 100L, 121L, 144L, 169L, 196L, 225L, 256L, 289L,
> 324L, 361L, 400L), three = c("a", "a", "a", "a", "b", "b", "b",
> "b", "c", "c", "c", "c", "c", "d", "d", "e", "e", "e", "e", "e"
> )), class = "data.frame", row.names = c(NA, -20L))
>
> My question:
> Is it possible to add smoothing line just to the groups where it can be
> added? I know that I could exclude "d" level from my data but I would
> prefer
> to keep them and add only smoothing lines where they could be computed.
>

Looks like there's a tryCatch around each panel, but not for each group
within panel. So this would work:

p + geom_point(size=2) + facet_wrap(~three) +
stat_smooth(method="lm", formula=y~poly(x,2))

but one problematic group is enough to make a whole panel fail.

Other than rewriting StatSmooth$compute_panel to protect each per-group
call, a workaround could be to replace method="lm" by a safe wrapper, e.g.,:

plm <- function(formula, data, ...)
{
ocall <- match.call(expand.dots = TRUE)
ocall[[1]] <- quote(lm)
fm <- try(eval(ocall, parent.frame()), silent = TRUE)
if (inherits(fm, "try-error"))
{
ocall[[2]] <- y ~ x
fm <- eval(ocall, parent.frame())
}
fm
}

p + geom_point(size=2) + stat_smooth(method=plm, formula=y~poly(x,2))

-Deepayan

Best regards
> Petr
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, minimal, self-contained, reproducible code.