Re: [R] Error Awareness

2021-12-23 Thread Avi Gross via R-help
Stephen, It is becoming a pattern here. You have been told R allows ways to check for errors as the code is interpreted and this DOES NOT distinguish between development aspects and in the field. It does not matter if a problem is external like a required file not being in place or having a new

Re: [R] .Rdata not loading

2021-12-23 Thread Bill Dunlap
And a fourth thing to do: * dput(tail(n=20, readBin(".RData", what=raw(), n=file.size(".RData" This can show if the file got truncated. -Bill On Thu, Dec 23, 2021 at 5:25 PM Bill Dunlap wrote: > Three things you might try using R (and show the results in this email > thread): > > *

Re: [R] .Rdata not loading

2021-12-23 Thread Bill Dunlap
Three things you might try using R (and show the results in this email thread): * load(verbose=TRUE, ".RData") # see how far it gets before stopping * file.info(normalizePath(".RData")) # is this the file you think it is? * dput(readBin(".RData", what=raw(), n=100)) The last will print some hex

Re: [R] .Rdata not loading

2021-12-23 Thread Rich Shepard
On Thu, 23 Dec 2021, Jeff Newmiller wrote: This practice (saving and resuming from Rdata files) often ends badly this way. Objects that are "shared" in memory get saved as separate data and may not "fit" when re-loaded. This is why re-running from scratch should always be part of your workflow.

Re: [R] .Rdata not loading

2021-12-23 Thread Jeff Newmiller
This practice (saving and resuming from Rdata files) often ends badly this way. Objects that are "shared" in memory get saved as separate data and may not "fit" when re-loaded. This is why re-running from scratch should always be part of your workflow. There are caching approaches that track

Re: [R] Request for help in solving an optimization problem

2021-12-23 Thread Bert Gunter
1. This ia a plain text list. No html. 2. Looks like homework. We don't do homework here. 3. Please read the posting guide. This is R-Help, not "R we do your work for you." We expect posters to show us their efforts to solve their problems. (In R, not Excel of course). 4. See here for R

[R] .Rdata not loading

2021-12-23 Thread Rich Shepard
Each time I finish with a session I save the image. Today the saved image did not load and manually running 'load('.RData') fails: load('.RData') Error in load(".RData") : ReadItem: unknown type 0, perhaps written by later version of R This has not happened before. Installed is

Re: [ESS] .Rdata not loading

2021-12-23 Thread Rich Shepard via ESS-help
On Thu, 23 Dec 2021, Liz Hare wrote: Did you change your .emacs to point to thew version of ESS? Liz, Here, ~/.emacs doesn't specify the ESS version. And, in a virtual terminal R can't load the .RData file. Sigh, Rich __ ESS-help@r-project.org

Re: [ESS] .Rdata not loading

2021-12-23 Thread Tyler Smith via ESS-help
Hi Rich, ESS doesn't load data. All it does is pass commands to R. It looks like the command is getting successfully passed to R, so ESS is not likely the problem. You can confirm this by running the code in an R terminal (i.e., outside of Emacs). If the file still won't load, then you can

Re: [ESS] .Rdata not loading

2021-12-23 Thread Liz Hare via ESS-help
> than the newly upgraded 18.10.2. Hi, Rich, Did you change your .emacs to point to thew version of ESS? Liz __ ESS-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/ess-help

[R] Request for help in solving an optimization problem

2021-12-23 Thread Amarjeet Kumar
Dear All. Warm greetings to you. I need help in solving an optimization formulation in R software. I tried to solve it in excel solver but it was going up to local minimum using GRG nonlinear solving method. I thought R can help in solving this problem so I am explaining the problem in few

Re: [ESS] .Rdata not loading

2021-12-23 Thread Stephen Eglen via ESS-help
Apologies if you've already tried this, but have you tried running R on its own in a terminal? Do you get the same error then when trying to load .RData? On Thu, Dec 23 2021, Rich Shepard via ESS-help wrote: > I use R with emacs and ESS. Each time I finish with a session I save the >

Re: [ESS] .Rdata not loading

2021-12-23 Thread Rich Shepard via ESS-help
On Thu, 23 Dec 2021, Rich Shepard via ESS-help wrote: Just now I upgraded ess-17.11 to ess-18.10.2. RData still doesn't load. I re-installed R-4.1.2 and when I started ESS it still showed 17.11 rather than the newly upgraded 18.10.2. I'm stymied, beyond my R and ESS knowledge, and need to

Re: [ESS] .Rdata not loading

2021-12-23 Thread Tyler Smith via ESS-help
That doesn't look like a problem with ESS - can you load .Rdata from R running in a terminal, outside of emacs? -- plantarum.ca On Thu, Dec 23, 2021, at 12:59 PM, Rich Shepard via ESS-help wrote: > On Thu, 23 Dec 2021, Tyler Smith wrote: > >> Have you recently updated R? The error message

Re: [ESS] .Rdata not loading

2021-12-23 Thread Rich Shepard via ESS-help
On Thu, 23 Dec 2021, Tyler Smith wrote: Have you recently updated R? The error message suggests the .Rdata file was created by a different version of R than the one you are currently running. Tyler, Just now I upgraded ess-17.11 to ess-18.10.2. RData still doesn't load. Rich

Re: [ESS] .Rdata not loading

2021-12-23 Thread Tyler Smith via ESS-help
Hi Rich, Have you recently updated R? The error message suggests the .Rdata file was created by a different version of R than the one you are currently running. Best, Tyler On Thu, Dec 23 2021, Rich Shepard via ESS-help wrote: I use R with emacs and ESS. Each time I finish with a session

Re: [ESS] .Rdata not loading

2021-12-23 Thread Rich Shepard via ESS-help
On Thu, 23 Dec 2021, Tyler Smith wrote: Have you recently updated R? The error message suggests the .Rdata file was created by a different version of R than the one you are currently running. Tyler, I saw that, but nothing's changed suince 4:00 pm yesterday. -rw-r--r-- 1 rshepard users

Re: [R] Error Awareness

2021-12-23 Thread Jeff Newmiller
You still are not exhibiting signs of understanding Bert's response, and your question is vague, particularly to the extent that it could be pertinent to the R language (and therefore to the topic of this list). R itself just raises an error condition that custom tryCatch or default handling

Re: [R] Script Run Output Capturing

2021-12-23 Thread Stephen H. Dawson, DSL via R-help
Thank you, Rasmus. I appreciate the reply. *Stephen Dawson, DSL* /Executive Strategy Consultant/ Business & Technology +1 (865) 804-3454 http://www.shdawson.com On 12/23/21 10:00 AM, Rasmus Liland wrote: sink and capture.output seem useful, but I have not used them.

Re: [R] Adding SORT to UNIQUE

2021-12-23 Thread Stephen H. Dawson, DSL via R-help
Hi Duncan, Thanks for the reply. You bring much insight to the equation of the R journey. I look forward to dialoging with you. *Stephen Dawson, DSL* /Executive Strategy Consultant/ Business & Technology +1 (865) 804-3454 http://www.shdawson.com On 12/22/21 12:12

Re: [R] Adding SORT to UNIQUE

2021-12-23 Thread Stephen H. Dawson, DSL via R-help
Hi Avi, Thanks for the reply. You bring much insight to the equation of the R journey. I look forward to dialoging with you. Kindest Regards, *Stephen Dawson, DSL* /Executive Strategy Consultant/ Business & Technology +1 (865) 804-3454 http://www.shdawson.com On

Re: [R] Script Run Output Capturing

2021-12-23 Thread Stephen H. Dawson, DSL via R-help
I have not tired sink yet. I was asking for best processes by soliciting input from others who have succeeded in this effort before. My question is more conceptual in nature, a research point, to learn more about the strengths and weaknesses of options. *Stephen Dawson, DSL* /Executive

Re: [R] Error Awareness

2021-12-23 Thread Stephen H. Dawson, DSL via R-help
Hi Bert, Thanks for the reply. The use case I presented involves working code, not diagnosing a script in development. The concern is running a script where something changes outside of the script, as I stated. An example of a change is a data source changing perhaps the columns in the

Re: [R] Script Run Output Capturing

2021-12-23 Thread Bert Gunter
?sink explicitly says: "sink diverts R output to a connection (and stops such diversions)" Is this not exactly what you requested? If not, why not? Have you tried it to see? Bert Gunter On Thu, Dec 23, 2021 at 5:28 AM Stephen H. Dawson, DSL via R-help wrote: > > Nice! Thanks for the reply. >

Re: [R] Error Awareness

2021-12-23 Thread Bert Gunter
?tryCatch This list is not meant for tutorials. A web search on "find errors in R code" brought up what appeared to be many resources to address your question. Please make use of such resources before posting here. Also, please read and follow the posting gui)de linked below to find out what sort

Re: [R] Script Run Output Capturing

2021-12-23 Thread Rasmus Liland
sink and capture.output seem useful, but I have not used them. I looked into pipe() a long time ago ... __ 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] able to estimate in the excel but not in R, any suggestion?

2021-12-23 Thread jim holtman
Glad to help! Happy Holidays Thanks Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Wed, Dec 22, 2021 at 11:12 PM Marna Wagley wrote: > > Dear Jim, > Thank you very much for the help. The code seems to

Re: [R] Script Run Output Capturing

2021-12-23 Thread Stephen H. Dawson, DSL via R-help
Nice! Thanks for the reply. I will research over the next few days. https://www.ssc.wisc.edu/~hemken/Rworkshops/interface/savingoutput.html How about the sink() and capture.output() functions? Have you ever used them? *Stephen Dawson, DSL* /Executive Strategy Consultant/ Business &

Re: [R] Speed up studentized confidence intervals ?

2021-12-23 Thread Rui Barradas
Hello, The code is running very slowly because you are recreating the function in the replicate() loop and because you are creating a data.frame also in the loop. And because in the bootstrap statistic function med() you are computing the variance of yet another loop. This is probably

Re: [R] Script Run Output Capturing

2021-12-23 Thread Rasmus Liland
Dear Stephen, Maybe running R in batch mode is what you're after? E.g. running R CMD BATCH ./process/script-name.r creates ./process/script-name.Rout (or ./process/script-name.rout ?) with output of R commands and inline output, I think stderr (maybe others? Not only stdout like

[R] Error Awareness

2021-12-23 Thread Stephen H. Dawson, DSL via R-help
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

[R] Script Run Output Capturing

2021-12-23 Thread Stephen H. Dawson, DSL via R-help
Hi, I need to capture the output in a physical file when I run an R script. I would like to capture the output as a TXT file. I am thinking something along the line of the tee command is what I am after, but I am not certain what I am after here. https://en.wikipedia.org/wiki/Tee_(command)

Re: [R] Adding SORT to UNIQUE

2021-12-23 Thread Stephen H. Dawson, DSL via R-help
Yes, I saw the period character is where the problem occurred. However, I decided to loop back with the poster to close the discussion loop. *Stephen Dawson, DSL* /Executive Strategy Consultant/ Business & Technology +1 (865) 804-3454 http://www.shdawson.com On