[R] Access to R help database

2010-07-19 Thread Sigbert Klinke
Hi, from the documentation of help.search I think that fields like concept and keywords in the R help database exists. How can I access them from R? If I do help-help.search(blabla) colnames(help$matches) [1] topic title Package LibPath then I get back only back these 4 fields. Thanks

[R] Mailing list for download

2010-07-29 Thread Sigbert Klinke
Hi, is it possible to get all the mails of the mailing list / mail archives for download (preferably in XML format)? Thanks Sigbert __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] playwith error message

2010-02-01 Thread Sigbert Klinke
Hi, I'am using the playwith library to write my own small GUI application. But I get the following error under Windows and Linux (Ubuntu): Error in if ((modeOK %in% c(Identify, Brush)) (actions$ident == : Fehlender Wert, wo TRUE/FALSE nötig ist Under linux my R program simply continues, but

Re: [R] playwith error message

2010-02-01 Thread Sigbert Klinke
Hi, Can you post a reproducible example that leads to this error? myplot - function(x) { plot(x) } efaApp - function(data, ...) { playwith (myplot(data[,8:9]), click.mode = Brush, ) } efaApp(as.data.frame(Boston)) My plot routines even return invisibly a list

[R] cmdscale error message - k' must be in {1, 2, .. n - 1}

2010-02-22 Thread Sigbert Klinke
Hi, I got the error message: Error in cmdscale(1 - similarity, k = 1) : 'k' must be in {1, 2, .. n - 1} It turned out that similarity was just a scalar and therefore n-1 = 0 :( Maybe the error message could be improved. Bset Sigbert __

Re: [R] Correlation Network Diagram - Correction

2009-07-03 Thread Sigbert Klinke
Hi, the igraph package will be able to do the job. Yours sincerely Sigbert Klinke __ 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] Function to eliminate blank space within strings?

2009-07-03 Thread Sigbert Klinke
Hi, Is there an specific function to eliminate blank space within strings? Thanks gsub( , , txt) Sigbert __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] R on a eeepc 901 ?

2008-09-17 Thread Sigbert Klinke
Hi, it seems that the directions in http://wiki.r-project.org/rwiki/doku.php?id=getting-started:installation:eeepc refer to installing R on a eeepc 701 and actually Yes, it does :) fail for a 901 at the first step. What exactly failed? You are actually do not need the KDE desktop.

Re: [R] How to replace values?

2009-04-30 Thread Sigbert Klinke
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, If the coding would start at 1 rather than 0 then +1's in the penultimate line could be eliminated. Sigbert - --- gene - c(YAR003W, YAR007C, YAR008W, YBL035C, YBL111C, YBL112C) print(gene) to - c(0,1,3,2) # to - c(1,2,4,3) from

Re: [R] Factor Analysis Output from R and SAS

2009-03-31 Thread Sigbert Klinke
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I ran factor analysis using R and SAS. However, I had different outputs from R and SAS. Why they provide different outputs? Especially, the factor loadings are different. I did real dataset(n=264), however, I had an extremely different from

Re: [R] scope of variables in R

2009-03-31 Thread Sigbert Klinke
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, A) you should give and return the variables through input/output parameter of the functions, e.g. pwtset - function(n, inout) { if (n 100){ inout$ncof - n } else { inout$ncof - n -100 } ... return(inout) } ford -

Re: [R] Vizualization of points within sets

2009-04-21 Thread Sigbert Klinke
. Then run a nonmetric (two-dimensional) multidimensional scaling (package: MASS, function: isoMDS) to determine the point positions. But I'am not sure that it will be easy to draw the set borders. Yours sincerely Sigbert Klinke __ R-help@r-project.org

[R] Graphic device graphics primitives

2009-01-29 Thread Sigbert Klinke
Hi, I know that some graphics devices in R store graphics primitives such that a redraw is possible (e.g. when resizing the window). Is it possible to get the current number of stored graphic primitives? Thanks in advance Sigbert Klinke __ R-help

[R] Move legend text to the left legend box border

2009-08-19 Thread Sigbert Klinke
Hi, in legend I'am coloring my text rather than using symbols or lines: legend(bottomleft, txt, text.col=col, cex=0.7) However, between the left legend box border and the text in txt is a large empty space. Can I somehow move the text more to the left and get also a smaller legend box? Thanx

[R] Localization of R script output

2014-06-27 Thread Sigbert Klinke
Hi, I have written some R scripts for a server which display the result on a webpage. I would like to localize the output to the webpage depending on the users choice. Therefore I prepared some po files. Exist some possibility to utilize the gettext command of R? As far as I see I can not set

[R] roxygen2 & markdown & math

2021-01-12 Thread Sigbert Klinke
Hi, I like to make my package documentation with markdown which is supported since roxygen2 6.0.0 . I used a math expression like $t_n \appox N(0,1)$ which leads in the package check to "unknown macro '\approx'". I guess I get the warning because math is not supported in markdown. Are there

Re: [R] roxygen2 & markdown & math

2021-01-12 Thread Sigbert Klinke
): Dear Sigbert, The mathjaxr package provides this: https://cran.r-project.org/package=mathjaxr https://github.com/wviechtb/mathjaxr Best, Wolfgang -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Sigbert Klinke Sent: Tuesday, 12 January, 2021 9:14 To: r

[R] binom.test & p-value

2022-04-03 Thread Sigbert Klinke
Hi, for the specific example binom.test(x=6, n=26, p=0.1) I get as p-value 0.03986. The default approach to decide whether I can reject the null or or not is to compare the p-value with the given significance level. Using a significance level of 0.05 this will lead to reject the null

[R] aplpack / bagplot

2022-09-21 Thread Sigbert Klinke
Hi, I get an error when I use bagplot from the package aplpack. Any ideas what theproblem is with the data set? library("aplpack") x <- c(5, 2, 1, 6, 3, 5, 4, 7, 4, 4, 3, 4, 5, 4, 6, 3, 3) y <- c(2, 3, 4, 6, 7, 8, 10, 11, 12, 13, 1, 14, 17, 18, 19, 20, 22) bagplot(y,x) # works

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

2023-01-07 Thread Sigbert Klinke
Hi, has someone experience which routine should be used for creating fractional numbers? The two conversion routines deliver different results > x <- (0:7)/7 > MASS::fractions(x) [1] 0 1/7 2/7 3/7 4/7 5/7 6/7 1 > gmp::as.bigq(x) Big Rational ('bigq') object of length 8: [1] 0

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

2023-01-11 Thread Sigbert Klinke
Hello, Am 07.01.23 um 17:55 schrieb Ivan Krylov: > What do you need the fractions for? > When writing tasks for statistics exams, I try to avoid non-terminal intermediate results. Students might round them and arrive at a final result that might be slightly different from the true value.

[R] rio: list of extensions for supported formats

2022-11-05 Thread Sigbert Klinke
Hi, is there a function in the package rio to get the file extensions listed in the vignette under supported formats? Thanks Sigbert __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] R vs. RStudio?

2015-01-13 Thread Sigbert Klinke
On 12.01.2015 09:01, peter dalgaard wrote: On 11 Jan 2015, at 11:30 , Duncan Murdoch murdoch.dun...@gmail.com wrote: - I don't like the tiled display. I find it doesn't give me enough space. This is a mixed blessing. For teaching purposes, it helps avoid shuffling windows to uncover

Re: [R] Setting two default CRAN servers under Windows/RStudio

2015-06-25 Thread Sigbert Klinke
Hi, I tried the following: local({r - getOption(repos) r[CRAN] - http://local.cran.server/; r[MIRROR] - http://cran.mirror/; options(repos=r) }) But: R seems always to take the CRAN entry first, therefore I put our local mirror there. If a R session starts and the CRAN

[R] Setting two default CRAN servers under Windows/RStudio

2015-06-19 Thread Sigbert Klinke
Hi, we are running in our network a non-public CRAN mirror. I got it working with the entry in Rprofile.site local({r - getOption(repos) r[CRAN] - http://local.cran.server; options(repos=r) }) In case that our CRAN mirror does not work we want to send the R/RStudio users to a

[R] Feature or bug?

2015-05-21 Thread Sigbert Klinke
Hi, if I run update - function (newtime) { ginput - list(time=newtime)} server - function (input) { print(paste(Before, input$time)) update(1) print(paste(After:, input$time)) } ginput - list(time=0) server(ginput) then I get as result [1] Before 0 [1] After: 0 If I uncomment the

Re: [R] readRDS problem

2016-02-24 Thread Sigbert Klinke
Hi, thanks, using test <<- readRDS (name) it worked. But why? Best Sigbert Am 24.02.2016 um 10:39 schrieb Michael Dewey: > Try calling it something other than data. > > On 24/02/2016 09:26, Sigbert Klinke wrote: >> Hi, >> >> I have two scripts, one creates

[R] readRDS problem

2016-02-24 Thread Sigbert Klinke
Hi, I have two scripts, one creates a data structure (a list of data frames + some attributes) and saves it via saveRDS. The second script reads the RDS file (outside of any function) and data <- readRDS (name) works, but data <<- readRDS (name) creates the error Error: cannot change value

[R] Misleading error message: XML content does not seem to be XML

2017-01-30 Thread Sigbert Klinke
Hi, using the XML package reading an XML file library("XML") doc <- xmlParse(file='abc.xml') I got the above error message. The problem was that the file was located at a different directory. So the file was not found rather than containing invalid XML. Best Sigbert --

[R] devtools::check "hangs"

2017-07-12 Thread Sigbert Klinke
Hi, checking my package with check from devtools leads to the output Functions with \usage entries need to have the appropriate \alias entries, and all their arguments documented. The \usage entries must correspond to syntactically valid R code. See chapter ‘Writing R documentation files’ in

Re: [R] Ubuntu 18.04 / R 3.4.4 / shinyjs / V8

2018-06-06 Thread Sigbert Klinke
Hi, found myself a workaround: Replaced the javascript functionality by calls of session$sendCustomMesssage(...) & Sys.sleep(...) and deleted library(shinyjs) from my code. Best Sigbert Am 06.06.2018 um 10:33 schrieb Sigbert Klinke: Hi, if I want to use shinyjs package then I need th

Re: [R] problems in converting numeric to character

2018-06-08 Thread Sigbert Klinke
sprintf("%.1f", x) sprintf("%.2f", x) Am 07.06.2018 um 17:12 schrieb 刘瑞阳: Hi, I am having trouble converting numeric to characters in the format I desire. To be more specific, I have a number of numeric as follows: x<-c(1.0,2.0,2.00,2.1) I want to convert them to characters so that the out

[R] Ubuntu 18.04 / R 3.4.4 / shinyjs / V8

2018-06-06 Thread Sigbert Klinke
Hi, if I want to use shinyjs package then I need the V8 package. Therefore I installed apt-get install libv8-3.14-dev and tried install.packages("V8") and get ** preparing package for lazy loading Error in dyn.load(file, DLLpath = DLLpath, ...) : kann shared object

[R] Extract function parameters from a R expression

2018-06-20 Thread Sigbert Klinke
Hi, I have read an R program with expr <- parse("myRprg.R") How can I extract the parameters of a specifc R command, e.g. "library"? So, if myprg.R containes the lines library("xyz") library("abc") then I would like to get "xyz" and "abc" back from expr. Thanks in advance Sigbert --

[R] Syntax highlighting

2018-02-13 Thread Sigbert Klinke
Hi, I would like know if there are any plans for some "standardized" syntax highlighting of R code? * Currently I'm using minted for my LaTeX slides with pygmentize and I do not know what scheme is used for highlighting the R code. * RStudio uses (as default) TextMate (Text editor for MacOS)

Re: [R] Access function as text from package by name

2018-09-28 Thread Sigbert Klinke
Hi, I guess I was not clear enough: the name of the function is stored as string. Solutions which use the object directly do not help unfortunately. Thanks Sigbert Am 27.09.2018 um 12:30 schrieb Sigbert Klinke: Hi, I want to have a function, e.g. graphics::box, as text. Currently I'am

[R] Link from vignette to package documentation

2018-09-21 Thread Sigbert Klinke
Hi, is it possible to make a link from a vignette to a (Rd) help files in my own or other packages? Best Sigbert -- https://hu.berlin/sk https://hu.berlin/mmstat3 __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

[R] Access function as text from package by name

2018-09-27 Thread Sigbert Klinke
Hi, I want to have a function, e.g. graphics::box, as text. Currently I'am using deparse(eval(parse(text='graphics::box'))) It is important that '::' and ':::' can be used in the name. Is there a simpler way? Thanks Sigbert -- https://hu.berlin/sk https://hu.berlin/mmstat3

Re: [R] do.call, browser and traceback

2019-01-15 Thread Sigbert Klinke
Hi, I run in the same problem, as discussed in 2006. Is there any solution by now? Sigbert Am 23.02.06 um 20:39 schrieb hadley wickham: Did you mean that? Both are errors. Perhaps f <- function(...) browser() do.call(f, mtcars) Sorry, yes, that is what I meant. What is being used is

[R] Rd files with duplicated alias 'plot'

2019-05-10 Thread Sigbert Klinke
Hi, in package I have for two S3 classes plot routines: plot.ABC and plot.DEF. For appearing both under ?plot I added in each file a "@aliases plot". This leads to the above warning message when calling devtools::check(). And only one of the routines appears under ?plot. Any hint how to

[R] Problem with rio/haven

2019-07-30 Thread Sigbert Klinke
Hi, I got the following error when reading a Stata file: > library("rio") > x <- import('XXX.dta') Fehler in df_parse_dta_file(spec, encoding) : Evaluation error: Column name `Merge` must not be duplicated. Use .name_repair to specify repair. I understand that the column name "Merge" appears

Re: [R] shinyWidgets::sliderTextInput

2019-08-07 Thread Sigbert Klinke
Hi, Is there a label argument, please? I think that might be it. In my example I had a label, but this not the problem since > choices=list("choice1"=1, "choice2"=2,"choice3"=3) > as.character(choices) [1] "1" "2" "3" delivers the result as it is used in sliderTextInput. I was hoping there

Re: [R] shinyWidgets::sliderTextInput

2019-08-09 Thread Sigbert Klinke
Hi Erin, do you see the difference between sliderTextInput and selectInput? I would like to have the selectInput behaviour (list element name in display, but result as value of list element) in sliderTextInput as well. Best Sigbert --- library("shiny") library("shinyWidgets") ui <-

[R] shinyWidgets::sliderTextInput

2019-08-06 Thread Sigbert Klinke
Hi, I'am using sliderTextInput('myinput', choices=list("choice1"=1, "choice2"=2, "choice3"=3)) But in the shiny app the UI element shows '1', '2', instead of 'choice1', 'choice2' etc. I think the reason is that in shinyTextInput is done if (!is.character(choices)) { choices

[R] read_dta & .name_repair

2019-10-24 Thread Sigbert Klinke
Hi, I can not read in a data set from Stata. When I try I get the first error. If I follow the advice then I get "unused argument error". How do I use .name_repair? Best Sigbert > library("haven") > packageVersion("haven") [1] ‘2.1.1’ > xp <- read_dta("XXX.dta") Fehler in

[R] Strange behaviour of R?

2020-01-16 Thread Sigbert Klinke
Hi, I wrote a function like test <- function(FUN, args) { print(FUN) FUN(args) } When I call it lieke this test(mean, 1:10) test(NULL, 1:10) then the second call still uses mean, although I set FUN to NULL. Is that ok? Actually, I used something like test(mean, list(x=1:10,

Re: [R] Strange behaviour of R?

2020-01-17 Thread Sigbert Klinke
Hi, Am 17.01.20 um 08:42 schrieb Rainer M Krug: > Not for me - macOS, R 3.6.2 Sorry, I forgot to add: Ubuntu 18.04.3 LTS, R 3.6.2 Best Sigbert -- https://hu.berlin/sk https://hu.berlin/mmstat3 __ R-help@r-project.org mailing list -- To UNSUBSCRIBE

Re: [R] Strange behaviour of R?

2020-01-17 Thread Sigbert Klinke
Hi, You probably have a function defined in your global environment that is named FUN and acts like mean. You are right. Thanks Sigbert -- https://hu.berlin/sk https://hu.berlin/mmstat3 __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and

[R] R Markdown & chunk extraction in R

2020-04-08 Thread Sigbert Klinke
Hi, exists a possibility to extract chunks from a R Markdown file and to return them as (named) list in R? Thanks Sigbert -- https://hu.berlin/sk https://hu.berlin/mmstat3 __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

[R] regular expression, stringr::str_view, grep

2020-04-28 Thread Sigbert Klinke
Hi, we gave students the task to construct a regular expression selecting some texts. One send us back a program which gives different results on stringr::str_view and grep. The problem is "[^[A-Z]]" / "[^[A-Z]" at the end of the regular expression. I would have expected that all four calls

[R] serialize does not work as expected

2020-08-29 Thread Sigbert Klinke
Hi, if I create a list with l <- list(1:3, as.numeric(1:3), c(1,2,3)) and applying lapply(l, 'class') lapply(l, 'mode') lapply(l, 'storage.mode') lapply(l, 'typeof') identical(l[[2]], l[[3]]) then I would believe that as,numeric(1:3) and c(1,2,3) are identical objects. However, lapply(l,

Re: [R] serialize does not work as expected

2020-08-29 Thread Sigbert Klinke
Hi, is there in R a way to "normalize" a vector from compact_intseq/compact_realseq to a "normal" vector? Sigbert Am 29.08.20 um 18:13 schrieb Duncan Murdoch: Element 1 A 3 262146 197888 5 UTF-8 238 2 1 262153 14 compact_intseq 2 1 262153 4 base 2 13 1 13 254 14 3 3 1 1 254 Element 2 A 3

[R] Dynamically create a (convenience) function in a package

2023-10-30 Thread Sigbert Klinke
Hi, n a package, I have a data object with attributes, and I want to dynamically create a convenience function to access those attributes. This way, instead of using attr(x, "number"), I would like to use number(x). Because I don't know in advance which attributes the data object may

Re: [R] insert hyperlink into svg graphic

2023-03-08 Thread Sigbert Klinke
Hi, maybe it would be a good idea to extend plotmath by a href command. Sigbert Am 08.03.23 um 22:46 schrieb Paul Murrell: Hi On 8/03/23 15:27, Rusty Travis wrote: On 3/7/23 13:12, Paul Murrell wrote: Hi I think the main issue here is that you are *drawing* text on the graphics device,

[R] legend: interplay between title and y.intersp

2023-03-04 Thread Sigbert Klinke
Hi, my MWE is not working as expected: plot(c(0,1), c(0,1), type="n") legend("top", legend=c("", "", "a"), col=c("blue", "red", "green"), title="test", y.intersp=0.2, lwd=1) The lines are not below the title. I want (nearby) lines as in the plot, but below the title. Is there a way to

Re: [R] legend: interplay between title and y.intersp

2023-03-04 Thread Sigbert Klinke
), c(0,1), type="n") legend(x = .4, y = 1.25, legend=c("", "", "a"), col=c("blue", "red", "green"), xpd = TRUE, lty = 1, y.intersp= .75, title = 'test') Cheers, Bert Cheers, Bert On Sat, Mar 4, 2023 at 7:45 AM Sigbert Klinke

Re: [R] legend: interplay between title and y.intersp

2023-03-06 Thread Sigbert Klinke
Hi, that is perfect. Thanks Sigbert Am 06.03.23 um 13:08 schrieb Uwe Ligges: What about  plot(c(0,1), c(0,1), type="n")  legend("top", legend=c("", "a", ""), col=c("blue", "red", "green"), title="test", y.intersp=c(1,-0.4), lwd=1) (in recent versions of R) Best, Uwe --

Re: [R] legend: interplay between title and y.intersp

2023-03-06 Thread Sigbert Klinke
 PM Sigbert Klinke wrote: Hi, thanks, but this does not solve the problem. If I make y.intersp large enough then it works properly. Maybe I was not clear enough: I want to have the small distance between the lines and no overlap between the title and the lines. Sigbert Am 04.03.23 um 17:59

[R] Palettes {grDevices} - wrong number of colors returned?

2023-02-23 Thread Sigbert Klinke
Hi, I would have expected that I get always 3 colors as result which is not true: hcl.colors(3, alpha=c(0, 0.5, 1)) # 3 colors rainbow(3, alpha=c(0, 0.5, 1))# 3 colors heat.colors(3, alpha=c(0, 0.5, 1))# 3 colors terrain.colors(3, alpha=c(0, 0.5, 1)) # 6 colors

[R] diamonds data set from ggplot2

2023-04-25 Thread Sigbert Klinke
Hi, is there any information about the source of this data set? 1.) I read the question of Marina Doucerain in 2012 about the time and Hadley Wickhams answer "I believe it was 2008." 2.) In kaggle someone said "It's a Tiffany & Co's snapshot pricelist from 2017." So, where the data set

[R] Use generic functions, e.g. print, without UseMethod?

2023-08-11 Thread Sigbert Klinke
Hello, I have defined a function 'equations(...)' which returns an object with class 'equations'. I also defined a function 'print.equations' which prints the object. But I did not use 'equations <- function(x, ...) UseMethod("equations"). Two questions: 1.) Is this a sensible approach? 2.)

Re: [R] Problem with base::order

2024-04-10 Thread Sigbert Klinke
10.04.24 um 10:29 schrieb Ivan Krylov: В Wed, 10 Apr 2024 09:33:19 +0200 Sigbert Klinke пишет: decreasing=c(F,F,F) This is only documented to work with method = 'radix': For the ‘"radix"’ method, this can be a vector of length equal to the number of arguments in ‘...’ and the el

[R] Problem with base::order

2024-04-10 Thread Sigbert Klinke
Hi, when I execute order(letters, LETTERS, 1:26) then everything is fine. But if I execute order(letters, LETTERS, 1:26, na.last=c(T,T,T), decreasing=c(F,F,F)) I get the error message Error in method != "radix" && !is.na(na.last) : 'length = 3' in constraint to 'logical(1)' Shouldn't both