Re: [R] refresh.console() function?

2024-03-13 Thread Enrico Schumann
ame? > ?flush.console ... but you'll need to print/message/cat/... explicitly in the loop, or the output won't be shown. [Also, options(warn=1) might be useful.] -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ R-he

Re: [R] Basic astronomy package recommendation wanted.

2024-01-30 Thread Enrico Schumann
't use any of those packages) Perhaps also worth asking at: https://stat.ethz.ch/mailman/listinfo/R-SIG-Geo/ -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see h

Re: [R] replace character by numeric value

2023-09-28 Thread Enrico Schumann
<- c(BUY = 1, SELL = -1) mydf1$side <- map[mydf1$side] str(mydf1) ## Classes ‘data.table’ and 'data.frame': 1 obs. of 4 variables: ## $ symbol : chr "ETHUSDT" ## $ cummulative_quote_qty: num 2000 ## $ side : num 1

Re: [R] Noisy objective functions

2023-08-14 Thread Enrico Schumann
t( nP = 100, nG = 500, min = rep( 5, 5), max = rep( 10, 5))) ofv.below.threshold[i] <- sol$OFvalue < 1e-6 } sum(ofv.below.threshold)/length(ofv.below.threshold) (These 50 runs take less than half a minute on my machine.)

Re: [R] Merge with closest (not equal) time stamps

2023-08-08 Thread Enrico Schumann
cbind(option.trades, stock.trades[i, ]) ## timestamp option.price timestamp stock.price ## 1 2023-08-07 10:23:22 2.5 2023-08-07 10:23:21 102.2 ## 3 2023-08-07 10:25:33 2.7 2023-08-07 10:24:57 103.1 ## 4 2023-08-07 10:2

Re: [R] Cryptic error from stargazer

2023-06-08 Thread Enrico Schumann
/Kolkata >> tzcode source: system (glibc) >> >> attached base packages: >> [1] stats graphics grDevices utils datasets methods base >> >> other attached packages: >> [1] stargazer_5.2.2 >> >> loaded via a namespace (and not attached): >> [1] compiler_4.3.0 >> >&

Re: [R] wininet deprecation

2023-02-21 Thread Enrico Schumann
ill > (given that wininet has done the trick nicely up to > now), but at least it works. > > HTH. > > \Gisbert There is also the miniCRAN package (https://cran.r-project.org/package=miniCRAN). -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net _

Re: [R] gmp::bigq vs. MASS::fractions

2023-01-09 Thread Enrico Schumann
ns directly: gmp::as.bigq(n = 0:7, d = 7) ## Big Rational ('bigq') object of length 8: ## [1] 0 1/7 2/7 3/7 4/7 5/7 6/7 1 -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ R-help@r-project.org mailing list -- To UNS

Re: [R] Rate of Reading into R from net

2022-11-14 Thread Enrico Schumann
b)is there (I can't find > anything) within R which allows me to monitor the progress of the download, > if in fact it is taking place? > Thanks Nick Wray > Have you tried 'download.file'? It should provide a progress bar if the file size is known. I'd

Re: [R] Robust standard error

2022-10-02 Thread Enrico Schumann
nse here, but generally speaking, this list is > about R **programming**, and statistical issues/tutorials are off topic. > You might try > https://stackoverflow.com/questions/tagged/statistics > if you don't get adequate help here. > > -- Bert

Re: [R] Fwd: Reading very large text files into R

2022-09-29 Thread Enrico Schumann
;> https://eco.bigelow.org >> > Maybe I have missed it, but could you please show how you tried to read the table? When I use your file with read.table("sample text.txt", header = FALSE, sep = ",") I get ## V1 V2V3 V4 V5

Re: [R] Question about Line Ending Choice

2022-09-29 Thread Enrico Schumann
tion within R. > > QUESTION > Is it possible within R to define the line ending aspect of file output? > > > Kindest Regards, Just a remark: there is a "standard" for CSV, https://datatracker.ietf.org/doc/html/rfc4180. It always requires C

Re: [R] Unicode chars

2022-08-25 Thread Enrico Schumann
) that your TeX distribution provides. If this is a vignette, you can specify a Makefile, see https://cran.r-project.org/doc/manuals/R-exts.html#Writing-package-vignettes > > > [[alternative HTML version deleted]] > > __ >

Re: [R] What are the pros and cons of the various R functions and methods for conducting least median of squares regression analysis?

2022-04-17 Thread Enrico Schumann
d: you'd probably get better answers if you ask more specific questions, e.g. why/for what application you want to use LMS. -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more,

Re: [R] R vs Numpy

2021-10-28 Thread Enrico Schumann
also of interest: https://github.com/matloff/R-vs.-Python-for-Data-Science -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help

[R] [R-pkgs] NMOF 2.5-0 (Numerical Methods and Optimization in Finance)

2021-10-21 Thread Enrico Schumann
Maringer and Enrico Schumann.[1] Since the last announcement on this list, functionality has been added to the package, e.g. for computing minimum-CVaR and tracking portfolios, or downloading IPO data. See the NEWS file [2] for all changes. The documentation has also been expanded. Comments

Re: [R] Do not show a "message d'avis" that qbeta reports

2021-10-20 Thread Enrico Schumann
eta(p = c(0.025, 0.975), shape1 = 3.3108797, shape2 = 1e-07) : >   qbeta(a, *) =: x0 with |pbeta(x0,*) - alpha| = 0.024997 is not accurate > Try 'suppressWarnings'. -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ R-help@

Re: [R] Extracting Comments from Functions/Packages

2021-10-07 Thread Enrico Schumann
if(length(npos[[1]]) == 0) return(character(0)); >     strip.FUN = if(strip) { >             function(id) { >                 if(npos[[1]][[id]] + 1 < npos[[2]][[id]]) { >                     nStart = npos[[1]][[id]] + 1; >                     nE

Re: [R] read.csv() error

2021-09-02 Thread Enrico Schumann
meric(df$b) ## Error in `$<-.data.frame`(`*tmp*`, b, value = numeric(0)) : ## replacement has 0 rows, data has 5 -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ R-help@r-project.org mailing list -- To UNSUBSCRIB

Re: [R] read.csv() error

2021-09-02 Thread Enrico Schumann
nderstand this error because the equivalent commands for another > data source file completes without error. > > What is that error message telling me? > > TIA, > > Rich > There is no column 'ht'. -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net _

Re: [R] Show only header of str() function

2021-09-02 Thread Enrico Schumann
from 'str.data.frame'). Then: class(iris) <- c("data.frame.oneline", class(iris)) str(iris) ## 'data.frame': 150 obs. of 5 variables str(list(a = 1, list(b = 2, c = iris))) ## List of 2 ## $ a: num 1 ## $ :List

Re: [R] Converting characters back to Date and Time

2021-08-31 Thread Enrico Schumann
t;2018-06-18 12:00:00 CEST" Note that the times differ: the numbers are probably not /displayed/ to full precision in R. You may also want to search the archives of this list, as this question has been discussed before. -- Enrico Schumann (maintainer of package datetimeutils) Lucerne, Swit

Re: [R] coercion to an object...

2021-08-29 Thread Enrico Schumann
A <- 42 get("A") ## [1] 42 > Thank you, > Yours sincerely, > AKSHAY M KULKARNI > -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see h

Re: [ESS] [OT] Enabled a hook and no longer find which

2021-08-03 Thread Enrico Schumann via ESS-help
/leoliu/ggtags]? I think it automatically updates tag files per default (see 'ggtags-update-on-save') Good luck. -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ ESS-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/ess-help

Re: [R] Unexpected date format coercion

2021-07-01 Thread Enrico Schumann
t(s, "[-]") year <- as.numeric(sapply(tmp, `[[`, 1)) valid.year <- year < 2500 & year > 1800 month <- as.numeric(sapply(tmp, `[[`, 2)) valid.month <- month >= 0 & month <= 12 day <- as.numeric(sapply(tmp

Re: [R] Finding the package providing funtion "%du%"

2021-06-30 Thread Enrico Schumann
> generics_0.1.0 > [10] ellipsis_0.3.2 tools_4.1.0 glue_1.4.2 purrr_0.3.4 > compiler_4.1.0 pkgconfig_2.0.3 tidyselect_1.1.1 tibble_3.1.2 > > > > > > > > -- > Federico Calboli > LBEG - Laboratory of Biodiversity and Evolutionary Genomics

Re: [R] Date Time, as.POSIXct used locale, strange plot behavior

2021-04-30 Thread Enrico Schumann
; # [1] "2021-04-21 CEST" >>> as.POSIXct("2021-04-21 00:00:00") >>> # [1] "2021-04-21 CEST" >>> >>> all representations on my system are the same, why is the plot location >>> of the arrows different?? >>> I am located in Germany, my locale: >

Re: [R] union of two sets are smaller than one set?

2021-01-31 Thread Enrico Schumann
66608+59387. > However it is 681193 which is less that number of elements in s1! > >> length(base::union(s1, s2)) > [1] 681193 > > Any hints? > > Regards > Martin > Duplicates? kind regards Enrico -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net

Re: [R] FREDR and R 3.6

2020-10-30 Thread Enrico Schumann
this on the fredr information package and > was wondering if anyone here might know? > Just for completeness: there is also the 'alfred' package (https://cran.r-project.org/package=alfred), with which you can also access data of the St. Louis Fed. -- Enrico Schumann Lucerne, Switzerland h

Re: [R] How to convert column from millisecond epoch time to yyyy-mm-dd GMT

2020-06-23 Thread Enrico Schumann
   0 > 4: INCBR0005074186 157705920 itsm-ticket U    0 > 5: INCBR0005074188 157705920 itsm-ticket U    0 > 6: INCBR0005074546 157705920 itsm-ticket U    0 > You should divide by 1000: .POSIXct(157705920

Re: [R] Output multiple sheets to Excel files with openxlsx::write.xlsx

2020-05-27 Thread Enrico Schumann
:3, b = 4:6) library("openxlsx") wb <- createWorkbook() sheet <- "sheet1" addWorksheet(wb, sheet) writeData(wb, sheet = sheet, x = df) sheet <- "sheet2" addWorksheet(wb, sheet) writeDa

Re: [R] Date from text

2020-05-15 Thread Enrico Schumann
the date completely, the returned answer may be system-specific." So perhaps try something like as.Date(paste0("01-", "11-1993"), format = "%d-%m-%Y") ## [1] "1993-11-01" Or look at 'yearmon' in package 'zoo': library(

Re: [R] Sometimes commands do not terminate after upgrading to R 4.0 and Ubuntu 20.04

2020-05-10 Thread Enrico Schumann
as been a discussion on R-SIG-Debian recently, and /perhaps/ it is related to your troubles. See https://stat.ethz.ch/pipermail/r-sig-debian/2020-April/003159.html and in particular https://stat.ethz.ch/pipermail/r-sig-debian/2020-April/003166.html . -- Enrico Schumann Lucerne, Switzerland http

Re: [R] Convert Long DOY time format to yyyymmdd hh format

2020-01-23 Thread Enrico Schumann
er = FALSE, sep = " ") -> data as.POSIXct(paste(as.Date(paste0(data[[1]], "-1-1")) + data[[2]] - 1, data[[3]]), format = "%Y-%m-%d %H") You might want to specify a different timezone, and also check for "off-by-one" error wh

Re: [R] Reporting missing dates

2020-01-16 Thread Enrico Schumann
hat shows that the second date is followed by one missing day. Duncan Murdoch But you might want to check if the dates in 'd' are really sorted. -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ R-help@r-project.org mai

Re: [R] Incorrect Conversion of Datetime

2020-01-08 Thread Enrico Schumann
6480 ## 6 98 1 57 6457 The data that you read in has January (1) as month. So whatever goes wrong, seems to go wrong when you read the data. Are you quite sure you read the file you read is the file you have shown? kind regards Enrico Ogbos> On W

Re: [R] Incorrect Conversion of Datetime

2020-01-08 Thread Enrico Schumann
:00 GMT" "1998-01-06 05:00:00 GMT" [29] "1998-01-06 06:00:00 GMT" This seems to suggest day 5 and 6 in January 1998 instead of day 1 and 2 in May of 1998. I have spent some time trying to resolve this but I have not been successful. I would be thankful if you could help me to ch

Re: [R] outer join of xts's

2020-01-02 Thread Enrico Schumann
an attribute 'timestamp', from which you could create an xts object again. I am not sure if it is the fastest way, but it's probably faster than calling merge repeatedly. kind regards Enrico (the maintainer of PMwR) -- Enrico Schumann Lucerne, Switzerland http://enric

Re: [R] date

2019-12-19 Thread Enrico Schumann
d this >> >> gs$d1 = as.Date(as.character(gs$date), format = "%Y-%m-%d") >> >> >> >> but I got NA's. >> >> >> >> How do I get my desired result? >> >> Thank you. >> >> >>

Re: [R] class of 'try' if error is raised

2019-12-15 Thread Enrico Schumann
correct result class HW> instead of an error? HW> Thanks, HW You should probably use if (inherits(e, "try-error")) { # ... do something } kind regards ENrico -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net

[R] [R-pkgs] NMOF 2.0-1 (Numerical Methods and Optimization in Finance)

2019-10-22 Thread Enrico Schumann
Dear all, version 2.0-1 of package NMOF is on CRAN now. NMOF stands for 'Numerical Methods and Optimization in Finance', and it accompanies the book with the same name, written by Manfred Gilli, Dietmar Maringer and Enrico Schumann.[1] The new version of the package provides all R code

Re: [R] Strange behaviour of sapply function.

2019-09-12 Thread Enrico Schumann
1 2 3 4 5 6 7 8 9 10 str(sapply(-5:5, f)) ## List of 11 ## $ : int(0) ## $ : int(0) ## $ : int(0) ## $ : int(0) ## $ : int(0) ## $ : int(0) ## $ : int 1 ## $ : int 2 ## $ : int 3 ## $ : int 4 ## $ : int 5 -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net ___

Re: [R] Creating a web site checker using R

2019-08-09 Thread Enrico Schumann
pose you work on a Unix-like system, and you likely have a programme called 'wget' either installed or can easily install it. 'wget' has an option 'mirror', which allows you to mirror a website. 2) There is tools::md5sum for computing checksums. You

Re: [R] Open a file which name contains a tilde

2019-06-06 Thread Enrico Schumann
Quoting Frank Schwidom : On 2019-06-05 20:32:07, Enrico Schumann wrote: >>>>> "FS" == Frank Schwidom writes: FS> Hi, FS> As I can see via path.expand a filename which contains a FS> tilde anywhere gets automatically crippled. FS&g

Re: [R] Open a file which name contains a tilde

2019-06-05 Thread Enrico Schumann
gt; How can I switch off any file crippling activity? FS> Kind regards, FS> Frank Do you need 'path.expand'? For example, readLines("~/Desktop/a ~ b") reads just fine the content of a file named 'a ~ b' on my desktop. -- Enrico Schumann Lucerne, Switzerland http://enri

Re: [R] How to generate mutiple set of samples in R?

2019-06-05 Thread Enrico Schumann via R-help
this guide and follow its advice. MT> and provide commented, minimal, self-contained, reproducible code. -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see h

Re: [R] Complete month name from as.yearmon()

2019-04-13 Thread Enrico Schumann
his gives: [1] "Apr 2019". CB> How can I extract the full name ie. 'April 2019' CB> Appreciate your pointer. Thanks, library("zoo") ## where 'as.yearmon' comes from format(as.yearmon(Sys.Date()), "%B %Y") ## [1] "April 2019" Note

Re: [R] large number of scrollable histograms....

2019-01-22 Thread Enrico Schumann
tance need less space (and if you sort the input data by median, say, they often help much better to see differences between samples); or use similar plots such as quartile plots (e.g. https://cran.r-project.org/web/packages/NMOF/vignettes/qTableEx.pdf ). kind re

Re: [R] time mathematics

2018-11-20 Thread Enrico Schumann
s it possible without any additional package ? > > > Kind Regards Knut > Like so? start <- "23:01:18" Y <- 1:5 tmp <- as.POSIXct(paste(Sys.Date(), start)) tmp <- tmp + seq(from = 0, length.out = length(Y)) format(tmp, "%H:%M:%S")

Re: [R] sub/grep question: extract year

2018-08-09 Thread Enrico Schumann
9])[ \\.\\)-].*", "\\1", subtext) # return 2010 but subtext <- "bla 1010 bla" sub(".*[ \\.\\(-]([12][01289][0-9][0-9])[ \\.\\)-].*", "\\1", subtext) # return 1010 I would like exclude the case 1010 and other like this. The solution would be:

Re: [R] loop over matrix: subscript out of bounds

2018-08-06 Thread Enrico Schumann
nrow(myMatrix)) { for(i in 1:ncol(myMatrix)) { myMatrix[i,i] = -1 myMatrix[i,i+1] = 1 }} print(myMatrix) Thanks in advance! Perhaps you do not need loops at all? myMatrix <- matrix(0, 5, 12) diag(myMatrix) <- -1 diag(myMatrix[, -1]) <- 1 -- Enrico Schumann Luc

Re: [R] dbGetQuery() returns wrong value

2018-07-31 Thread Enrico Schumann
__ 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. -- Enrico Schuman

Re: [R] Zoo changing time-zone when I merge 2 zoo time series

2018-07-19 Thread Enrico Schumann
61 ## 2017-12-07 08:41:00 17600.00 15770.00 ## 2017-12-07 08:42:00 17593.00 15750.00 ## 2017-12-07 08:43:00 17630.01 15770.00 See Ripley, B. D. and Hornik, K. (2001) Date-time classes. R News, 1/2, 8–11. https://www.r-project.org/doc/Rnews/Rnews_2001-2.pdf -- Enrico Schumann Lucerne, S

Re: [R] bracketing for optimize

2018-05-31 Thread Enrico Schumann
entation. (Presumably, this is used in > nlm, too; alas, nlm is in C, not native R.) regards, /iaw > There is a 'bracketing' function in package NMOF, though it is for root-finding (i.e. for optimising you would need the derivative). -- Enrico Schumann (the maintainer of NMO

Re: [R] command line fails

2018-02-02 Thread Enrico Schumann
build (i.e. a complete version, not just the patch) is available from the same CRAN site at which you find the official release; just further below. > -----Original Message- > From: Enrico Schumann [mailto:e...@enricoschumann.net] > Sent: Friday, February 02, 2018 10:36 AM > To: Mic

Re: [R] command line fails

2018-02-02 Thread Enrico Schumann
html and provide commented, minimal, self-contained, reproducible code. -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] How to programmatically save a web-page using R (mimicking Command+S)

2018-01-14 Thread Enrico Schumann
site. It is usually available by default on Unix-style systems; I am sure there is a version for Mac. If you insist on using R, you could write a simple wrapper, using ?system or ?system2. -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net ___

Re: [R] Generating help files for a function

2017-12-16 Thread Enrico Schumann
m now putting in it the package. Not a problem. But the > problem is the help file. What is the best way to generate a help file > "after the fact" like that, please? > > Thank you in advance. Hope everyone is enjoying various holidays. > > Sincerely, > Eri

[R] [R-pkgs] NMOF 1.2-2 (Numerical Methods and Optimization in Finance)

2017-10-24 Thread Enrico Schumann
Dear all, version 1.2-2 of package NMOF is on CRAN now. NMOF stands for 'Numerical Methods and Optimization in Finance'. The package provides R code and datasets for the book with the same name, written by Manfred Gilli, Dietmar Maringer and Enrico Schumann, published by Elsevier/Academic Press

Re: [R] Select part of character row name in a data frame

2017-10-19 Thread Enrico Schumann
nks for any help you can provide. -- Francesca Pancotto, PhD Use ?grep or ?grepl: df[grep("strat", row.names(df)), ] (in which 'df' is your data frame) -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net

Re: [ESS] [R] M-x R gives no choice of starting dir

2017-09-11 Thread Enrico Schumann
? There is a variable called 'ess-ask-for-ess-directory', which controls whether M-x R prompts for a directory. Perhaps you have set this to nil? I also Cc the ESS-help mailing list and suggest that follow-up be sent there. Kind regards Enrico -- Enrico Schumann Lucerne, Switzerland http

Re: [R] Packages for Learning Algorithm Independent Branch and Bound for Feature Selection

2017-07-03 Thread Enrico Schumann
egards (and good luck) Enrico Schumann [*] Which does not mean it has not found it. I will take a look at that page, thanks! Hopefully there is an R implementation of generic B as I described out there somewhere... Alex Byrley Graduate Student Department of Electrical Engineering 235 Davi

Re: [R] Packages for Learning Algorithm Independent Branch and Bound for Feature Selection

2017-07-01 Thread Enrico Schumann
also look at heuristic algorithms that can deal with such problems (e.g. genetic algorithms). -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://sta

Re: [R] Can I use tabu search for minimization problem ?

2017-06-20 Thread Enrico Schumann
maxNontaboo & tabuList == 0), 1))) this cause the 0 value. How can I use it to get my minimization value using tabu search in R ? Thanks . If you want people to help you, provide a minimal (or, at least, small) reproducible code example. In particular, tell people what package(s) you are usin

Re: [R] regular expression help

2017-06-08 Thread Enrico Schumann
acter. test <- "hello\n1" regexpr(".*[0-9]", test) ## [1] 1 ## attr(,"match.length") ## [1] 7 ## attr(,"useBytes") ## [1] TRUE regexpr(".*[0-9]", test, perl = TRUE) ## [1] 7 ## attr(,&q

Re: [R] Setting up a .Rprofile file

2017-03-24 Thread Enrico Schumann
ot; But maybe I am completely misunderstanding what you mean Kind regards Enrico > > >> On Mar 24, 2017, at 3:48 AM, Enrico Schumann <e...@enricoschumann.net> wrote: >> >> On Thu, 23 Mar 2017, Bruce Ratner PhD writes: >> >>> Hi R'ers:

Re: [R] Setting up a .Rprofile file

2017-03-24 Thread Enrico Schumann
ilde expansion will be | performed). If this is unset, a file called | ‘.Rprofile’ is searched for in the current directory | or in the user's home directory (in that order). The | user profile file is sourced into the workspace. ` -- Enrico Schumann Lucerne, Switzerland http://enricoschuman

Re: [R] Data and Variables from Tables

2017-03-21 Thread Enrico Schumann
= TRUE) for (i in seq_len(nrow(df))) assign(df[i, "Symbol"], df[i, "Value"]) But depending on what you want to do, it may be cleaner/safer to keep the variables from the table together in a list. tbl <- as.list(df[["Value"]])

[R] [R-pkgs] NMOF 0.40-0 (Numerical Methods and Optimization in Finance)

2016-10-26 Thread Enrico Schumann
Dear all, version 0.40-0 of package NMOF is on CRAN now, 5 years (exactly) after its first release on CRAN. 'NMOF' stands for 'Numerical Methods and Optimization in Finance'. The package accompanies the book with the same name, written by Manfred Gilli, Dietmar Maringer and Enrico Schumann

Re: [R] Output formatting in PDF

2016-10-11 Thread Enrico Schumann
ever, I don't know how to manage the > formatting part though, so that the 1-pager output looks decently > presentable. Thanks. > > Regards, > Preetam If using LaTeX is an option, I would suggest ?Sweave. There are many tutorials on the web that should get you started. -- Enrico Sc

Re: [R] Least Median Square Regression

2016-10-08 Thread Enrico Schumann
how to compute 'manually' an LMS-regression, i.e. how to do the actual optimisation. > >> On Oct 8, 2016, at 6:17 AM, Enrico Schumann <e...@enricoschumann.net> wrote: >> >> On Sat, 08 Oct 2016, Bryan Mac <bryanmac...@gmail.com> writes: >> >>> Hi R-hel

Re: [R] Least Median Square Regression

2016-10-08 Thread Enrico Schumann
> model to use? > > Bryan Mac > bryanmac...@gmail.com > A tutorial on how to run such regressions is included in the NMOF package. https://cran.r-project.org/package=NMOF/vignettes/PSlms.pdf -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net ___

Re: [R] Faster Subsetting

2016-09-28 Thread Enrico Schumann
s typically faster to first extract the component of interest, i.e. the specific column, and then to subset this vector. The result will, of course, be a vector, not a data.frame.) -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ R

Re: [R] Help with strftime error "character string is not in a standard unambiguous format"

2016-09-12 Thread Enrico Schumann
via a namespace (and not attached): > [1] compiler_3.3.1 tools_3.3.1 >> > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do

Re: [R] get start and end date of ISO weeks giving a date as input

2016-09-08 Thread Enrico Schumann
titute > http://fourier.networks.imdea.org/people/~luis_nunez/ > > On 09/08/2016 12:13 PM, Veronica Andreo wrote: > > Hello list, > > Is there a quick way to get start and end date (%Y-%m-%d) from ISO > weeks if I only have dates? >

Re: [R] get start and end date of ISO weeks giving a date as input

2016-09-08 Thread Enrico Schumann
tput: date week starts ends 1 2010-08-21 33 2010-08-16 2010-08-22 2 2016-08-01 31 2016-08-01 2016-08-07 -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and

Re: [R] Help with constrained portfolio optimization

2016-07-09 Thread Enrico Schumann
:5])## check sum-of-weights constraint w %*% m >= rd ## check return constraint summary(w) ## check holding size constraint -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ R-help@r-project.org mailing list -- To UNSUBSCRI

Re: [R] filter a data.frame in dependence of a column value

2016-06-17 Thread Enrico Schumann
tead of %in%. x <- c("for Mr. Muller (10.0 -> 11.2)", "for Mr Giulani", "for Mr. Marius (11.2 -> 12)") grepl("[(].*->.*[)]", x) -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net ___

Re: [R] Query about use of format in strptime

2016-04-11 Thread Enrico Schumann
ect printed in a particular way, use ?strftime or ?format. > format(strptime(init_day, format="%Y-%m-%d-%H-%M"), "%Y-%m-%d-%H-%M") ## [1] "2015-02-24-00-00" -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net _

Re: [R] Optimization Grid Search Slow

2015-09-18 Thread Enrico Schumann
subjectFits <- 0; subLogLike <- 0; bestTemp <- 0; bestDelta= 0; > > min = 0.001; max = .5; inc = 0.001; > deltaList = seq(min, max, inc) > mina = 0; maxa = 5; inca = .01 > amList = seq(mina, maxa, inca) > maxLogValue <- -1000 > for(delta in deltaList){ > for(te

Re: [R] Fast multiple match function

2015-04-07 Thread Enrico Schumann
be a vector of length 1. In any case, have you actually tried package 'fastmatch'? The function 'fmatch', which that package provides, is very fast for repeated lookups in a table 'v'. -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net

Re: [R] split a string a keep the last part

2014-08-28 Thread Enrico Schumann
it? Thanks. Jun This should work for your example: gsub(.*-([^-]*)$, \\1, test) -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] legendre quadrature

2014-05-01 Thread Enrico Schumann
-- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide

Re: [R] Getting a particular weekday for a given month

2014-04-07 Thread Enrico Schumann
are on a Unix-type system (or have Rtools installed on Windows), you can directly install the package from source: install.packages('PMwR', repos = 'http://enricoschumann.net/R', type = 'source') Regards, Enrico -- Enrico Schumann Lucerne, Switzerland

Re: [R] Environmental problems.

2014-02-25 Thread Enrico Schumann
an environment ... info - new.env() info$tt - 0 ## ... and pass it as an argument myfun -function(e) { e$tt - e$tt + 1 cat(Iteration , e$tt, \n) } outer(myfun, info) info$tt -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net

Re: [R] Selecting individuals to maximize the correlation of two variables

2014-01-11 Thread Enrico Schumann
-- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ R-help@r-project.org mailing list 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

Re: [R] How can I find nonstandard or control characters in a large file?

2013-12-09 Thread Enrico Schumann
and caveats on the functions' help pages.) -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org

Re: [R] save table to txt file in a printable form

2013-11-19 Thread Enrico Schumann
] [2,] 1.0601385 -0.2378076 0.2078081 # [4] [3,] 0.7278065 -0.1279776 -1.1674676 # [5] [4,] 1.3321629 -1.4082142 0.9145042 # writeLines(capture.output(A), matrix.txt) ## or similar Regards Alex [[alternative HTML version deleted]] Please send plain-text emails. -- Enrico

Re: [R] Yield to maturity in R

2013-10-31 Thread Enrico Schumann
On Wed, 30 Oct 2013, Katherine Gobin katherine_go...@yahoo.com writes: Dear R forum, Just want to know if there is any function / package in R which will calculate Yield to Maturity in R for a given bond? Regards Katherine require(sos) findFn(yield to maturity) -- Enrico Schumann

Re: [R] Problem adding lines to a plot, when y is defined

2013-09-09 Thread Enrico Schumann
-argument. Hard to say without a reproducible example, but try lines(as.Date(var[, 1], origin=1899-12-30), var[, 5]) instead. I do very much appreciate your help! Kind regards, Christian Cech [...] -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net

Re: [R] Plotting zoo objects with chron axis

2013-08-09 Thread Enrico Schumann
= format(midnight + sq, %H:%M)) -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting

Re: [R] cannot base64decode string which is base64encode in R

2013-08-05 Thread Enrico Schumann
On Mon, 05 Aug 2013, Qiang Wang uns...@gmail.com writes: On Sat, Aug 3, 2013 at 3:49 PM, Enrico Schumann e...@enricoschumann.netwrote: On Fri, 02 Aug 2013, Qiang Wang uns...@gmail.com writes: Hi, I'm struggling with encode/decode strings in R. Don't know why the second example below

Re: [R] cannot base64decode string which is base64encode in R

2013-08-03 Thread Enrico Schumann
-- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ R-help@r-project.org mailing list 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

Re: [R] using rollapply to calculate a moving sum or running sum?

2013-08-03 Thread Enrico Schumann
=sum, by.column =T, fill = NA, partial = FALSE, align = left ) -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

Re: [R] optimize integer function parameters

2013-07-23 Thread Enrico Schumann
? -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ R-help@r-project.org mailing list 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

Re: [R] optimize integer function parameters

2013-07-23 Thread Enrico Schumann
On Tue, 23 Jul 2013, Christof Kluß ckl...@email.uni-kiel.de writes: Am 23-07-2013 13:20, schrieb Enrico Schumann: On Tue, 23 Jul 2013, Christof Kluß ckl...@email.uni-kiel.de writes: I have observations obs - (11455, 11536, 11582, 11825, 11900, ...) and a simulation function f(A,B,C,D,E,F

Re: [R] modify timestemp

2013-07-04 Thread Enrico Schumann
32 45 58 timestamp$sec - 0 [[alternative HTML version deleted]] Please send only plain-text mails to this list. -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] return output to console for copying as input

2013-06-25 Thread Enrico Schumann
, \, collapse = , ), \n) -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html

Re: [R] Time of day

2013-06-25 Thread Enrico Schumann
this, or there is a straightforward representation of time of day in R that I have not been able to find in the documentation. strftime(Sys.time(), %H:%M) -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ R-help@r-project.org

Re: [R] alternative to ifelse

2013-06-19 Thread Enrico Schumann
Regards, Enrico -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting

  1   2   >