Re: [R] unexpected (?) behavior of box()

2022-01-06 Thread Jim Lemon
Hi Ani,
Blame Mercator. Maps draws an approximately 2x1 plot. Maybe this:

mappar<-par("usr")
rect(mappar[1],mappar[3],mappar[2],mappar[4])

Jim

On Fri, Jan 7, 2022 at 6:25 PM ani jaya  wrote:
>
> Dear R expert,
>
> I try to box a figure using box(). However it box the default margin,
> not the specified margin.
>
> #working as expected
> barplot(1:20)
> box()
>
> #working as expected, the box follow the margin
> par(mar=c(2, 6, 5, 4))
> barplot(1:20)
> box()
>
> #not working
> install.packages("maps")
> library(maps)
> par(mar=c(2, 6, 5, 4))
> m<-map('world', xlim = c(91, 142), ylim = c(25, 40),
>lwd=1.5, col = "grey",border=NA, fill = T,  bg="white")
> box()
>
> #the turnaround
> par(mar=c(2, 6, 5, 4))
> m<-map('world', xlim = c(91, 142), ylim = c(25, 40),
>lwd=1.5, col = "grey",border=NA, fill = T,  bg="white")
> par(mar=c(2, 6, 5, 4))
> box()
>
> I just curious with this behavior. Is it the problem with the package
> "map" or box() function?
> Thank you.
>
> > sessionInfo()
> R version 4.0.2 (2020-06-22)
> Platform: i386-w64-mingw32/i386 (32-bit)
> Running under: Windows 10 x64 (build 19043)
>
>
>
> Ani
>
> __
> 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] unexpected (?) behavior of box()

2022-01-06 Thread PIKAL Petr
Hi.

Why do you consider it unexpected?

see

map(database = "world", regions = ".", exact = FALSE, boundary = TRUE,
  interior = TRUE, projection = "", parameters = NULL, orientation = NULL,
  fill = FALSE, col = 1, plot = TRUE, add = FALSE, namesonly = FALSE,
  xlim = NULL, ylim = NULL, wrap = FALSE, resolution = if (plot) 1 else 0,
  type = "l", bg = par("bg"), mar = c(4.1, 4.1, par("mar")[3], 0.1),
  myborder = 0.01, namefield="name", lforce="n", ...)

map function redefines mar so your first par is probably changed during
plotting map and after you define it again box use new mar values.

Cheers
Petr

> -Original Message-
> From: R-help  On Behalf Of ani jaya
> Sent: Friday, January 7, 2022 8:25 AM
> To: r-help 
> Subject: [R] unexpected (?) behavior of box()
> 
> Dear R expert,
> 
> I try to box a figure using box(). However it box the default margin,
> not the specified margin.
> 
> #working as expected
> barplot(1:20)
> box()
> 
> #working as expected, the box follow the margin
> par(mar=c(2, 6, 5, 4))
> barplot(1:20)
> box()
> 
> #not working
> install.packages("maps")
> library(maps)
> par(mar=c(2, 6, 5, 4))
> m<-map('world', xlim = c(91, 142), ylim = c(25, 40),
>lwd=1.5, col = "grey",border=NA, fill = T,  bg="white")
> box()
> 
> #the turnaround
> par(mar=c(2, 6, 5, 4))
> m<-map('world', xlim = c(91, 142), ylim = c(25, 40),
>lwd=1.5, col = "grey",border=NA, fill = T,  bg="white")
> par(mar=c(2, 6, 5, 4))
> box()
> 
> I just curious with this behavior. Is it the problem with the package
> "map" or box() function?
> Thank you.
> 
> > sessionInfo()
> R version 4.0.2 (2020-06-22)
> Platform: i386-w64-mingw32/i386 (32-bit)
> Running under: Windows 10 x64 (build 19043)
> 
> 
> 
> Ani
> 
> __
> 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.


[R] unexpected (?) behavior of box()

2022-01-06 Thread ani jaya
Dear R expert,

I try to box a figure using box(). However it box the default margin,
not the specified margin.

#working as expected
barplot(1:20)
box()

#working as expected, the box follow the margin
par(mar=c(2, 6, 5, 4))
barplot(1:20)
box()

#not working
install.packages("maps")
library(maps)
par(mar=c(2, 6, 5, 4))
m<-map('world', xlim = c(91, 142), ylim = c(25, 40),
   lwd=1.5, col = "grey",border=NA, fill = T,  bg="white")
box()

#the turnaround
par(mar=c(2, 6, 5, 4))
m<-map('world', xlim = c(91, 142), ylim = c(25, 40),
   lwd=1.5, col = "grey",border=NA, fill = T,  bg="white")
par(mar=c(2, 6, 5, 4))
box()

I just curious with this behavior. Is it the problem with the package
"map" or box() function?
Thank you.

> sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows 10 x64 (build 19043)



Ani

__
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] Dependencies for building R

2022-01-06 Thread Jim Lemon
Thanks, Bert. I will.

Jim

On Fri, Jan 7, 2022 at 3:44 PM Bert Gunter  wrote:
>
> Ask on r-sig-fedora rather than here, no?
>
> On Thu, Jan 6, 2022, 8:18 PM Jim Lemon  wrote:
>>
>> Hi,
>> I'm facing the usual challenge of  building the latest release of R on
>> a new install of Fedora 35 Linux. Is there a list of dependencies that
>> have to be installed (or even better, a package) to avoid the
>> necessity of running ./configure many times and installing them
>> piecemeal? I've just been reading Installation and Administration in
>> the manual and haven't found anything like this. Any pointers
>> appreciated.
>>
>> Jim
>>
>> __
>> 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] Dependencies for building R

2022-01-06 Thread Bert Gunter
Ask on r-sig-fedora rather than here, no?

On Thu, Jan 6, 2022, 8:18 PM Jim Lemon  wrote:

> Hi,
> I'm facing the usual challenge of  building the latest release of R on
> a new install of Fedora 35 Linux. Is there a list of dependencies that
> have to be installed (or even better, a package) to avoid the
> necessity of running ./configure many times and installing them
> piecemeal? I've just been reading Installation and Administration in
> the manual and haven't found anything like this. Any pointers
> appreciated.
>
> Jim
>
> __
> 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.


[R] Dependencies for building R

2022-01-06 Thread Jim Lemon
Hi,
I'm facing the usual challenge of  building the latest release of R on
a new install of Fedora 35 Linux. Is there a list of dependencies that
have to be installed (or even better, a package) to avoid the
necessity of running ./configure many times and installing them
piecemeal? I've just been reading Installation and Administration in
the manual and haven't found anything like this. Any pointers
appreciated.

Jim

__
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] Error: if statement: missing value where TRUE/FALSE needed

2022-01-06 Thread Chuck Coleman via R-help
I added the sink() commands to capture the output I was seeing and saw no 
noticeable difference.  Granted, I didn't look too hard.  Still, the code ran 
for the usual time before the error.  Remove the print() commands and you'll 
probably the error in an entirely different iteration.


Thanks for helping,
Chuck



On Thursday, January 6, 2022, 12:14:15 PM EST, Duncan Murdoch 
 wrote: 





I've downloaded your code, and I'm seeing some strange results.  When I 
source MetroTest.R, it creates a log file ending

Error in if (xseg[w1] > ub & m == 1) olrmark[wi] = TRUE else if 
(xseg[w1] <  :
  missing value where TRUE/FALSE needed

as you saw.  But when I comment out the sink() lines in it, I don't see 
an error.  If I comment out only the first sink line, i.e. run with

  my_log <- file("MetroTest.log")
  #sink(my_log, append = TRUE, type = "output") # Writing console 
output to log file
  sink(my_log, append = TRUE, type = "message")

I get an error on the last line:

> sink(my_log, append = TRUE, type = "message")
Error in sink(my_log, append = TRUE, type = "message") :
  'file' must be NULL or an already open connection

Once running this code R crashed.

I find all of that quite perplexing.  I suspect one of the packages has 
some buggy code, but I don't know which one.  Currently I'm running the 
script after running gctorture(); that's really slow.  If it turns up 
anything I'll let you know.

Duncan Murdoch



On 06/01/2022 10:23 a.m., Chuck Coleman wrote:
> I've created a git repository at 
> https://sourceforge.net/p/rhelp/code/ci/master/tree/.  I've used git before, 
> so that's what I chose.  I had forgotten that sourceforge didn't have a 
> download all files command.  I don't post files often.
> 
> About the semantics of "crash":  Perhaps I'm showing my age here.  It used to 
> be that programs crashed, bombed, etc. when they hit unanticipated errors.  
> These programs lived in a OS without an intermediary.  Now, we have programs 
> of programs running within multiple applications on multiple servers with 
> multiple OSs.  Since I'm not a programmer by profession, I've had little need 
> to use these constructs.
> 
> Chuck Coleman
> 
> 
> 
> On Wednesday, January 5, 2022, 02:51:07 PM EST, Duncan Murdoch 
>  wrote:
> 
> 
> 
> 
> 
> On 05/01/2022 2:09 p.m., Ivan Krylov wrote:
> 
>> On Wed, 5 Jan 2022 21:22:37 +0300
>> Ivan Krylov  wrote:
>>
>>> How exactly do you check for a missing argument?
>>
>> To answer my own question, the check is
>>
 browser(expr = {
    is.na(w1) | is.na(ub) | is.na(m) | is.na(wi) | is.na(lb)
 })
>>
>> I think that there are NAs in xseg, which I don't see a check for. In
>> particular, a few lines above, there's
>>
 md = median( xseg, na.rm = TRUE);
 if (robust) sdd = mad(xseg,na.rm = TRUE)
 else sdd = sd(xseg,na.rm = TRUE)
>>
>> ...which seems to suggest they are expected to happen there.
>>
>> Not sure which advice to give regarding the choice of file hosting
>> service. On the one hand, SourceForge lets you upload a whole directory
>> of files in arbitrary formats, but isn't very convenient do download
>> more than one file from. On the other hand, "pastebin" services like
>> http://paste.debian.net/ or http://paste.org.ru/ let us browse the code
>> right away, without having to look at the "Your download will start
>> shortly..." screen, but don't host *.RData or more than one file per
>> link. I guess that some other code hosting service like
>> SourceHut/GitHub/GitLab/Gitea/... could fulfil both criteria.
> 
> 
> I would take one step back, and suggest that if any project has as many
> scripts as this one, it should be put in an R package.  You can
> distribute that by building it into a tar.gz file and putting that
> single file in a place where people can download it.  Github and R-forge
> work well for packages, and I assume other hosting services do too,
> though I haven't used many.
> 
> People seem to be unreasonably reluctant to put their code into packages.
> 
> 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] splitting data matrix into submatrices

2022-01-06 Thread Avi Gross via R-help


My apologies. I temporarily used another mailer and I see it did not send my 
message as plain text. I have not yet seen a way to change on a per message 
basis. My code, was naturally displayed badly. Sigh.
rows <- 1826

weekends <- (rows %% 7 <= 1)

satsun <- mymat[weekends,]

workweek <- mymat[!weekends,]

Is this any better?


-Original Message-
From: Avi Gross via R-help 
To: r-help@r-project.org 
Sent: Wed, Jan 5, 2022 12:52 pm
Subject: Re: [R] splitting data matrix into submatrices

Faheem seems to reply to people in private and I replid to him in private but 
seeing later messages, am giving a synopsis in public.
I too suggesed that using a data.frame is a better way to keep his data and use 
it for some purposes.
But my understanding is that his matrix is fairly easy to understand and can be 
indexed given the way it is set up.
Every row of the matrix has info for a single day, with each hour represented 
by one column. There is no date anywhere in sight or any visible index. But the 
collection was done starting on a Sunday and continuing without gaps so every 
seventh following row is a Sunday. So it is trivial to do what he asks using 
the %% operator to select all numbers between 1 and the number of rows in the 
matrix that have a remainder of either 0 (Saturdays) or 1 (Sundays) with 
something like this if the data is in mymat:
rows <- 1826weekends <- (rows %% 7 <= 1)satsun <- mymat[weekends,]
This basically indexes the matrix using a boolean vector. The result can be 
saved as a matrix of weekend data.
Getting the second matrix is as trivial as flipping the boolean vector.
workweek <- mymat[!weekends,]

-Original Message-
From: Faheem Jan 
To: Avi Gross 
Sent: Tue, Jan 4, 2022 11:44 pm
Subject: Re: [R] splitting data matrix into submatrices

First I will thank you for your interest and time. As my first day is Sunday, 
in my data matrix 24 are hourly demand of electricity. As electricity demand is 
different is working and non-working days, so I want a separate analysis for 
working and nonworking days that's why I want to split the data matrix into 
submatrices. Can we use for looping which divides the matrix into submatrices? 

    On Wednesday, January 5, 2022, 09:29:44 AM GMT+5, Avi Gross via R-help 
 wrote:  
 
 
If you explain better, we can help. But first consider what you are asking and 
how it is relected in the data.
Is the first component a row number whose meaning is day 1 contains a 1 or 
perhaps 0 and the next row contains one more? Or is there some kind of date in 
there?
What day of the week is the first day? Is it a Sunday or a Wednesday or what?
Just for arguments sake, say the first row is a Sunday and all later rows are 
sequential. Then row 1 is a weekend and row 7 is a weekend and so are rows 7 
more (8 and 18) and those 7 more and so on. 
What do you call it when you are looking for the remainder after dividing by 7?
Can you make a list of indices that contain every possible weekend, and another 
index containing just the non-weekends? 
If other things like Holidays do not matter, you can index the matrix many ways 
by asking for all columns but only the rows that your logical index wants. 
If I have misunderstood the problem, ignore.

-Original Message-
From: Faheem Jan via R-help 
To: R-help Mailing List 
Sent: Tue, Jan 4, 2022 10:52 pm
Subject: [R] splitting data matrix into submatrices

I have data in a matrix form of order 1826*24 where 1826 represents the days 
and 24 hourly observations on each data. My objective is to split the matrix 
into working (Monday to Friday) and non-working (Saturday and Sunday) 
submatrices. Can anyone help me that how I will do that splitting using R?


    [[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.

    [[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.
  
    [[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.

[[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 

Re: [R] Error: if statement: missing value where TRUE/FALSE needed

2022-01-06 Thread Duncan Murdoch
I've downloaded your code, and I'm seeing some strange results.  When I 
source MetroTest.R, it creates a log file ending


Error in if (xseg[w1] > ub & m == 1) olrmark[wi] = TRUE else if 
(xseg[w1] <  :

  missing value where TRUE/FALSE needed

as you saw.  But when I comment out the sink() lines in it, I don't see 
an error.  If I comment out only the first sink line, i.e. run with


  my_log <- file("MetroTest.log")
  #sink(my_log, append = TRUE, type = "output") # Writing console 
output to log file

  sink(my_log, append = TRUE, type = "message")

I get an error on the last line:

> sink(my_log, append = TRUE, type = "message")
Error in sink(my_log, append = TRUE, type = "message") :
  'file' must be NULL or an already open connection

Once running this code R crashed.

I find all of that quite perplexing.  I suspect one of the packages has 
some buggy code, but I don't know which one.  Currently I'm running the 
script after running gctorture(); that's really slow.  If it turns up 
anything I'll let you know.


Duncan Murdoch



On 06/01/2022 10:23 a.m., Chuck Coleman wrote:

I've created a git repository at 
https://sourceforge.net/p/rhelp/code/ci/master/tree/.  I've used git before, so 
that's what I chose.  I had forgotten that sourceforge didn't have a download 
all files command.  I don't post files often.

About the semantics of "crash":  Perhaps I'm showing my age here.  It used to 
be that programs crashed, bombed, etc. when they hit unanticipated errors.  These 
programs lived in a OS without an intermediary.  Now, we have programs of programs 
running within multiple applications on multiple servers with multiple OSs.  Since I'm 
not a programmer by profession, I've had little need to use these constructs.

Chuck Coleman



On Wednesday, January 5, 2022, 02:51:07 PM EST, Duncan Murdoch 
 wrote:





On 05/01/2022 2:09 p.m., Ivan Krylov wrote:


On Wed, 5 Jan 2022 21:22:37 +0300
Ivan Krylov  wrote:


How exactly do you check for a missing argument?


To answer my own question, the check is


browser(expr = {
   is.na(w1) | is.na(ub) | is.na(m) | is.na(wi) | is.na(lb)
})


I think that there are NAs in xseg, which I don't see a check for. In
particular, a few lines above, there's


md = median( xseg, na.rm = TRUE);
if (robust) sdd = mad(xseg,na.rm = TRUE)
else sdd = sd(xseg,na.rm = TRUE)


...which seems to suggest they are expected to happen there.

Not sure which advice to give regarding the choice of file hosting
service. On the one hand, SourceForge lets you upload a whole directory
of files in arbitrary formats, but isn't very convenient do download
more than one file from. On the other hand, "pastebin" services like
http://paste.debian.net/ or http://paste.org.ru/ let us browse the code
right away, without having to look at the "Your download will start
shortly..." screen, but don't host *.RData or more than one file per
link. I guess that some other code hosting service like
SourceHut/GitHub/GitLab/Gitea/... could fulfil both criteria.



I would take one step back, and suggest that if any project has as many
scripts as this one, it should be put in an R package.  You can
distribute that by building it into a tar.gz file and putting that
single file in a place where people can download it.  Github and R-forge
work well for packages, and I assume other hosting services do too,
though I haven't used many.

People seem to be unreasonably reluctant to put their code into packages.

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] Error: if statement: missing value where TRUE/FALSE needed

2022-01-06 Thread Chuck Coleman via R-help
I've created a git repository at 
https://sourceforge.net/p/rhelp/code/ci/master/tree/.  I've used git before, so 
that's what I chose.  I had forgotten that sourceforge didn't have a download 
all files command.  I don't post files often.

About the semantics of "crash":  Perhaps I'm showing my age here.  It used to 
be that programs crashed, bombed, etc. when they hit unanticipated errors.  
These programs lived in a OS without an intermediary.  Now, we have programs of 
programs running within multiple applications on multiple servers with multiple 
OSs.  Since I'm not a programmer by profession, I've had little need to use 
these constructs.

Chuck Coleman



On Wednesday, January 5, 2022, 02:51:07 PM EST, Duncan Murdoch 
 wrote: 





On 05/01/2022 2:09 p.m., Ivan Krylov wrote:

> On Wed, 5 Jan 2022 21:22:37 +0300
> Ivan Krylov  wrote:
> 
>> How exactly do you check for a missing argument?
> 
> To answer my own question, the check is
> 
>>> browser(expr = {
>>>  is.na(w1) | is.na(ub) | is.na(m) | is.na(wi) | is.na(lb)
>>> })
> 
> I think that there are NAs in xseg, which I don't see a check for. In
> particular, a few lines above, there's
> 
>>> md = median( xseg, na.rm = TRUE);
>>> if (robust) sdd = mad(xseg,na.rm = TRUE)
>>> else sdd = sd(xseg,na.rm = TRUE)
> 
> ...which seems to suggest they are expected to happen there.
> 
> Not sure which advice to give regarding the choice of file hosting
> service. On the one hand, SourceForge lets you upload a whole directory
> of files in arbitrary formats, but isn't very convenient do download
> more than one file from. On the other hand, "pastebin" services like
> http://paste.debian.net/ or http://paste.org.ru/ let us browse the code
> right away, without having to look at the "Your download will start
> shortly..." screen, but don't host *.RData or more than one file per
> link. I guess that some other code hosting service like
> SourceHut/GitHub/GitLab/Gitea/... could fulfil both criteria.


I would take one step back, and suggest that if any project has as many 
scripts as this one, it should be put in an R package.  You can 
distribute that by building it into a tar.gz file and putting that 
single file in a place where people can download it.  Github and R-forge 
work well for packages, and I assume other hosting services do too, 
though I haven't used many.

People seem to be unreasonably reluctant to put their code into packages.

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] Information function in CRM model

2022-01-06 Thread Bert Gunter
If you haven't already done so, you should probably look here:
https://cran.r-project.org/web/views/Psychometrics.html

Further detailed discussion of the statistics is generally off topic here.
Per the posting guide (linked below):

"Questions about statistics: The R mailing lists are primarily intended for
questions and discussion about the R software. However, questions about
statistical methodology are sometimes posted. If the question is well-asked
and of interest to someone on the list, it may elicit an informative
up-to-date answer."


Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Thu, Jan 6, 2022 at 2:03 AM Cecilia Reyna  wrote:

> Dear,
>
> I am trying to model the information function of items (and full) based on
> the continuous response model.
>
> I am using the EstCRM (1.4) package, but it doesn't compute the information
> function.
>
> Another person noticed me of Wang & Zeng's paper (Item parameter estimation
> for a continuous response model using an EM algorithm, 1998, Applied
> Psychological Measurement). But I am not sure how to calculate it in R.
>
> Please, If someone has calculated that function could you share the script?
>
> Thanks in advance,
> Cecilia
>
> --
> Cecilia Reyna
> Instituto de Investigaciones Psicológicas (IIPsi) - CONICET - UNC
> Facultad de Psicología - Universidad Nacional de Córdoba
> (5000) Córdoba - ARGENTINA
> Tel. 54-351-5353890 int. 60201
>
> RACC: http://www.revistas.unc.edu.ar/index.php/racc
>
> [[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.
>

[[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] Information function in CRM model

2022-01-06 Thread Cecilia Reyna
Please, forget and delete the previous post!

Thanks!



On Thu, Jan 6, 2022 at 7:02 AM Cecilia Reyna  wrote:

> Dear,
>
> I am trying to model the information function of items (and full) based on
> the continuous response model.
>
> I am using the EstCRM (1.4) package, but it doesn't compute the
> information function.
>
> Another person noticed me of Wang & Zeng's paper (Item parameter
> estimation for a continuous response model using an EM algorithm, 1998,
> Applied Psychological Measurement). But I am not sure how to calculate it
> in R.
>
> Please, If someone has calculated that function could you share the script?
>
> Thanks in advance,
> Cecilia
>
> --
> Cecilia Reyna
> Instituto de Investigaciones Psicológicas (IIPsi) - CONICET - UNC
> Facultad de Psicología - Universidad Nacional de Córdoba
> (5000) Córdoba - ARGENTINA
> Tel. 54-351-5353890 int. 60201
>
> RACC: http://www.revistas.unc.edu.ar/index.php/racc
>


-- 
Cecilia Reyna
Instituto de Investigaciones Psicológicas (IIPsi) - CONICET - UNC
Facultad de Psicología - Universidad Nacional de Córdoba
(5000) Córdoba - ARGENTINA
Tel. 54-351-5353890 int. 60201

RACC: http://www.revistas.unc.edu.ar/index.php/racc

[[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] [External] Re: Save a graph file use jpeg(file=file)

2022-01-06 Thread Duncan Murdoch

What Rich said will work.  Here are some details to think about:

There are two ways that snapshot3d works.  The original way takes a 
snapshot from your screen.  That will produce an image the same as what 
you see, at the same resolution.  You get this mode if you set "webshot 
= FALSE", or if you don't have the webshot2 package installed.


The newer way uses the webshot2 package.  Unfortunately that package is 
not on CRAN, so you'd need to install it using 
remotes::install_github("rstudio/webshot2") .  It requires that you have 
the Chrome browser installed (or supposedly some other browser providing 
the same libraries; I don't know what else will work).


The webshot2 package doesn't need to display on your screen, so in 
theory you can produce larger snapshots.  It can also do a better 
version of rendering:  the rgl window uses OpenGL 1.x methods, while 
webshot2 uses WebGL, which is based on a newer OpenGL version.  I find 
the font support to be better, and there are some improvements to 
shading of surfaces.  On the negative side, it can be much slower, 
especially on a complex scene, and occasionally has different bugs than 
the other display.


Finally, you don't need to use your mouse to change the window size; you 
can specify width and height in the snapshot3d() call, and the window 
will change as requested.


Duncan Murdoch


On 05/01/2022 8:32 p.m., Sorkin, John wrote:

I'll try that.

Get Outlook for iOS 

*From:* Richard M. Heiberger 
*Sent:* Wednesday, January 5, 2022 8:31:15 PM
*To:* Sorkin, John ; Duncan Murdoch 
; r-help@r-project.org (r-help@r-project.org) 


*Subject:* Re: [External] Re: [R] Save a graph file use jpeg(file=file)
you can make the rgl window full screen, and then stretch the graph to 
fill the window, and then use snapshot 3d


*From:* R-help  on behalf of Sorkin, John 


*Sent:* Wednesday, January 5, 2022 8:23:34 PM
*To:* Duncan Murdoch ; r-help@r-project.org 
(r-help@r-project.org) 

*Subject:* [External] Re: [R] Save a graph file use jpeg(file=file)
Ducan,

As always, you are very giving of your time to help R users. Thank you!

scatter3d is from the car package.

As I understand snapshot3d, it takes a screen shot and saves the 
resultant file. This implies that the resultant file will be 72 DPI. I 
need to get a higher resolution image, at least 300 DPI. Do you have any 
suggestions?


Thanks as always.

John


From: Duncan Murdoch 
Sent: Wednesday, January 5, 2022 2:58 PM
To: Sorkin, John; r-help@r-project.org (r-help@r-project.org)
Subject: Re: [R] Save a graph file use jpeg(file=file)

On 05/01/2022 2:45 p.m., Sorkin, John wrote:
I am trying to create a 3-D graph (using scatter3d) and save the graph to a file so I can insert the graph into a manuscript. I am able to create the graph. When I run the code below an RGL window opens that has the graph. The file is saved to disk after  dev.odd() runs. Unfortunately, when I open the saved file, all I see 
is a white window. Can someone tell me how to have the file so I can 
subsequently read and place the file in a paper? The problem occurs 
regardless of the format in which I try to save the file, e.g. png, tiff.



x <- 1:10
y <- 2:11
z <- y+rnorm(10)
ForGraph<-data.frame(x=x,y=y,z=z)
ForGraph

gpathj <- file.path("C:","LAL","test.jpeg")
gpathj
jpeg(file = gpathj)
par(mai = c(0.5, 0.5, 0.5, 0.5))
scatter3d(z=ForGraph$x,
    y=ForGraph$y,
    x=ForGraph$z,
    surface=FALSE,grid=TRUE,sphere.size=4
    ,xlab="Categories",ylab="ScoreRange",
    zlab="VTE Rate (%)",axis.ticks=TRUE)
dev.off()




You didn't say what package you found scatter3d in, but you did say it
opens an rgl window.  rgl doesn't use R graphics devices, so jpeg() and
the like don't work.

To save an rgl image, you use the rgl::snapshot3d() function.  It only
has support for saving to PNG format.

If you are writing your manuscript in R Markdown or knitr Rnw, there are
ways to have the file included automatically.  There have been methods
to use with Sweave as well, but those aren't being maintained:  people
should use knitr instead.

Duncan Murdoch

     [[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-helpdata=04%7C01%7Crmh%40temple.edu%7C7efac70023f74f426dda08d9d0b337b8%7C716e81efb52244738e3110bd02ccf6e5%7C0%7C0%7C637770290874513198%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000sdata=QjooPjMvPZ%2BTnPh%2B9SOISOyeGVRYFMmU2NSfkel7rug%3Dreserved=0 

[R] Information function in CRM model

2022-01-06 Thread Cecilia Reyna
Dear,

I am trying to model the information function of items (and full) based on
the continuous response model.

I am using the EstCRM (1.4) package, but it doesn't compute the information
function.

Another person noticed me of Wang & Zeng's paper (Item parameter estimation
for a continuous response model using an EM algorithm, 1998, Applied
Psychological Measurement). But I am not sure how to calculate it in R.

Please, If someone has calculated that function could you share the script?

Thanks in advance,
Cecilia

-- 
Cecilia Reyna
Instituto de Investigaciones Psicológicas (IIPsi) - CONICET - UNC
Facultad de Psicología - Universidad Nacional de Córdoba
(5000) Córdoba - ARGENTINA
Tel. 54-351-5353890 int. 60201

RACC: http://www.revistas.unc.edu.ar/index.php/racc

[[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.