[R] post tweets with media attachment - and with retirement of rtweet

2023-06-24 Thread Michael Ashton
All - I run an automated script that pulls in some market data, makes some charts, and posts them to twitter. A couple of them per day, and then once per month there's a little flurry around the CPI report. For a while rtweet() worked great. Then v2 happened and Oauth2.0. The package broke, wa

Re: [R] struggling with apply

2020-05-27 Thread Michael Ashton
pply/seq_along. sapply(seq_along(UB), function(i) pmin(UB[i], somematrix[,i])) # [,1] [,2] [,3] [,4] #[1,] 1.0 5.5 8.5 7.0 #[2,] 2.5 3.0 8.0 10.5 #[3,] 2.5 5.5 5.0 10.5 Hope this helps, Rui Barradas Às 18:46 de 27/05/20, Michael Ashton escreveu: Hi - I have a matrix of n rows and

Re: [R] struggling with apply

2020-05-27 Thread Michael Ashton
Always amazes me how many ways there are to do these things, none of which I was able to find myself. Thanks! I think the key here was ‘pmin,’ which I didn’t know before. Michael Ashton, CFA Managing Principal Enduring Investments LLC W: 973.457.4602 C: 551.655.8006 Schedule a Call: https

Re: [R] struggling with apply

2020-05-27 Thread Michael Ashton
That's it! Thanks. Learn something new every day! Michael Ashton, CFA Managing Principal Enduring Investments LLC W: 973.457.4602 C: 551.655.8006 Schedule a Call: https://calendly.com/m-ashton -Original Message- From: Rui Barradas [mailto:ruipbarra...@sapo.pt] Sent: Wednesday, M

[R] struggling with apply

2020-05-27 Thread Michael Ashton
[,1] [,2] [,3] [,4] [1,] 1.0 2.5 2.5 2.5 [2,] 2.5 2.5 2.5 2.5 [3,] 2.5 2.5 2.5 2.5 I'm sure there's a simple and elegant solution but I don't know what it is! Thanks in advance, Mike Michael Ashton, CFA Managing Principal Enduring Investments LLC W: 973.457.46

Re: [R] adding overall constraint in optim()

2018-05-03 Thread Michael Ashton
t)) >> >> LowerBounds<-c(0.2,0.05,0.1,0,0,0) >> UpperBounds<-c(0.6,0.3,0.6,0.15,0.1,0.2) >> >> OptimSolution<-optim(wgt.vect, fn=opt.fun, >> method="L-BFGS-B",lower=LowerBounds,upper=UpperBounds) >> >> >> Any thought

[R] adding overall constraint in optim()

2018-05-03 Thread Michael Ashton
(t(wgt.vect) %*% (cov.mat %*% wgt.vect)) LowerBounds<-c(0.2,0.05,0.1,0,0,0) UpperBounds<-c(0.6,0.3,0.6,0.15,0.1,0.2) OptimSolution<-optim(wgt.vect, fn=opt.fun, method="L-BFGS-B",lower=LowerBounds,upper=UpperBounds) Any thoughts are appreciated! Mike Michael

Re: [R] RExcel issues

2018-03-01 Thread Michael Ashton
Thanks though - didn’t know there was that ecosystem. I will try that list. > On Mar 1, 2018, at 5:37 PM, David Winsemius wrote: > > >> On Mar 1, 2018, at 2:02 PM, Michael Ashton >> wrote: >> >> Hi - >> >> For a while I've used RE

Re: [R] RExcel issues

2018-03-01 Thread Michael Ashton
No, this is home use. I wasn’t even aware there was a commercial license. > On Mar 1, 2018, at 5:37 PM, David Winsemius wrote: > > >> On Mar 1, 2018, at 2:02 PM, Michael Ashton >> wrote: >> >> Hi - >> >> For a while I've used RE

[R] RExcel issues

2018-03-01 Thread Michael Ashton
with Rexcel? I've updated Rexcel to 3.2.16 but it made no difference. Any suggestions of what to try will be warmly entertained! Thanks, Mike Michael Ashton, CFA Managing Principal Enduring Investments LLC W: 973.457.4602 C: 551.655.8006 [[alternative HTML version deleted]]

Re: [R] command line fails

2018-02-02 Thread Michael Ashton
Thans Dan. It seems that it may be an issue with 3.4.3...I'm going to attempt a patch this weekend. The code works fine from the command line in 3.2.5! Michael Ashton, CFA Managing Principal Enduring Investments LLC W: 973.457.4602 C: 551.655.8006 -Original Message- From: D

Re: [R] command line fails

2018-02-02 Thread Michael Ashton
Fascinating. The script runs fine in 3.2.5, but won't run in 3.4.3 even with ALL lines commented out. I have no idea what that means. I can't imagine I found a 3.4.3 bug no one knows about. Michael Ashton, CFA Managing Principal Enduring Investments LLC W: 973.457.4602 C: 55

Re: [R] command line fails

2018-02-02 Thread Michael Ashton
id that, I did TRY reversing the slashes and got the same result. :-) Michael Ashton, CFA Managing Principal Enduring Investments LLC W: 973.457.4602 C: 551.655.8006 -Original Message- From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com] Sent: Friday, February 02, 2018 8:16 AM T

[R] command line fails

2018-02-02 Thread Michael Ashton
ript.exe "P:\Investments\Trading Tools\RV Tools\myfile.r" And again, it executes perfectly if I open the GUI first and then run it within R. Thanks for the help! Mike Michael Ashton, CFA Managing Principal Enduring Investments LLC W: 973.457.4602 C: 551.655.8006

Re: [R] Simple control structure issue

2017-06-23 Thread Michael Ashton
SONOFAGUN…I’m a bit embarrassed. Thanks Bill! From: William Dunlap [mailto:wdun...@tibco.com] Sent: Friday, June 23, 2017 6:15 PM To: Michael Ashton Cc: r-help@r-project.org Subject: Re: [R] Simple control structure issue R is a case-sensitive language: 'if' (lowercase 'i')

[R] Simple control structure issue

2017-06-23 Thread Michael Ashton
I am having a hard time with 'next'. I come from the "sloppy" school that learned BASIC with Goto. Conceptually next seems pretty straightforward. I just can't get it to work correctly in my code. Here's a stripped down version: WhichRunNow<-"Daily" Cnums=c(0,1,"2b3") Cpers=c("Daily","Daily","W

[R] getting a subset corresponding to a list element

2017-05-26 Thread Michael Ashton
I'm not sure how to ask this with the proper terminology, but here goes: The BDH() function in RBLPAPI returns, for a list of symbols (e.g., 'SPX Index','RIY Index','IBM Equity') a list of closing prices. The problem is that the result is not a matrix or a dataframe, but a list. So, if I run th

[R] dev.new() throws error from command line

2016-03-19 Thread Michael Ashton
the case I still can't figure out why there's suddenly a problem finding "unused file names." Any suggestions would be welcome! Thanks, Mike Michael Ashton, CFA Managing Principal Enduring Investments LLC W: 973.457.4602 C: 551.655.8006 T

Re: [R] Attaching a pdf file to an email generated with sendmailR?

2015-10-09 Thread Michael Ashton
must > not, directly or indirectly, use, disclose, distribute, > print or copy any part of this message or any attachments if you are not > the intended recipient. > > > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Michael Ashton > Se

Re: [R] Attaching a pdf file to an email generated with sendmailR?

2015-10-08 Thread Michael Ashton
nd password in parameter smtp as follows: smtp = list(host.name<http://host.name> = "smtp.X", port = X, user.name<http://user.name> = "X", passwd = "X", ssl = X) 2015-10-08 18:49 GMT+02:00 Michael Ashton mailto:m.ash...@enduringinvestments

[R] Attaching a pdf file to an email generated with sendmailR?

2015-10-08 Thread Michael Ashton
For some time I have been using sendmailR to generate a simple message when a report was done running. Recently, I started adding a couple of pertinent statistics in the body of the email. Now, I've finally decided that what the heck, I ought to simply attach the report itself to the email. Th