[R] "use of NULL environment is defunct" when trying to lock a reference class

2018-08-27 Thread Ivan Krylov
Hi! I'm trying to create a persistent memoising class with a destructor and an option to evaluate cache misses in parallel. I want to lock all its fields because it doesn't make sense to change them after the filename, the environment object and the function are set in the object. (I'm not sure wh

Re: [R] "use of NULL environment is defunct" when trying to lock a reference class

2018-08-28 Thread Ivan Krylov
Hi Eric, Thank you for your answer! On Mon, 27 Aug 2018 21:48:50 +0300 Eric Berger wrote: > you might want to consider the more recent R6 package Indeed, R6 has private fields which fits my idea of an object with mutable state even better. My original problem seems to be solved and I'm postin

Re: [R] histogram in GNU R....

2018-09-07 Thread Ivan Krylov
On Fri, 7 Sep 2018 08:26:22 + akshay kulkarni wrote: > when I type hist(xht), it goes to the next prompt. More importantly, > there is no error message. So, the most probable conclusion is that > the command gets executed Yes, hist() returns its value invisibly (try typing "? invisible" in t

Re: [R] getting 21 very different colours

2018-09-11 Thread Ivan Krylov
On Tue, 11 Sep 2018 07:34:51 + Federico Calboli wrote: > Is there a way of getting a set of 21 colours that maximises the > differences between them? In my limited experience, getting even 10 colours to look different enough is a serious undertaking. Take a look at RColorBrewer: display.br

Re: [R] sink() output to another directory

2018-09-14 Thread Ivan Krylov
В Thu, 13 Sep 2018 15:49:52 -0700 (PDT) Rich Shepard пишет: > sink('stat-summaries/estacada-wnw-precip.txt') > print(/summary(estacada_wnw_wx)) > sink() Just remove the slash from your print command (line 25 of rainfall-dubois-crk-all.r) because it's a syntax error (must be a typo). I.e. the abo

Re: [R] Help with setting locale

2018-09-16 Thread Ivan Krylov
On Fri, 14 Sep 2018 10:02:01 +0200 Kim Titcombe wrote: > I am based in Switzerland but work in English (Windows in English), > hence want English as default. Which Windows version do you use? Which languages/language packs do you have installed? -- Best regards, Ivan _

Re: [R] Help with setting locale

2018-09-17 Thread Ivan Krylov
On Sun, 16 Sep 2018 21:18:45 +0200 Kim Titcombe wrote: > I have Windows 10. English version. Do you have any other problems, besides the warning message at startup? According to MSDN[1], the combination of English language and Swiss cultural rules should be supported in Windows 10 >= v1607 with

Re: [R] regexp mystery

2018-10-16 Thread Ivan Krylov
On Tue, 16 Oct 2018 08:36:27 + PIKAL Petr wrote: > > dput(x[11]) > "et odYezko: 3 \fas odYezku: 15 s" > gsub("^.*: (\\d+).*$", "\\1", x[11]) > works for 3 This regular expression only matches one space between the colon and the number, but you have more than one of t

Re: [R] Cannot use R on Windows when installed to an external drive with a space in the path

2018-10-22 Thread Ivan Krylov
This is a bin\R.exe + bin\Rscript.exe bug. On Windows, where the system call to create a process only takes one command line string instead of an array of command line parameters[0] (and the C runtimes usually call CommandLineToArgvW[1] behind the scenes to get an array back), execv() does nothing

Re: [R] Encoding issue

2018-11-05 Thread Ivan Krylov
On Mon, 5 Nov 2018 08:36:13 -0500 (EST) Sebastien Bihorel wrote: > [1] "râs" Interesting. This is what I get if I decode the bytes 72 e2 80 99 73 0a as latin-1 instead of UTF-8. They look like there is only three characters, but, actually, there is more: $ perl -CSD -Mcharnames=:full -MEncode=d

Re: [R] Help with if else branching print out

2018-12-18 Thread Ivan Krylov
On Tue, 18 Dec 2018 08:56:23 + Andrew wrote: > How do I: > > (a) reduce the gap between the reported number (i.e., 17, 9, 13) in > each of the lines? and > > (b) ensure that in the case of the second run using 9 as the input, > the print is not over two lines? Build a single string from yo

Re: [R] Problem with system() and source on linux

2018-12-20 Thread Ivan Krylov
On Thu, 20 Dec 2018 12:00:04 +0100 Agustin Lobo wrote: > For a given program, I need to set up its environment, which I > normally do with source /home/alobo/OTB-6.6.0-Linux64/otbenv.profile > from the terminal. The problem with this approach is that in Unix-like systems, child processes cannot

Re: [R] User Interfaces for R

2019-01-10 Thread Ivan Krylov
On Wed, 9 Jan 2019 14:29:22 -0500 (EST) Bernard McGarvey wrote: > Can anyone point me to such an easy to use package to create GUIs for > R? If you want a traditional approach, a lot of R installations have Tcl/Tk support built in (i.e. capabilities('tcltk') is TRUE). This means that you can run

Re: [R] User Interfaces for R

2019-01-11 Thread Ivan Krylov
On Thu, 10 Jan 2019 19:25:30 -0500 Duncan Murdoch wrote: > Eric's suggestion of Shiny is newer, and is a really well-designed > system. A fairly steep learning curve, but worth it. I understand the need for progress and I really like Shiny's API - it feels very declarative and easy to write, a

Re: [R] Potential R bug in identical

2019-01-17 Thread Ivan Krylov
On Thu, 17 Jan 2019 14:55:18 + Layik Hama wrote: > There seems to be some weird and unidentifiable (to me) characters in > front of the `Accidents_Index` column name there causing the length > to be 17 rather than 14 characters. Repeating the reproduction steps described at the linked pull r

Re: [R] Potential R bug in identical

2019-01-17 Thread Ivan Krylov
On Thu, 17 Jan 2019 21:05:07 + Layik Hama wrote: > Why would `identical(str, "Accident_Index", ignore.case = TRUE)` > behave differently on Linux/MacOS vs Windows? Because str is different from "Accident_Index" on Windows: it was decoded from bytes to characters according to different rules

[R] Function in default parameter value closing over variables defined later in the enclosing function

2019-01-23 Thread Ivan Krylov
Hi! I needed to generalize a loss function being optimized inside another function, so I made it a function argument with a default value. It worked without problems, but later I noticed that the inner function, despite being defined in the function arguments, somehow closes over a variable belong

Re: [R] Function in default parameter value closing over variables defined later in the enclosing function

2019-01-24 Thread Ivan Krylov
Dear Jan & Duncan, Thanks for your replies! On Wed, 23 Jan 2019 09:56:25 -0500 Duncan Murdoch wrote: > Defaults of variables are evaluated in the evaluation frame of the > call. So the inside() function is created in the evaluation frame, > and it's environment will be that frame. > When it i

Re: [R] Function in default parameter value closing over variables defined later in the enclosing function

2019-01-26 Thread Ivan Krylov
On Thu, 24 Jan 2019 06:53:20 -0800 Jeff Newmiller wrote: > It would be better to also make secret an argument to outside instead > of a local variable or to give up on supplying the inside function as > an argument. This was in a small, mostly self-contained one-off script that tested different

Re: [R] load.wave

2019-02-02 Thread Ivan Krylov
Hello Nick Wray, Let me offer a simplified explanation of what's going on. Sorry if it's unnecessary. Sound is waves of pressure in the air. Devices like microphones can measure the changing pressure by converting it into voltage. Voltage can then be sampled by an analog-to-digital converter insi

Re: [R] list with list function

2019-02-04 Thread Ivan Krylov
On Mon, 4 Feb 2019 21:01:06 + (UTC) Andras Farkas via R-help wrote: > listA<-list(a,b,c) > listB<-list(d,e,f) > > what I would like to do with a function <...> as opposed to manually > is to derive the following answer > > listfinal<-list(a[-d],b[-e],c[-f]) The `Map` function, unlike `lapp

Re: [R] Difficulty with "\\" in string functions....

2019-02-11 Thread Ivan Krylov
On Mon, 11 Feb 2019 15:01:16 -0500 (EST) Bernard McGarvey wrote: > Now I try to split it using > > > str_split(Fname1,"\\") > > > but this returns an error > > > Error in stri_split_regex(string, pattern, n = n, simplify = > simplify, : Unrecognized backslash escape sequence in pattern. > (

Re: [R] Remove Even Number from A Vector

2019-03-03 Thread Ivan Krylov
Hi Darren, On Sat, 2 Mar 2019 22:27:55 + Darren Danyluk wrote: > It sounds like she is working with the very basics of this software, > and her task is to write the code which would result in the > extraction of "odd" data from a dataset of restaurant sales. Not a native English speaker her

Re: [R] Unobtainable source code of specific functions

2019-03-14 Thread Ivan Krylov
On Thu, 14 Mar 2019 15:44:07 +0100 (CET) julien.lacr...@student.uliege.be wrote: > My question is therefore the following, how or where could I find > these source code ? (Note : I have the package Igraph installed) Functions wrapped in .Call() are implemented in a compiled language, with corresp

Re: [R] Extract data of special character

2019-03-14 Thread Ivan Krylov
On Fri, 15 Mar 2019 03:06:28 +0800 roslinazairimah zakaria wrote: > how many of ATTRIBUTE related to TRAITS. The table() function can be used to count occurrences of each combination of factor levels. Does extracting the two columns by dd[,c('ATTRIBUTE','TRAIT')] and passing the result to table(

Re: [R] Extract data of special character

2019-03-15 Thread Ivan Krylov
В Fri, 15 Mar 2019 08:06:52 +0800 roslinazairimah zakaria пишет: > I want to draw boxplot for each individual score of the > attributes. You mean, a box per every possible ATTRIBUTE value? This is easily doable with the bwplot() function from library(lattice). -- Best regards, Ivan __

Re: [R] Help with gsub function

2019-03-15 Thread Ivan Krylov
On Fri, 15 Mar 2019 19:45:27 + Bill Poling wrote: Hello Bill, > tb2a$TID2 <- gsub(tb2a$TID, pattern="-[0-0]{0,7}", replacement = "") Is the pattern supposed to mean something besides the "-" you want to remove? For the problem you describe, pattern="-" should be enough. It should locate all

Re: [R] problem with nlsLM.....

2019-03-20 Thread Ivan Krylov
On Wed, 20 Mar 2019 08:02:45 + akshay kulkarni wrote: > formulaDH5 <- as.formula(HM1 ~ (a + (b * ((HM2 + 0.3)^(1/2 + > (A*sin(w*HM3 + c) + C)) The problem with this formula is simple: the partial derivative with respect to `a` is the same as the partial derivative with respect to `C`. Th

Re: [R] problem with nlsLM.....

2019-03-20 Thread Ivan Krylov
On Wed, 20 Mar 2019 09:43:11 + akshay kulkarni wrote: > But doesn't removing some of the parameters reduce the precision of > the relationship between the response variable and the > predictors(inefficient estimates of the coefficients)? No, it doesn't, since there is already more variables

Re: [R] System("source activate condaenv")

2019-03-20 Thread Ivan Krylov
On Wed, 20 Mar 2019 09:59:21 +0100 Sandra Elisabeth Chaudron wrote: > I am using the server version of RStudio and I have a script where I > want to activate the conda environment that I set up for a > bioinformatic tool called MinVar. > For that I use in my script the command: system("source > /

Re: [R] problem with nls....

2019-03-21 Thread Ivan Krylov
One of the assumptions made by least squares method is that the residuals are independent and normally distributed with same parameters (or, in case of weighted regression, the standard deviation of the residual is known for every point). If this is the case, the parameters that minimize the sum of

Re: [R] problem with nls....

2019-03-23 Thread Ivan Krylov
On Fri, 22 Mar 2019 12:29:14 + akshay kulkarni wrote: > How do I get the gradient, Hessian, and the jacobian of the > objective function created by call to the nls? nls() return value is a list containing an entry named `m`, which is an object of type "nlsModel". It doesn't seem to be docume

Re: [R] Just confirming (?): No way to "export" a (Quartz) plot...

2019-03-25 Thread Ivan Krylov
On Sun, 24 Mar 2019 23:35:30 -0700 David Goldsmith wrote: > No way to "export" a (Quartz) plot... > ...once I've got it the way I want it, (e.g., to a PNG) Well, there seems to be a quartz.save() function, but I cannot attest to its well-behavedness, not having a Mac to test it on. -- Best reg

Re: [R] converting a character string to an object name

2019-03-29 Thread Ivan Krylov
On Fri, 29 Mar 2019 14:07:16 +0100 Assa Yeroslaviz wrote: > Is there a way to read for each sheet the name from names(wb) and > convert it to a name for the object? See `get` and `assign` functions for a way to use strings as object names. Generally, it might not be a good idea to do that (what

Re: [R] String replace

2019-04-03 Thread Ivan Krylov
On Wed, 3 Apr 2019 15:01:37 +0100 Graham Leask via R-help wrote: Suppose that `BHC$Date` contains a string "M_24". You do: > BHC <-BHC %>% mutate ( Date = stringr :: str_replace ( Date , "M_2" , > "01-04-2017")) before you have a chance to do: > BHC <-BHC %>% mutate ( Date = stringr :: str_re

Re: [R] Greek characters in R studio

2019-04-09 Thread Ivan Krylov
On Mon, 8 Apr 2019 18:41:16 +0300 kostas zogopoulos wrote: > How do you read a csv file that contains greek characters as part of > the header (i.e. α, β etc) in R studio? Determine the character encoding used in the file (is it UTF-8, ISO8859-7 or something else?) and pass it as fileEncoding=".

Re: [R] md5sum issues

2021-02-02 Thread Ivan Krylov
On Tue, 2 Feb 2021 17:01:05 +0100 Ivan Calandra wrote: > This happens to all text-based files (Rmd, MD, CSV...) but not to > non-editable files (PDF, XLSX...). This is probably caused by Git helpfully converting text files from LF (0x10) line endings to CR LF (0x13 0x10) when checking out the r

Re: [R] ISO recommendations for plot output format from R to MS Word

2021-02-12 Thread Ivan Krylov
On Fri, 12 Feb 2021 15:05:33 -0800 Robert Dodier wrote: > Towards the goal of creating an MS Word document which others with > unspecified versions of MS Word can view correctly, in what format > should I export figures from R? A cross-platform plotting device designed specifically for word proc

Re: [R] Assigning several lists to variables whose names are contained in other variables

2021-04-09 Thread Ivan Krylov
Dear Wolfgang, On Fri, 9 Apr 2021 11:48:55 +0200 Wolfgang Grond wrote: > I want to assign the subnets to variables whose names contain the > name of the subnet Apologies if this sounds too opinionated, but creating variable names from variable values is a FAQ in a different dynamic language: h

Re: [R] Plotting the ASCII character set.

2021-07-03 Thread Ivan Krylov
Hello Rolf Turner, On Sat, 3 Jul 2021 14:02:59 +1200 Rolf Turner wrote: > Can anyone suggest how I might get my plot_ascii() function working > again? Basically, it seems to me, the question is: how do I persuade > R to read in "\260" as "\ub0" rather than "\xb0"? Part of the problem is that

Re: [R] Plotting the ASCII character set.

2021-07-04 Thread Ivan Krylov
On Sun, 4 Jul 2021 13:59:49 +1200 Rolf Turner wrote: > a substantial number of the characters are displayed as a wee > rectangle containing a 2 x 2 array of digits such as > > > 0 0 > > 8 0 Interesting. I didn't pay attention to it at first, but now I see that a range of code points, U+00

Re: [R] conditional output of string to file n times...

2021-07-07 Thread Ivan Krylov
On Tue, 6 Jul 2021 09:27:20 -0400 Evan Cooch wrote: > I was wondering if there was an elegant/simple way to do this? rep(label, times = count) should give you a character vector with the answer ready for writeLines(). -- Best regards, Ivan __ R-help

Re: [R] Makefile error

2021-07-24 Thread Ivan Krylov
On Sat, 24 Jul 2021 11:19:41 + (UTC) Bintao Cui via R-help wrote: > Makefile.in:87: *** missing separator.  Stop. Thanks for showing us the error message, but this isn't enough information. In order to be able to help, we also need to know what exactly you did to get the error message. See

Re: [R] Unending loop

2021-07-29 Thread Ivan Krylov
Hi Nick, Thanks for providing an example that doesn't seem to depend on external data! On Thu, 29 Jul 2021 09:07:12 +0100 Nick Wray wrote: > I am looking at the extRemes package It's probable that there aren't many extRemes users on R-help, but if you contact the maintainer of extRemes (run ma

Re: [R] substitute column data frame based on name stored in variable in r

2021-08-09 Thread Ivan Krylov
On Mon, 9 Aug 2021 10:26:03 +0200 Luigi Marongiu wrote: > vect = names(df) > sub_df[vect[1]] > df$column[df$column == value] <- new.value Let's see, an equivalent expression without the $ syntax is `df[['column']][df[['column']] == value] <- new.value`. Slightly shorter, matrix-like syntax woul

Re: [R] substitute column data frame based on name stored in variable in r

2021-08-09 Thread Ivan Krylov
On Mon, 9 Aug 2021 13:16:02 +0200 Luigi Marongiu wrote: > df = data.frame(VAR = ..., VAL = ...) > vect = letters[1:5] What is the relation between vect and the column names of the data frame? Is it your intention to choose rows or columns using `vect`? > df[df[['vect[2]']] == 2, 'vect[2]'] '..

Re: [R] substitute column data frame based on name stored in variable in r

2021-08-09 Thread Ivan Krylov
Thanks for providing a reproducible example! On Mon, 9 Aug 2021 15:33:53 +0200 Luigi Marongiu wrote: > df[df[['vect[2]']] == 2, 'vect[2]'] <- "No" Please don't quote R expressions that you want to evaluate. 'vect[2]' is just a string, like 'hello world' or 'I want to create a new column named "

Re: [R] Cars2

2021-08-17 Thread Ivan Krylov
On Tue, 17 Aug 2021 09:50:54 + George Bellas wrote: > I found cars2 earlier this week, but now when I look at the list, > it's not there! That sounds like a dataset provided by a contributed package. Does https://search.r-project.org/ help find it again? -- Best regards, Ivan > [[al

Re: [R] Cars2

2021-08-19 Thread Ivan Krylov
On Thu, 19 Aug 2021 00:12:51 + George Bellas wrote: > I'm still looking for it, it had car prices and car models in it. I > couldn't find it through the r search link. Could it be the third search result for a query of 'cars2'? https://search.r-project.org/?P=cars2&SORT=&HITSPERPAGE=10&DB=r

Re: [R] Dynamic Creation and Use of Object Names

2021-08-23 Thread Ivan Krylov
On Mon, 23 Aug 2021 08:37:54 +0200 Dr Eberhard Lisse wrote: > create the variables dynamically and add them to to > the grid (dynamically, ie adding more countries) In my opinion, creating variables in the global environment programmatically may lead to code that is hard to understand and debug

[R] Handling interrupts in long-running R functions

2021-09-10 Thread Ivan Krylov
Hello everyone, I'm writing an R function that may be running for "long" periods of time (think tens of minutes), and I would like to be able to tell it: "please stop what you're doing and return the not-yet converged results as they are for inspection". The behaviour I'm striving for is 1) User

Re: [R] (no subject)

2021-10-06 Thread Ivan Krylov
On Tue, 5 Oct 2021 22:20:33 + Thomas Subia wrote: > Some co-workers are wondering about how secure R software is. I'm afraid that this question is too hard to answer without their threat model. Secure against what, specifically? > Is there any documentation on this which I can forward to th

Re: [R] RSQLite slowness

2021-10-07 Thread Ivan Krylov
On Wed, 6 Oct 2021 16:23:15 + Rasmus Liland wrote: >"SELECT * FROM gene2refseq > LEFT JOIN gene_info ON > gene_info.GeneID = gene2refseq.GeneID > WHERE gene2refseq.`RNA_nucleotide_accession.version` > LIKE ?" <...> > x1 <- DBI::dbGetQuery(

Re: [R] How to read from a file within a gzipped file

2021-10-11 Thread Ivan Krylov
On Mon, 11 Oct 2021 16:24:01 + "Conklin, Mike (GfK) via R-help" wrote: > Is there a way to return a connection to a single file within a > zipped file using gzfile or some other method. Sure! Use unz() instead of gzfile(). -- Best regards, Ivan

Re: [R] tidyverse: read_csv() misses column

2021-11-02 Thread Ivan Krylov
On Mon, 1 Nov 2021 15:24:47 -0700 (PDT) Rich Shepard wrote: > + mutate( > + sampdt = make_datetime(year, mon, day, hr, min) > + ) <...> > produces the sampdt column, but it, and the timezone, are not present > in the cor_disc tibble That's because mutate() doesn't, well, mutate its argument. I

Re: [R] sink() not working as expected

2021-11-02 Thread Ivan Krylov
On Tue, 2 Nov 2021 10:18:07 -0700 (PDT) Rich Shepard wrote: > 'corvalis discharge summary\n' > summary(cor_disc) > sd(cor_disc$cfs) > '-\n' In the interactive mode, on the top level of execution, these commands behave as if you had written print(sink('data-summaries.txt')) print

Re: [R] names.data.frame?

2021-11-03 Thread Ivan Krylov
On Wed, 3 Nov 2021 20:35:58 +0200 Leonard Mada via R-help wrote: > class(p) = c("pm", class(p)); Does NextMethod() work for you? -- Best regards, Ivan __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/

Re: [R] Please help me debugg

2021-11-05 Thread Ivan Krylov
On Fri, 5 Nov 2021 12:29:21 +0530 Shrinivas Dharma wrote: > I am trying to run the following double loop which I have written > but it is not running. Thanks for providing the code, but it's much easier to help you if you provide the data, too. Use dput(head(...)) to make it easy for us to copy

Re: [R] Environmental oddity.

2021-11-07 Thread Ivan Krylov
On Sun, 7 Nov 2021 09:02:36 +0530 Deepayan Sarkar wrote: > This sounds like a difference in precedence. The expression > > if (log) 1 else dnorm(x, mean, sd) / sd > > is apparently being interpreted differently as > > d1: (if (log) 1 else dnorm(x, mean, sd)) / sd > d2: if (log) 1 else (dnorm(x

Re: [R] Warning msg after reinstall?

2021-11-07 Thread Ivan Krylov
On Sun, 7 Nov 2021 17:07:20 -0500 Brian Lunergan wrote: > I run R on Linux Mint 19.3. If my advice below doesn't help, let's continue this in the other mailing list, r-sig-deb...@r-project.org . > Warning messages: > 1: In readLines(file, skip

Re: [R] Problem Compiling v-4.x.x

2021-11-08 Thread Ivan Krylov
On Mon, 8 Nov 2021 14:57:24 -0500 "Stephen P. Molnar" wrote: > /home/comp/Downloads/R Packages/R-4.1.0/R-4.1.0/etc/Makeconf:10: > Packages/R-4.1.0/R-4.1.0/share/make/vars.mk: No such file or directory This is the case of Make breaking things by splitting the file path by whitespace. Line 9 of Ma

Re: [R] How to use contour plot?

2021-11-16 Thread Ivan Krylov
On Tue, 16 Nov 2021 09:45:34 +0100 Luigi Marongiu wrote: > contour(df$X, df$Y, df$Z) contour() works on matrices (sometimes called "wide format" data). Z must be a numeric matrix, X must be a numeric vector with length(X) == nrow(Z), and Y must be a numeric vector with length(Y) == ncol(Z). Th

Re: [R] severe bug in LICORS/kmeanspp

2021-11-19 Thread Ivan Krylov
On Wed, 3 Nov 2021 23:04:06 +0100 frit...@web.de wrote: > Since LICORS has not been updated since 2013, I am not sure if there > is an active maintainer. The named maintainer works for Google since > 2014 and may have abandoned the package. Computing the wrong distances is a serious problem. Perh

Re: [R] Defining Parameters in arules

2021-11-23 Thread Ivan Krylov
Hello, If you don't get an answer here, consider asking the package maintainer: Michael Hahsler -- Best regards, Ivan __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] Error: vector memory exhausted (limit reached?)

2021-11-24 Thread Ivan Krylov
Hello Olivia! On Tue, 23 Nov 2021 20:26:07 + Olivia Keefer wrote: > We have been able to run other regressions, but when we go to run a > certain set of variables, we both are getting this message each time > we try. It would help if you provided more information about how exactly you run t

Re: [R] read_csv() error I cannot find

2021-11-24 Thread Ivan Krylov
On Wed, 24 Nov 2021 08:37:32 -0800 (PST) Rich Shepard wrote: > Error in list(site_nbr = col_character(), sampdate = col_date(), > param = col_character(), : argument 6 is empty This typically happens when you leave a trailing comma at the end of a list() call: list( site_nbr = col_character()

Re: [R] Error: vector memory exhausted (limit reached?)

2021-11-25 Thread Ivan Krylov
On Wed, 24 Nov 2021 13:36:28 + Olivia Keefer wrote: > dim(OrigData) What is the size of OrigData? How much random-access memory does the computer have? If there's a lot of memory, are you running a 32-bit or a 64-bit build of R? > linmod4 <- lm( B5 ~ B6_1 + B6_2 + B6_3 + B6_4 + B6_5 + B6_6

Re: [R] readxl/lifecycle/rlang

2021-12-02 Thread Ivan Krylov
On Wed, 1 Dec 2021 16:38:37 -0500 Dennis Weygand wrote: > Installing package into > ‘C:/Users/dennisweygand/Documents/R/win-library/3.5’ (as ‘lib’ is > unspecified) It could be time to install a newer version of R. CRAN doesn't provide binary builds of packages for R 3.5... > binary s

Re: [R] Fwd: alternative way to define a function

2021-12-02 Thread Ivan Krylov
On Thu, 2 Dec 2021 12:23:27 +0100 Martin Møller Skarbiniks Pedersen wrote: > Is that exactly the same as: > f <- function(x,y) x * y > ? > > Is there any benefit to the first or second way to define a function? The \(arguments) syntax has been introduced in R 4.1.0: https://cran.r-project.org/d

Re: [R] Problem with lm Giving Wrong Results

2021-12-02 Thread Ivan Krylov
On Thu, 2 Dec 2021 14:34:42 + "Labone, Thomas" wrote: > Can someone point me to the procedure for switching from the Intel > Math Library back to the standard math library so that I can see if > the problem is associated with using MKL? Depends on how you have installed it. You mentioned usi

Re: [R] Forwarding missing arguments to the `[` method

2021-12-02 Thread Ivan Krylov
Sorry for sending an unfinished message! On Thu, 2 Dec 2021 23:57:11 +0300 Ivan Krylov wrote: > Why can I forward missing i,j to built-in `[` Why can I forward missing i,j to the built-in `[` method but not to user-defined methods? How can I fix this? Default i and j to TRUE? Are there l

[R] Forwarding missing arguments to the `[` method

2021-12-02 Thread Ivan Krylov
Hi everyone, Suppose I've got a class 'foo' that's a matrix tagged with a vector of length() == nrow(foo): foo <- function(x, ...) UseMethod('foo') foo.matrix <- function(x, y, ...) { stopifnot( !is.recursive(y), length(y) == nrow(x), length

Re: [R] Forwarding missing arguments to the `[` method

2021-12-02 Thread Ivan Krylov
On Thu, 02 Dec 2021 13:41:52 -0800 Jeff Newmiller wrote: > I think you need a reprex... I don't think your claim is correct as > stated. Sorry, let me try again. The following "works" for me in the sense of throwing the same error on R 3.3 and R-devel: foo <- function(x, ...) UseMethod('foo')

Re: [R] Puzzled about loading the Rattle interface package...

2021-12-07 Thread Ivan Krylov
On Mon, 6 Dec 2021 19:33:25 -0500 Brian Lunergan wrote: > Running R 4.1.2 on Linux Mint 19.3. > configure: error: GTK version 2.8.0 required Thanks for mentioning your GNU/Linux distro! You need the libgtk2.0-dev APT package installed in order to build the RGtk2 R package from source. Alternati

Re: [R] Forwarding missing arguments to the `[` method

2021-12-08 Thread Ivan Krylov
Got some progress on this, but still not sure how to continue. First, a much more simple script reproducing the behaviour that confuses me: foo <- function(x, ...) structure(x, class = 'foo') `[.foo` <- function(x, i, ..., drop = TRUE) { print(sys.call()) print(match.call())

Re: [R] Forwarding missing arguments to the `[` method

2021-12-10 Thread Ivan Krylov
On Thu, 9 Dec 2021 15:47:02 +0100 Martin Maechler wrote: > What you should take from there: > Do work with *both* > missing(drop) > and > nargs() > > (and more) > in order to distinguish m[i] from m[i,] etc Thanks for the advice! `[<-.data.frame` does make for enlightening reading. I'

Re: [R] Format dates issues with R

2021-12-14 Thread Ivan Krylov
On Tue, 14 Dec 2021 11:54:08 +0100 Luigi Marongiu wrote: > "9/29/2021" > format = "%d/%m/%y" > Why the conversion did not work? The according to the format, the date above is 9th of month No. 29 in the year 2020, followed by junk characters "21". Swap %m and %d to make them follow the actual o

Re: [R] R For Windows - Apache Log4J Vulnerability Inquiry

2021-12-14 Thread Ivan Krylov
On Tue, 14 Dec 2021 14:37:47 + "Franklin, Mark via R-help" wrote: > Would you be able to confirm if R for Windows v3.1.1 is impacted by > this vulnerability? R itself isn't written in Java, so it cannot, but the third-party Java code that you might be calling using rJava might be. Bob Rudis

Re: [R] transformTukey

2021-12-15 Thread Ivan Krylov
On Wed, 15 Dec 2021 05:11:47 -0800 Thomas Subia via R-help wrote: > data = read.delim("clipboard") What type of value does read.delim return? Use str() to find out. > > library(rcompanion) > > trans_data <- transformTukey(data) > > Error in is.infinite(TRANS) : > default method not implem

Re: [R] Need older version of R

2021-12-15 Thread Ivan Krylov
On Wed, 15 Dec 2021 17:40:15 +0530 TALARI PRAVEEN wrote: > I am a Linux ubuntu user and I want to install an older version of r > 4.0.2. Try asking in R-SIG-Debian , but if all else fails, you could always download https://cran.r-project.org/src/base/R-4/R-4.0.2.tar.gz and build it from source:

Re: [R] for loop question in R

2021-12-22 Thread Ivan Krylov
On Wed, 22 Dec 2021 16:58:18 + (UTC) Kai Yang via R-help wrote: > mpg %>%    filter(hwy <35) %>%     ggplot(aes(x = displ, y = y[i], > color = c[i])) +     geom_point() Your code relies on R's auto-printing, where each line of code executed at the top level (not in loops or functions) is run

Re: [R] How to modify object's code living in some environment?

2021-12-27 Thread Ivan Krylov
On Mon, 27 Dec 2021 14:06:49 +0100 Grzegorz Smoliński wrote: > I know it is possible to find the environment in which some object > lives using the 'environment()' function That's not exactly what environment() does. This function returns the environment belonging to a function (where it searche

Re: [R] How to modify object's code living in some environment?

2021-12-27 Thread Ivan Krylov
On Mon, 27 Dec 2021 15:36:01 +0100 Grzegorz Smoliński wrote: > write on the beginning of the body of this chosen function > 'browser()'. Is your desired result similar to what debug() (or debugonce()) does? Perhaps you won't even need to construct a call and evaluate it in a given environment f

Re: [R] mixture univariate distributions fit

2021-12-31 Thread Ivan Krylov
On Fri, 31 Dec 2021 07:59:11 + PIKAL Petr wrote: > x <- (0:100)/100 > y1 <- dnorm((x, mean=.3, sd=.1) > y2 <- dnorm((x, mean=.7, sd=.1) > ymix <- ((y1+2*y2)/max(y1+2*y2)) > My question is if there is some package or function which could get > those values ***directly from x and ymix values*

Re: [R] Error: if statement: missing value where TRUE/FALSE needed

2022-01-05 Thread Ivan Krylov
On Wed, 5 Jan 2022 15:47:07 + (UTC) Chuck Coleman via R-help wrote: > I then made the browser() statement conditional to stop execution if > a missing argument were encountered and detectspikes() happily passed > it and crashed. How exactly do you check for a missing argument? Could options

Re: [R] Error: if statement: missing value where TRUE/FALSE needed

2022-01-05 Thread Ivan Krylov
On Wed, 5 Jan 2022 21:22:37 +0300 Ivan Krylov wrote: > How exactly do you check for a missing argument? To answer my own question, the check is >> browser(expr = { >> is.na(w1) | is.na(ub) | is.na(m) | is.na(wi) | is.na(lb) >> }) I think that there are NAs in xseg, whic

Re: [R] Error in if (fraction <= 1) { : missing value where TRUE/FALSE needed

2022-01-26 Thread Ivan Krylov
On Wed, 26 Jan 2022 14:47:16 +0100 javed khan wrote: > Error in if (fraction <= 1) { : missing value where TRUE/FALSE needed > var <- ifelse(test$operator == 'T14', 1, 0) The error must be in a place different from your test$operator comparison. Have you tried traceback() to get the call stack

Re: [R] Funky calculations

2022-02-01 Thread Ivan Krylov
On Tue, 1 Feb 2022 20:45:40 +0700 Nathan Boeger wrote: > I found something strange and maybe I am going nuts but this does not > make sense: > > > (0.4 + 0.2 + 0 + 0.3 + 0 + 0.1) > 1 > [1] TRUE Unfortunately, this always happens when computers approximate real numbers with fractions in binar

Re: [R] Using .Fortran in R - how can I use file i/o flexibly OR arrays of variable length as arguments?

2022-02-05 Thread Ivan Krylov
On Sat, 5 Feb 2022 09:41:02 + Peter Green wrote: > Any thought on the other route I suggested, that is, binary file i/o > from with the Fortran code (e.g. full use of the connections > functionality), again perhaps via C? I think that Fortran I/O is only forbidden when it comes to units *

Re: [R] Question About lm()

2022-02-09 Thread Ivan Krylov
On Wed, 9 Feb 2022 22:00:40 + "Bromaghin, Jeffrey F via R-help" wrote: > These models are equivalent and the estimated coefficients come out > fine, but the R-squared and F statistics returned by summary() differ > markedly. Is the mean of yResp far from zero? Here's what summary.lm says abo

Re: [R] gstat installation problem

2022-02-17 Thread Ivan Krylov
On Wed, 16 Feb 2022 15:20:48 +0100 Poizot Emmanuel wrote: > I tried to install gstat package via install.packages('gstat') > command on R (version 3.5.2) and my OS is Debian buster. > mtrx.c: In function ‘CHfactor’: > mtrx.c:391:74: error: ‘FC_LEN_T’ undeclared (first use in this > function); d

Re: [R] Pixel Image Reshaping using R

2022-02-24 Thread Ivan Krylov
On Thu, 24 Feb 2022 11:00:08 -0500 Paul Bernal wrote: > Each pixel column in the training set has a name like pixel x, where > x is an integer between 0 and 783, inclusive. To locate this pixel on > the image, suppose that we have decomposed x as x = i ∗ 28 + j, where > i and j are integers betwe

Re: [R] Pixel Image Reshaping using R

2022-02-24 Thread Ivan Krylov
On Thu, 24 Feb 2022 13:31:09 -0500 Paul Bernal wrote: > Basically, what I am being asked to do is to take the > train.csv dataset, and store it in a data structure so that the data > can be reshaped into a matrix of size 28 x 28, then I just need to > print some indices of that (e.g. index 1, 2,

Re: [R] arrow keys in R

2022-02-26 Thread Ivan Krylov
On Thu, 24 Feb 2022 16:14:49 -0800 Bogdan Tanasa wrote: > On one hand, the symbols ^[[A^[[A^[[A appear; > On the other hand, shall I start typing a command, such as "library", > I begin by typing the first 2 letters "li", click "left arrow", and > the result is "li "(i.e. lots of spaces) instead

Re: [R] saving png images and X11

2022-02-26 Thread Ivan Krylov
On Fri, 25 Feb 2022 04:33:38 -0800 Bogdan Tanasa wrote: > Error in png_dev(..., res = dpi, units = "in") : X11 is not available > > Shall I add the option : > > options(bitmapType='cairo') > > the png images are skipped and not saved on the disk. Is this a question or a statement that png('fi

Re: [R] Problem installing Rcmdr on version 4.1.2...

2022-03-04 Thread Ivan Krylov
On Fri, 4 Mar 2022 08:23:43 -0500 Brian Lunergan wrote: > Running R 4.1.2 on Linux Mint 19.3. > g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I../inst/include > -I'/home/brian/R/x86_64-pc-linux-gnu-library/4.1/testthat/include' > -fpic -g -O2 -fdebug-prefix-map=/build/r-base-J7pprH/r-base

Re: [R] Hello

2022-03-08 Thread Ivan Krylov
On Tue, 8 Mar 2022 15:55:19 +0530 Shrinivas Dharma wrote: > I am not sure if this is the right place to ask the question of my > type. > I am wirking on a social network analysis project with R igraph > software. > > My graph data has multiple edges and multiple self loops Have you tried the i

Re: [R] NA's in segmented

2022-03-10 Thread Ivan Krylov
Hi Mélina, If you don't get an answer here, consider running maintainer(segmented) and contacting the e-mail address shown by the command. On Tue, 8 Mar 2022 20:44:35 + Mélina Cointe wrote: > I have some trouble with the slope() function of segmented. When I > plot the predicted value every

Re: [R] question

2022-03-15 Thread Ivan Krylov
On Tue, 15 Mar 2022 20:57:03 +0330 "dalfardi.s" wrote: > I have a function of a package named priority flow as bellow: > > RIVSMOOTH=RIVERSMOOTH(DEM=TRAVHS$DEM, DIRECTION=TRAVHS$DIRECTION, > MASK=FARWATERSHED.MASK,RIVER.SUMMARY=SUBBASIN$SUMMARY,RIVER.SEGMENTS=SUBBASIN$SEGMENTS,BANK.EPSILON > =0

Re: [R] R and tcltk Package

2022-03-17 Thread Ivan Krylov
On Thu, 17 Mar 2022 11:13:02 -0400 John Fox wrote: > James Wettenhall used to maintain a nice set of R Tcl/Tk examples, > but I can't find them now. The Internet Archive seems to remember them, with the last working snapshot being from 2013: http://web.archive.org/web/20130619032200/http://bioin

  1   2   3   4   5   6   >