Re: [R] Creating NA equivalent

2021-12-26 Thread Adrian Dușa
Responding a bit slow during holidays.
Indeed, following Ducan Murdoch's advice I created the package declared
which has a simple mechanism of attributing different interpretations for
the same NA value, within a vector.

I learned there is no need for different NA values, the built in NA is
enough. By allocating different interpretations (labels), the end result is
similar as if we had different NA values, all in base R.

This meta-information can subsequently be used for any conceivable purpose,
including what I read in this thread about censoring etc.

I hope this helps, best wishes and season's greetings,
Adrian

On Tue, 21 Dec 2021 at 21:45, Avi Gross  wrote:

> I wonder if the package Adrian Dușa created might be helpful or point you
> along the way.
>
> It was eventually named "declared"
>
> https://cran.r-project.org/web/packages/declared/index.html
>
> With a vignette here:
>
> https://cran.r-project.org/web/packages/declared/vignettes/declared.pdf
>
> I do not know if it would easily satisfy your needs but it may be a step
> along the way. A package called Haven was part of the motivation and Adrian
> wanted a way to import data from external sources that had more than one
> category of NA that sounds a bit like what you want. His functions should
> allow the creation of such data within R, as well. I am including him in
> this email if you want to contact him or he has something to say.
>
>
> -Original Message-
> From: R-help  On Behalf Of Duncan Murdoch
> Sent: Tuesday, December 21, 2021 5:26 AM
> To: Marc Girondot ; r-help@r-project.org
> Subject: Re: [R] Creating NA equivalent
>
> On 20/12/2021 11:41 p.m., Marc Girondot via R-help wrote:
> > Dear members,
> >
> > I work about dosage and some values are bellow the detection limit. I
> > would like create new "numbers" like LDL (to represent lower than
> > detection limit) and UDL (upper the detection limit) that behave like
> > NA, with the possibility to test them using for example is.LDL() or
> > is.UDL().
> >
> > Note that NA is not the same than LDL or UDL: NA represent missing data.
> > Here the data is available as LDL or UDL.
> >
> > NA is built in R language very deep... any option to create new
> > version of NA-equivalent ?
> >
>
> There was a discussion of this back in May.  Here's a link to one approach
> that I suggested:
>
>https://stat.ethz.ch/pipermail/r-devel/2021-May/080776.html
>
> Read the followup messages, I made at least one suggested improvement.
> I don't know if anyone has packaged this, but there's a later version of
> the code here:
>
>https://stackoverflow.com/a/69179441/2554330
>
> 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.
>
>

[[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] Error Awareness

2021-12-26 Thread David Winsemius



On 12/23/21 3:11 AM, Stephen H. Dawson, DSL via R-help wrote:

Hi,


I am thinking about awareness of errors when an R script runs.

My concern is I have an error-free script. I run it for months on end 
without problems. Then, something changes somewhere causing an error. 
My wonderment is how R will tell me I had an error in the script, but 
the rest of the script ran without impairment.


QUESTIONS
What are some of the more helpful options available to an R developer 
to capture errors in a script run?


What are some of the best processes to implement these more helpful 
options?


See this insight from Spencer Graves from Feb 2011 on Rhelp:

https://stat.ethz.ch/pipermail/r-help/2011-February/268512.html





Thanks,


__
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: [ESS] .Rdata not loading

2021-12-26 Thread Tony Rossini via ESS-help
However, if you did an install of RStudio , or another software package
which installs its own R (there are a few), then you downgraded R on your
system.

Emacs and ESS have nothing to do with how R loads data, only R does.  Which
is why everyone is pointing you towards R.  The error means that you are
starting a version of R which isn't the one you normally use -- unless R
corrupted the .RData file when it wrote it out.

best,
Tony


On Thu, Dec 23, 2021 at 8:28 PM Rich Shepard via ESS-help <
ess-help@r-project.org> wrote:

> On Thu, 23 Dec 2021, Tyler Smith wrote:
>
> > If this is true, then the problem is with R or your .Rdata file. One
> > plausible explanation from stackoverflow[1] is that your .Rdata file,
> being
> > quite large, may not have completely saved before R quit last time you
> used
> > it. If that's the case, there may be no solution other than
> re-generating the
> > data from scratch.
>
> Tyler,
>
> Okay. ,RData is 2,8074,080 bytes and /home has 270G available space.
>
> > Another possibility is your .Rdata was created by a version of R that's
> > different from the one you're using today. That sounds unlikely since
> you
> > haven't manually updated your R version. Is it possible an automatic
> update
> > happened over night? You could recover from this by re-installing the
> > previous version of R.
>
> Well, unless some extracomputer spirit changed the version overnight, it's
> still the same 4.1.2. :-)
>
> I'll take up this issue on the r-help mail list.
>
> Thanks, all.
>
> Happy holidays and stay well,
>
> Rich
>
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help
>


-- 
best,
-tony

blindgl...@gmail.com
Muttenz, Switzerland.
"Commit early,commit often, and commit in a repository from which we can
easily roll-back your mistakes" (AJR, 4Jan05).

Drink Coffee:  Do stupid things faster with more energy!

[[alternative HTML version deleted]]

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help