Displaying 20 results from an estimated 1000 matches similar to: "Using unsplit - unsplit does not seem to reverse the effect of split"
2010 Apr 19
2
Using split and then unsplit
Hello everyone,
I use the split function splitting with the f function on a 3 columns and
more than 100 000 rows data frame. Once it's split I have a list of data
frames still with 3 columns and n rows. I manipulate those list elements and
get a list of data frames still with 3 columns but less rows. So when I
unsplit it, I get an error as I use the same factor function I used to split
( f in
2002 Jul 28
1
[R] bug in unsplit()? (PR#1843)
Hedderik van Rijn <hedderik@cmu.edu> writes:
> If the second argument to unsplit is not a simple vector (but a "list
> containing multiple lists"), the function seems to have some problems.
>
> Given a slight modification of the examples in help(split):
>
> > xg <- split(x,list(g1=g,g2=g))
> > unsplit(xg,list(g1=g,g2=g))
> [1] -0.7877109
2006 Jun 08
1
NAs in unsplit factor
R-devel,
Below is a simple example calling split and unsplit on a numeric
vector of length 2 where 'f' is c(1,NA).
> unsplit(split(c(1,2), c(1,NA)), c(1,NA))
[1] 1 0
I noticed that the call to vector in unsplit gives us 0 as the 2nd
element of the result.
Is this the intended result, as opposed to NA?
Thanks for your help,
Jeff
--
Jeff Enos
Kane Capital Management
jeff at
2020 Nov 21
3
Error in unsplit() with tibbles
Hello,
using the `unsplit()` function with tibbles currently leads to the
following error:
> mtcars_tb <- as_tibble(mtcars, rownames = NULL)
> s <- split(mtcars_tb, mtcars_tb$gear)
> unsplit(s, mtcars_tb$gear)
Error: Must subset rows with a valid subscript vector.
? Logical subscripts must match the size of the indexed input.
x Input has size 15 but subscript `rep(NA, len)` has
2020 Nov 21
2
Error in unsplit() with tibbles
I get the sentiment, but this is really just bad coding (on my own part, I suspect), so we might as well just fix it...
-pd
> On 21 Nov 2020, at 17:42 , Marc Schwartz via R-devel <r-devel at r-project.org> wrote:
>
>
>> On Nov 21, 2020, at 10:55 AM, Mario Annau <mario.annau at gmail.com> wrote:
>>
>> Hello,
>>
>> using the `unsplit()`
2009 May 08
1
unsplit list of data.frames with one column
Perhaps this is the intended behavior, but I discovered that unsplit
throws an error when it tries to set rownames of a variable that has
no dimension. This occurs when unsplit is passed a list of
data.frames that have only a single column.
An example:
df <- data.frame(letters[seq(25)])
fac <- rep(seq(5), 5)
unsplit(split(df, fac), fac)
For reference, I'm using R version 2.9.0
2011 May 19
1
Problems with unsplit()
Hi everyone,
I have already used split() and unsplit() in data frames without problems,
but now I’m applying these functions to other data and when using unsplit()
I have received the following message:
Error in `row.names<-.data.frame`(`*tmp*`, value = c("1", "2", "3", "4", :
duplicate ''row.names'' are not allowed
In
2005 Jun 25
1
group means: split and unsplit
Took me a while but I figured out how to put in common values of
group means/counts, etc. to do the same thing as egen. lapply with
split and then unsplit.
Thomas Davidoff
Assistant Professor
Haas School of Business
UC Berkeley
Berkeley, CA 94720
phone: (510) 643-1425
fax: (510) 643-7357
davidoff@haas.berkeley.edu
http://faculty.haas.berkeley.edu/davidoff
[[alternative HTML
2009 Nov 25
0
Possible bug in "unsplit" (PR#14084)
Dear R-bug-people
I have encountered a problem with "unsplit", which I believe may be
caused by a bug in the function. However, unexpericend with bug-reports
I apologise if this is barely a user problem rather than a problem
within R.
The problem occurs if an object is split by several grouping factors
with levels not occuring in the data, and using drop = TRUE. This may
appear as
2020 Nov 21
0
Error in unsplit() with tibbles
> On Nov 21, 2020, at 10:55 AM, Mario Annau <mario.annau at gmail.com> wrote:
>
> Hello,
>
> using the `unsplit()` function with tibbles currently leads to the
> following error:
>
>> mtcars_tb <- as_tibble(mtcars, rownames = NULL)
>> s <- split(mtcars_tb, mtcars_tb$gear)
>> unsplit(s, mtcars_tb$gear)
> Error: Must subset rows with a valid
2020 Nov 21
0
Error in unsplit() with tibbles
Cool - thank you Peter!
@Marc: This is really not a tidyverse vs base-R debate and I personally
think that they should both work together for most parts. The common
environment is still R. But just to give you the full picture I also filed
a bug for tibbles (https://github.com/tidyverse/tibble/issues/829). With
these two fixes I think that split/unsplit would work for tibbles and users
(like me)
2012 Mar 16
1
MSetIterator::get_percent Shows Increased Values When Using Query::OP_FILTER
I'm seeing some rather odd behavior with respect to the match percent that
is returned when performing a simple query. It appears that the addition of
a filter to a simple OR query will not affect the weight of the match, but
will increase the percent of the resulting match. According to the
documentation for MSetIterator::get_percent (
2002 Jul 28
0
[R] bug in unsplit()? (PR#1845)
Hedderik van Rijn <hedderik@cmu.edu> writes:
> > Thanks for pointing this out. I think your code should work, although
> > I'm slightly uneasy about actually modifying f, so how about
>
> Just curious, why are you uneasy about that? Does it have side effects?
It is largely due superstition, but if you change f before calling
split<-() you have split() and
2011 Mar 10
1
getting percentiles by factor
Hello,
I'm trying to get percentiles (PERCENTRANK for excel users) by factor in the
following data.frame:
myExample <- data.frame(Ret=seq(-2, 2.5,
by=0.5),PE=seq(10,19),Sectors=rep(c("Financial","Industrial"),5))
myExample <- na.omit(myExample)
Thanks to Patrick I I managed to put together the following lines which does
it for the "Ret" column:
myecdf
2010 Apr 13
2
efficiently picking one row from a data frame per unique key
Hello all, I'm trying to transform data frames by grouping the rows by the
values in a particular column, ordered by another column, then picking the
first row in each group.
I'd like to convert a data frame like this:
x y z
1 10 20
1 11 19
2 12 18
4 13 17
into one with three rows, like this, where i've discarded one row:
x y z
1 1 11 19
2 2 12 18
4 4 13 17
I've got a
2006 Feb 15
2
Plotting two 3-dimensional time series in a 3 x 2 plot - alternatives to par(mfrow())
I am trying to plot two 3-dimensional time series in one window (such that there will be 3 rows and 2 columns). For zoo and ts objects the par(mfrow...) option does not work. I can get xyplot to make the plots, but data are on widely different scales in the three dimensions, and xyplot uses the same scale on all y-axis which means that in some dimensions the curves will be almost horizontal lines.
2006 Oct 19
2
problem with queries
Hello,
I upgraded to ferret 0.10.10 and I noticed a strange behaviour with queries.
Now the queries return strange results. For example, the two following
queries return the same results:
familynames|firstnames:andre
familynames|firstnames:andr
Another example, the first query returns a correct result + incoherent
results, the second query returns only the correct result:
2003 Sep 13
2
How to test * ?
I was wondering, can I test * using just a modem card? I was want to
check ome of the features, before I go and buy some cards. (Thanks for
th elink to the reseller page, you know who you are!)
--
*****
Not everyone is touched by an Angel....
.... Those that are, never forget the experience
*****
2009 Nov 19
2
Efficient cbind of elements from two lists
Hi!
I have a data.frame "data" and splitted it.
data <- split(data, data[,1])
This is a quite slow procedure; and I do not want to do it again. So,
any unsplit and "resplit" is no option for me.
But: I have to cbind "variables" to the splitted data from another list,
that contains of vectors with matching sizes, so
for (i in 1:length(data)) {
data[[i]]
2006 May 12
1
zfs panic when unpacking open solaris source
When unpacking the solaris source onto a local disk on a system running build 39 I got the following panic:
panic[cpu0]/thread=d2c8ade0:
really out of space
d2c8a7b4 zfs:zio_write_allocate_gang_members+3e6 (e4385ac0)
d2c8a7d0 zfs:zio_dva_allocate+81 (e4385ac0)
d2c8a7e8 zfs:zio_next_stage+66 (e4385ac0)
d2c8a800 zfs:zio_checksum_generate+5e (e4385ac0)
d2c8a81c zfs:zio_next_stage+66 (e4385ac0)