[R] segfault from systemfonts::system_fonts

2020-11-03 Thread Dennis Fisher
R 4.0.3
OS X 10.15.7

Colleagues

When I run flextable, it generates a segfault.  I traced the problem to 
systemfonts::system_fonts()

> > require("systemfonts")
> Loading required package: systemfonts
> >  system_fonts()
> 
>  *** caught segfault ***
> address 0x0, cause 'memory not mapped'
> 
> Traceback:
>  1: system_fonts_c()
>  2: system_fonts()
> 
> Possible actions:
> 1: abort (with core dump, if enabled)
> 2: normal R exit
> 3: exit R without saving workspace
> 4: exit R saving workspace
> 
I updated my OS and R, deleted and reinstalled the systemfonts package -- 
problem persists.  

I also opened Apple's font application and "validated" all font files (I have 
never installed any special fonts nor is there anything non-standard (e.g., 
Homebrew) on my system.

Of note, I can run other functions in systemfonts without problems -- only 
system_fonts triggers the segfault.

Another similar setup on OS X does not trigger the same problem, so the problem 
is more likely something in my system rather than a problem in R.

Does anyone have any ideas on how one might address this?

Dennis
 
Dennis Fisher MD
P < (The "P Less Than" Company)
Phone / Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com

__
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] segfault from systemfonts::system_fonts

2020-11-03 Thread Duncan Murdoch

On 03/11/2020 3:43 p.m., Dennis Fisher wrote:

R 4.0.3
OS X 10.15.7

Colleagues

When I run flextable, it generates a segfault.  I traced the problem to 
systemfonts::system_fonts()


require("systemfonts")

Loading required package: systemfonts

  system_fonts()


  *** caught segfault ***
address 0x0, cause 'memory not mapped'

Traceback:
  1: system_fonts_c()
  2: system_fonts()

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace


I updated my OS and R, deleted and reinstalled the systemfonts package -- 
problem persists.

I also opened Apple's font application and "validated" all font files (I have 
never installed any special fonts nor is there anything non-standard (e.g., Homebrew) on 
my system.

Of note, I can run other functions in systemfonts without problems -- only 
system_fonts triggers the segfault.

Another similar setup on OS X does not trigger the same problem, so the problem 
is more likely something in my system rather than a problem in R.

Does anyone have any ideas on how one might address this?



For what it's worth, I have the same R version and macOS version, and it 
works fine.  Debugging it will be hard:  all the work happens in a 
function called using


.Call("_systemfonts_system_fonts_c")

If I could reproduce the bug and wanted to track it down, I think I'd do 
it by adding a bunch of Rprintf() commands into the source of 
_systemfonts_system_fonts_c and rebuilding the package.  It would be 
really tedious; I'm glad I'm not doing this!


Duncan Murdoch

__
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] segfault from systemfonts::system_fonts

2020-11-03 Thread Dennis Fisher
Duncan

Thanks for responding -- but your response did not help my mood.
Executing:
.Call("_systemfonts_system_fonts_c")
triggered the segfault (as you proposed).

Dennis

Dennis Fisher MD
P < (The "P Less Than" Company)
Phone / Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com




> On Nov 3, 2020, at 1:00 PM, Duncan Murdoch  wrote:
> 
> On 03/11/2020 3:43 p.m., Dennis Fisher wrote:
>> R 4.0.3
>> OS X 10.15.7
>> Colleagues
>> When I run flextable, it generates a segfault.  I traced the problem to 
>> systemfonts::system_fonts()
 require("systemfonts")
>>> Loading required package: systemfonts
  system_fonts()
>>> 
>>>  *** caught segfault ***
>>> address 0x0, cause 'memory not mapped'
>>> 
>>> Traceback:
>>>  1: system_fonts_c()
>>>  2: system_fonts()
>>> 
>>> Possible actions:
>>> 1: abort (with core dump, if enabled)
>>> 2: normal R exit
>>> 3: exit R without saving workspace
>>> 4: exit R saving workspace
>>> 
>> I updated my OS and R, deleted and reinstalled the systemfonts package -- 
>> problem persists.
>> I also opened Apple's font application and "validated" all font files (I 
>> have never installed any special fonts nor is there anything non-standard 
>> (e.g., Homebrew) on my system.
>> Of note, I can run other functions in systemfonts without problems -- only 
>> system_fonts triggers the segfault.
>> Another similar setup on OS X does not trigger the same problem, so the 
>> problem is more likely something in my system rather than a problem in R.
>> Does anyone have any ideas on how one might address this?
> 
> For what it's worth, I have the same R version and macOS version, and it 
> works fine.  Debugging it will be hard:  all the work happens in a function 
> called using
> 
>.Call("_systemfonts_system_fonts_c")
> 
> If I could reproduce the bug and wanted to track it down, I think I'd do it 
> by adding a bunch of Rprintf() commands into the source of 
> _systemfonts_system_fonts_c and rebuilding the package.  It would be really 
> tedious; I'm glad I'm not doing this!
> 
> Duncan Murdoch


[[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] How to correct my error message

2020-11-03 Thread varin sacha via R-help
Dear All,

Many thanks for your responses. I got it !

Best,









Le mardi 27 octobre 2020 à 21:16:50 UTC+1, Md. Moyazzem Hossain 
 a écrit : 





Dear Varin,

I think the following code will solve your problem.

n <- 60
b <- runif(n, 0, 5)
a <- runif(n, 0, 5)
z1 <- data.frame(x0=1:57,
                    x1=rnorm(n*0.95,2,3))
z2 <- data.frame(x0=58:60,
                    x1=rnorm(n*0.05,2,9))

combined=rbind(z1,z2)
z=combined[,2]
y_model <- 0.1 * b - 0.5 * z - a + 10
y_obs <- y_model +c( rnorm(n*0.95, 0, 0.1), rnorm(n*0.05, 0, 0.5) )
df<-data.frame(b,a,z,y_obs)

Thanks.

Md

On Tue, Oct 27, 2020 at 7:21 PM Sarah Goslee  wrote:
> Hi,
> 
> a is of length 60.
> b is of length 60.
> z is of length 57.
> 
> What do you expect to have happen when you create y_model ? What
> happens to those other 3 observations?
> 
> Sarah
> 
> On Tue, Oct 27, 2020 at 3:07 PM varin sacha via R-help
>  wrote:
>>
>> Dear R-experts,
>>
>> Here below my R code. The warning message is not a problem to me but there 
>> is an error message more problematic. I understand the error message but I 
>> don't know if it is possible to correct the error and if yes, how to correct 
>> it.
>>
>> Many thanks.
>>
>>
>> n <- 60
>> b <- runif(n, 0, 5)
>> a <- runif(n, 0, 5)
>> z <- rnorm(n*0.95,2,3) + rnorm(n*0.05,2,9)
>> y_model <- 0.1 * b - 0.5 * z - a + 10
>> y_obs <- y_model +c( rnorm(n*0.95, 0, 0.1), rnorm(n*0.05, 0, 0.5) )
>> df<-data.frame(b,a,z,y_obs)
>>
>> __
>> 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.
> 
> 
> 
> -- 
> Sarah Goslee (she/her)
> http://www.numberwright.com
> 
> 
> __
> 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.
> 
> 


-- 
Best Regards,
Md. Moyazzem Hossain
Associate Professor
Department of Statistics
Jahangirnagar University
Savar, Dhaka-1342
Bangladesh

Website: http://www.juniv.edu/teachers/hossainmm 
Research: Google Scholar; ResearchGate; ORCID iD

__
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] How to correct my error message

2020-11-03 Thread varin sacha via R-help
Many thanks Duncan,

It works !

Best.









Le mardi 27 octobre 2020 à 20:49:25 UTC+1, Duncan Murdoch 
 a écrit : 





On 27/10/2020 3:06 p.m., varin sacha via R-help wrote:

> Dear R-experts,
> 
> Here below my R code. The warning message is not a problem to me but there is 
> an error message more problematic. I understand the error message but I don't 
> know if it is possible to correct the error and if yes, how to correct it.
> 
> Many thanks.
> 
> 
> n <- 60
> b <- runif(n, 0, 5)
> a <- runif(n, 0, 5)
> z <- rnorm(n*0.95,2,3) + rnorm(n*0.05,2,9)
> y_model <- 0.1 * b - 0.5 * z - a + 10
> y_obs <- y_model +c( rnorm(n*0.95, 0, 0.1), rnorm(n*0.05, 0, 0.5) )
> df<-data.frame(b,a,z,y_obs)

> 

I suspect you intended to concatenate the two parts of z, i.e.

  z <- c(rnorm(n*0.95,2,3), rnorm(n*0.05,2,9))

You shouldn't ignore the warning.

By the way, it's not true for every n that my expression for z will 
always give something of length n.  It would be safer to do the 
calculation as

  m <- round(n*0.95)
  z <- c(rnorm(m,2,3), rnorm(n-m,2,9)

Duncan Murdoch

__
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] nlcor package

2020-11-03 Thread varin sacha via R-help
Dear R-helpers,

Here below my R code showing warnings and error messages I don't understand. 
What is going wrong ?


install.packages("devtools")
library(devtools)
install_github("ProcessMiner/nlcor")
library(nlcor) 

A=c(505, 530, 419, 486, 608, 468, 519, 486, 532, 289, 529, 474, 571, 546, 458, 
476, 376, 474, 598, 419, 479, 615, 507, 473, 532, 392, 496, 426, 480, 583, 490, 
499, 513, 444, 542)
B=c(508, 516, 390, 520, 375, 499, 478, 534, 553, 485, 405, 478, 542, 523, 491, 
363, 456, 498, 506, 529, 574, 478, 411, 571, 512, 487, 518, 515, 467, 513, 536, 
555, 508, 507, 535)

c<-nlcor(A,B,refine=0.5,plt=T)
c$cor.estimate
c$adjusted.p.value
print(c$cor.plot)


__
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] nlcor package

2020-11-03 Thread Jeff Newmiller
Someone may investigate this for you anyway, but technically this request is 
outside of the scope of this mailing list (which is the R programming language, 
not the theory of use nor possible bugs in the current version of random 
packages not even registered in CRAN). Do read the Posting Guide and consider 
corresponding with the package author as directed by the package DESCRIPTION 
file.

On November 3, 2020 1:23:50 PM PST, varin sacha via R-help 
 wrote:
>Dear R-helpers,
>
>Here below my R code showing warnings and error messages I don't
>understand. 
>What is going wrong ?
>
>
>install.packages("devtools")
>library(devtools)
>install_github("ProcessMiner/nlcor")
>library(nlcor) 
>
>A=c(505, 530, 419, 486, 608, 468, 519, 486, 532, 289, 529, 474, 571,
>546, 458, 476, 376, 474, 598, 419, 479, 615, 507, 473, 532, 392, 496,
>426, 480, 583, 490, 499, 513, 444, 542)
>B=c(508, 516, 390, 520, 375, 499, 478, 534, 553, 485, 405, 478, 542,
>523, 491, 363, 456, 498, 506, 529, 574, 478, 411, 571, 512, 487, 518,
>515, 467, 513, 536, 555, 508, 507, 535)
>
>c<-nlcor(A,B,refine=0.5,plt=T)
>c$cor.estimate
>c$adjusted.p.value
>print(c$cor.plot)
>
>
>__
>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.