All true Jeff, but why do things the easy way! LOL!
My point was that various data structures, besides the list we started with,
store the names as an attribute. Yes, names(listname) works fine to extract
whatever parts they want. My original idea of using a data.frame was because
it creates names
What a remarkable set of detours, Avi, all deriving apparently from a few gaps
in your understanding of R.
As Rolf said, "names(test)" is the answer.
a) Lists are vectors. They are not atomic vectors, but they are vectors, so
as.vector(test) is a no-op.
test <- list( a = 1, b = 2, c=3 )
attrib
Evan,
List names are less easy than data.frame column names so try this:
> test <- list(a=3,b=5,c=11)
> colnames(test)
NULL
> colnames(as.data.frame(test))
[1] "a" "b" "c"
But note an entry with no name has one made up for it.
> test2 <- list(a=3,b=5, 666, c=11)
> colnames(data.frame(test2))
[
On Thu, 25 May 2023 13:29:52 -0400
Evan Cooch wrote:
> Suppose I have the following list:
>
> test <- list(a=3,b=5,c=11)
>
> I'm trying to figure out how to extract the characters to the left of
> the equal sign (i.e., I want to extract a list of the variable names,
> a, b and c.
>
> I've tri
Thank you to both Duncan and Ivan for the detailed answers. I'll point
the mixR maintainer at this thread in the list archive, because your
suggestions were so clear, and I can't explain them as thoroughly.
I'll keep using x as the argument name for now.
Much appreciated,
Sarah
On Thu, May 25, 2
Suppose I have the following list:
test <- list(a=3,b=5,c=11)
I'm trying to figure out how to extract the characters to the left of
the equal sign (i.e., I want to extract a list of the variable names, a,
b and c.
I've tried the permutations I know of involving sub - things like
sub("\\=.*"
Maybe... if you want it to act like a matrix... then you should... use a
matrix...
I think making this behaviour work with 2d arrays could be a feature, but
making it work with higher dimension arrays would be difficult, and
differentiating between 2d and higher dimension arrays could have just
I really don't know. I would call it a request for extended capabilities of
[.data.frame, rather than a feature or bug. But maybe wiser heads than mine
who monitor this list can sort it out.
-- Bert
On Wed, May 24, 2023 at 8:52 PM Georg Kindermann
wrote:
> So is this an expected behavior or is
(Sorry for the double post.)
В Thu, 25 May 2023 18:53:45 +0300
Ivan Krylov пишет:
> print(fit1) # tracer not called
Interesting. There must be some caching involved. If print(a) is
resolved to print.mixfitEM at least once, it keeps failing. In a fresh
R session, where a trace()-patch is done be
В Thu, 25 May 2023 10:18:13 -0400
Sarah Goslee пишет:
> print called on this object gets passed to print.mixfitEM(), which is:
>
>
> function (x, digits = getOption("digits"), ...)
> {
> family <- x$family
> mc <- match.call()
> mc$digits <- digits
> fun.name <- paste0("print",
On 25/05/2023 10:18 a.m., Sarah Goslee wrote:
Hi,
I ran into a problem with S3 method dispatch and scoping while trying
to use functions from the mixR package within my own functions. I know
enough to find the problem (I think!), but not enough to fix it
myself. The problem isn't really a packag
Hi,
I ran into a problem with S3 method dispatch and scoping while trying
to use functions from the mixR package within my own functions. I know
enough to find the problem (I think!), but not enough to fix it
myself. The problem isn't really a package-specific problem, so I'm
starting here, and wi
Full schedule available on developer.r-project.org in a short while.
--
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd@cbs.dk Priv: pda...@gmail.com
So is this an expected behavior or is it a bug which should be reported
somewhere else?
Thanks!
Georg
Gesendet: Dienstag, 09. Mai 2023 um 19:28 Uhr
Von: "Bert Gunter"
An: "Georg Kindermann"
Cc: "Rui Barradas" , r-help@r-project.org
Betreff: Re: [R] data.frame with a column containing an a
14 matches
Mail list logo