similar to: transform.data.frame() ignores unnamed arguments when no named argument is provided

Displaying 20 results from an estimated 6000 matches similar to: "transform.data.frame() ignores unnamed arguments when no named argument is provided"

2023 Mar 02
1
transform.data.frame() ignores unnamed arguments when no named argument is provided
Note that ?transform.data.frame says arguments need to be named, so you are testing unspecified behaviour. I guess this falls in a similar category as the note If some of the values are not vectors of the appropriate length, you deserve whatever you get! Experiments for a related Problem Report (<https://bugs.r-project.org/show_bug.cgi?id=17890>) showed that packages
2023 Mar 02
1
transform.data.frame() ignores unnamed arguments when no named argument is provided
On Thu, Mar 2, 2023 at 2:02?PM Antoine Fabri <antoine.fabri at gmail.com> wrote: > Thanks and good point about unspecified behavior. The way it behaves now > (when it doesn't ignore) is more consistent with data.frame() though so I > prefer that to a "warn and ignore" behaviour: > > data.frame(a = 1, b = 2, 3) > > #> a b X3 > > #> 1 1 2 3
2023 Mar 03
2
transform.data.frame() ignores unnamed arguments when no named argument is provided
>>>>> Gabriel Becker >>>>> on Thu, 2 Mar 2023 14:37:18 -0800 writes: > On Thu, Mar 2, 2023 at 2:02?PM Antoine Fabri > <antoine.fabri at gmail.com> wrote: >> Thanks and good point about unspecified behavior. The way >> it behaves now (when it doesn't ignore) is more >> consistent with data.frame() though so I
2023 Mar 03
1
transform.data.frame() ignores unnamed arguments when no named argument is provided
Let me expand a bit, I might have expressed myself poorly. If there is a good reason for a warning I want a warning, and because I take them seriously I don't want my console cluttered with those that can be avoided. I strongly believe we should strive to make our code silent, and I like my console to tell me only what I need to know. In my opinion many warnings would be better designed as
2023 Mar 02
1
transform.data.frame() ignores unnamed arguments when no named argument is provided
Thanks and good point about unspecified behavior. The way it behaves now (when it doesn't ignore) is more consistent with data.frame() though so I prefer that to a "warn and ignore" behaviour: data.frame(a = 1, b = 2, 3) #> a b X3 #> 1 1 2 3 data.frame(a = 1, 2, 3) #> a X2 X3 #> 1 1 2 3 (and in general warnings make for unpleasant debugging so I prefer
2023 Mar 04
1
transform.data.frame() ignores unnamed arguments when no named argument is provided
I am probably mistaken but it looks to me like the design of much of the data.frame infrastructure not only does not insist you give columns names, but even has all kinds of options such as check.names and fix.empty.names https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/data.frame During the lifetime of a column, it can get removed, renamed, transfomed in many ways and so on. A
2010 Jul 07
2
What does `_data` mean in transform()?
Hi All, I meant to take the min row by row. But the result is apparently not what I want. Changing min to pmin solve the problem. > df=data.frame(X=1:10, Y=1:10) > transform(df, Z=min(X,10-Y)) X Y Z 1 1 1 0 2 2 2 0 3 3 3 0 4 4 4 0 5 5 5 0 6 6 6 0 7 7 7 0 8 8 8 0 9 9 9 0 10 10 10 0 I try to look at the source code to understand what transform() does. I know
2009 Jul 19
1
transform(_data,...) using strptime gives an error
I have timstamped data like this: > sd[1:10,] Tstamp Density Mesh50 Mesh70 Mesh100 Mesh150 Mesh200 2 2009/02/27 07:00 30.5 0.7 10.7 21.4 32.8 41.6 3 2009/02/27 08:00 32.2 1.6 12.4 23.3 34.5 43.0 4 2009/02/27 09:00 32.7 4.8 13.0 24.0 35.1 43.5 5 2009/02/27 10:00 26.7 0.3 6.5 17.6 28.1 36.9 6 2009/02/27 11:00
2012 Apr 06
4
Order sapply
Good Afternoon, I have the following code, but it seems that something must be doing wrong, because it is giving the results I want. The idea is to create segments while the value of Commutation is less than 1000. for example, from the small set of data below text=" val_user pos v v_star v_end commutation v_source v_destine 1 1 96-96 1173438391 1173438391 0
2018 May 19
0
Split a data.frame
Hello, Maybe something like the following. splitDF <- function(data, col, s){ n <- nrow(data) inx <- which(data[[col]] %in% s) lapply(seq_along(inx), function(i){ k <- if(inx[i] < n) (inx[i] + 1):(inx[i + 1]) data[k, ] }) } splitDF(DF, "name", split_str) Hope this helps, Rui Barradas On 5/19/2018 12:07 PM, Christofer Bogaso
2009 Dec 04
0
Renaming columns of a data.frame
A question that has come up a few times on r-help is how to rename columns of a data.frame. There are several ways to do this by hand (see the list archives). There is also a 'rename' function in the reshape package. I often use the 'transform' function shortly after reading in a data file and wanted to have a renaming function that has a syntax consistent with the
2012 Aug 01
1
Error message: $ operator is invalid for atomic vectors
HI, The code was working perfectly fine yesterday and today, until half an hour ago.? Couldn't find any problems in the code. Still, I am getting error message. myMatrix <- data.matrix(read.table(text=" Name??????????? Age ANTONY??????? 27 IMRAN????????? 30 RAJ????????????????? 22 NAHAS????????? 32 GEO??????????????? 42 ", header=TRUE)) MinMaxArray? <- data.frame(MIN =
2018 May 22
0
remove rows of a matrix by part of its row name
Hello, Use grep to get the row indices and then subset with a *negative* index to remove those rows. rn <- scan(what = character(), text = " 70/556 71.1/280 72.1/556 72.1/343 73.1/390 73.1/556 ") mat <- matrix(rnorm(6*6), nrow = 6) row.names(mat) <- rn inx <- grep("73\\.", row.names(mat)) new_mat <- mat[-inx, ] new_mat Hope this helps, Rui Barradas On
2018 May 22
0
remove rows of a matrix by part of its row name
Hello, Please always cc the list. As for the question, yes, it does. If you want to remove just the ones with exactly 73.1 use the pattern grep("^73\\.1$", etc) Explanation: Beginning of string: ^ End of string: $ Escape special characters: \\ (needed because the period is a special character.) Hope this helps, Rui Barradas On 5/22/2018 12:50 PM, Ahmed Serag wrote: > Thank
2005 Aug 26
1
compare c-index of two logistic models using rcorrp.senc() of the Hmisc library
Dear R-help, Would it be appropriate to do the following to calculate a p-value for the difference between c-ind of x1 and c-inx of x2 using the output from rcorrp.senc() > r<-rcorrp.senc(x1,x1,y) > pValue<-1-pnorm((r[11]-r[12])/(r[2]/r[5])*1.96) Osman O. Al-Radi, MD, MSc, FRCSC Chief Resident, Cardiac Surgery University of Toronto, Canada
2017 Dec 09
1
Remove
Hello, Try the following. keep <- list(A = c(15, 30), B = c(40, 50), C = c(60, 75)) sp <- split(DM$x, DM$GR) inx <- unlist(lapply(seq_along(sp), function(i) keep[[i]][1] <= sp[[i]] & sp[[i]] <= keep[[i]][2])) DM[inx, ] # GR x y #1 A 25 125 #2 A 23 135 #5 B 45 321 #6 B 47 512 #9 C 61 521 #10 C 68 235 Hope this helps, Rui Barradas On 12/9/2017 12:48 AM, Ashta
2005 May 18
1
Audio flutter on OH323 output?
Hi, I'm using OH323, mostly with success, to interface Asterisk to a provider's switch (World Telecom INX). I have noticed a particular effect, and I wonder whether anyone else has seen the same? The effect is audio flutter (almost like the flutter one gets on MF or HF radio sometimes) which only happens intermittently. Audio coming into Asterisk is unaffected, as proved by using the
2006 Feb 15
0
readline() for passwords?
I don't like to have my password exposed by typing at all. I also don't like to enter it each time that I wish to open a database (or when I run scripts automatically across a Linux cluster). My solution has been to keep a file in my HOME directory containing the username and password for the databases. This file has read and write permission set so only I (and root) can read it; this is
2009 Dec 17
2
Sweave Makefile issue
Dear R-specialists, I am trying to create a Makefile that will first convert all my .Rnw files into .tex files and then, that will run the LaTeX compiler to produce a pdf document. This issue has been discussed before. Hence, I've basically adapted a Makefile I found at http://n4.nabble.com/R-Sweave-R-and-complex-latex-projects-td810020.html#a810023 to make it compatible with a Windows
2018 May 19
5
Split a data.frame
Hi, I am struggling to split a data.frame as will below scheme : DF = data.frame(name = c('a', 'v', 'c'), val = 0); DF split_str = c('a', 'c') Now, for each element in split_str, R should find which row of DF contains that element, and return DF with all rows starting from next row of the corresponding element and ending with the preceding value of the