Displaying 20 results from an estimated 10000 matches similar to: "extract parts of a list before symbol"
2024 Sep 27
7
Is there a sexy way ...?
I have (toy example):
x <- list(`1` = c(7, 13, 1, 4, 10),
`2` = c(2, 5, 14, 8, 11),
`3` = c(6, 9, 15, 12, 3))
and
f <- factor(rep(1:3,5))
I want to create a vector v of length 15 such that the entries of v,
corresponding to level l of f are the entries of x[[l]]. I.e. I want
v to equal
c(7, 2, 6, 13, 5, 9, 1, 14, 15, 4, 8, 12, 10, 11, 3)
I can create v
2024 Apr 22
2
x[0]: Can '0' be made an allowed index in R?
You could have negative indices. There are two ways to do this.
1) provide a large offset.
Offset <- 30
for (i in -29 to 120) { print(df[i+Offset])}
2) use absolute values if all indices are negative.
for (i in -200 to -1) {print(df[abs(i)])}
Tim
-----Original Message-----
From: R-help <r-help-bounces at r-project.org> On Behalf Of Peter Dalgaard via R-help
Sent: Monday, April 22,
2024 Feb 05
1
Help
Please see fortunes::fortune(285).
cheers,
Rolf Turner
--
Honorary Research Fellow
Department of Statistics
University of Auckland
Stats. Dep't. (secretaries) phone:
+64-9-373-7599 ext. 89622
Home phone: +64-9-480-4619
2024 Apr 22
1
x[0]: Can '0' be made an allowed index in R?
See fortunes::fortune(36).
cheers,
Rolf Turner
--
Honorary Research Fellow
Department of Statistics
University of Auckland
Stats. Dep't. (secretaries) phone:
+64-9-373-7599 ext. 89622
Home phone: +64-9-480-4619
2024 May 07
1
Is there some way to customize colours for the View output?
On Tue, 7 May 2024 06:34:50 -0400
Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
> On 07/05/2024 6:31 a.m., Iago Gin? V?zquez wrote:
> > Thanks Duncan.
> >
> > I am currently on Windows. Is there any solution for it?
>
> Switch to Linux or MacOS?
Fortune nomination!
cheers,
Rolf Turner
--
Honorary Research Fellow
Department of Statistics
University of
2024 Sep 29
1
Is there a sexy way ...?
On Sat, 28 Sep 2024 10:26:31 +0100
CALUM POLWART <polc1410 at gmail.com> wrote:
> Avi
>
> I fear this was all a huge social experiment.
>
> Testing if a post titled "sexy way" would increase engagement...
<SNIP>
I conjecture that this conjecture was tongue-in-cheek. Be that as it
were ??, let me assure everyone that such was not my intention. The
usage
2024 Dec 02
1
Fortune nomination.
On Sun, 1 Dec 2024 21:43:45 -0800
Bert Gunter <bgunter.4567 at gmail.com> wrote:
> Finally, my best advice would be to forget about SAS if you wish to
> use R. Trying to translate SAS paradigms into R is the devil's work.
cheers,
Rolf Turner
--
Honorary Research Fellow
Department of Statistics
University of Auckland
Stats. Dep't. (secretaries) phone:
2024 Feb 27
1
Interactions in regression
I have no real idea what you are trying to do, but if a table is
what you want, you can probably get it using the table() function.
Or, more likely, the xtabs() function.
Using your example from an earlier post (adjusted to make it
comprehensible to the human mind):
set.seed(1000)
time <- factor(rep(c("Pre","Post"),each=200))
treatment <-
2024 Sep 29
1
Is there a sexy way ...?
Admit it, Rolf. Haven't you wondered if S, in a more private way, is sexier than R?
OK, kidding aside, we have talked this to death.
Just FYI, the conversation was stimulating for some of us and I have continued on my own and located functions I see as useful in the stringi and stringr packages to make my silly version ever less silly! LOL!
-----Original Message-----
From: Rolf Turner
2024 Apr 22
1
x[0]: Can '0' be made an allowed index in R?
Heh. Did anyone bring up negative indices yet?
-pd
> On 22 Apr 2024, at 10:46 , Rolf Turner <rolfturner at posteo.net> wrote:
>
>
> See fortunes::fortune(36).
>
> cheers,
>
> Rolf Turner
>
> --
> Honorary Research Fellow
> Department of Statistics
> University of Auckland
> Stats. Dep't. (secretaries) phone:
> +64-9-373-7599
2024 Feb 28
1
Interactions in regression
Hi Rolf,
No it is not.
I don't know to which question did you want to respond ?
I desribed everything in my first email and attached links from SO with
pictures included, which are quite understandable.
Cheers,
Jacek
wt., 27 lut 2024 o 02:29 Rolf Turner <rolfturner at posteo.net> napisa?(a):
>
> I have no real idea what you are trying to do, but if a table is
> what you
2024 May 13
1
Is there some way to customize colours for the View output?
Hi all,
I've just could test your suggestions on using dataedit... entries now, and indeed they work... partially. See, please, the next screenshot:
https://ibb.co/Dkn2pVs
dataedituser modifies the red borders
dataedittext the yellow text
dataeditfg... I do not know, specified to green the output of View(mtcars) does not change from that of the screenshot
dataeditbg is the (almost) black
2024 Feb 04
3
Help
I have done a scatter plot in R. I want to insert the coefficient of
determination R^2 = 0.62 as a text in the plot. I have tried to write R^2
but could not produce R2. I would appreciate it if someone could help me
with the syntax. I have tried: expression(paste("", R^2,"=", 0.62)), but
it did not produce R squared, rather it gave me error messages. Thanks.
Jibrin Alhassan
2024 Feb 19
1
Help
I am writing my master thesis in which I compared two cultures . So for my statistics I need to compare Age,Sex,Culture as well as have a look at the tasks scores .
Anyone familiar with this ?
I?d love to share my script so you guide me where I did wrong .
Regards
2024 Nov 26
1
Using vi syntax in command line editing.
Maybe
https://stackoverflow.com/questions/6235034/vi-keybindings-for-r-command-line-like-in-bash
?? (tl;dr "set editing-mode vi" or "set keymap vi" in .inputrc ... )
On 11/25/24 20:09, Rolf Turner wrote:
>
>
> I have recently acquired a new laptop. (My old one was giving me
> ominous messages on boot-up, about possible hard drive problems.)
>
> I
2023 Feb 13
2
Removing variables from data frame with a wile card
x[?V2?] would retain columns of x headed by V2. What I need is the opposite??I need a data grime with those columns excluded.
Steven from iPhone
> On Feb 13, 2023, at 9:33 AM, Rolf Turner <r.turner at auckland.ac.nz> wrote:
>
> ?
>> On Sun, 12 Feb 2023 14:57:36 -0800
>> Jeff Newmiller <jdnewmil at dcn.davis.ca.us> wrote:
>>
>> x["V2"]
2024 Apr 23
1
x[0]: Can '0' be made an allowed index in R?
Doesn't sound like you got the point. x[-1] normally removes the first element. With 0-based indices, this cannot work.
- pd
> On 22 Apr 2024, at 17:31 , Ebert,Timothy Aaron <tebert at ufl.edu> wrote:
>
> You could have negative indices. There are two ways to do this.
> 1) provide a large offset.
> Offset <- 30
> for (i in -29 to 120) { print(df[i+Offset])}
>
2024 Apr 22
1
x[0]: Can '0' be made an allowed index in R?
Hans,
It is a good question albeit R made a conscious decision to have indices
that correspond to things like row numbers and thus start with 1. Some
others have used a start of zero but often for reasons more related to
making use of all combinations of the implementation of integers on many
machines where starting with 1 would only allow use of the 255 of the 256
combinations available in 8
2024 Apr 23
2
x[0]: Can '0' be made an allowed index in R?
Hello Peter,
Unless I too misunderstand your point, negative indices for removal do
work with the Oarray package (though -0 doesn't work to remove the 0th
element, since -0 == 0 -- perhaps what you meant):
> library(Oarray)
> v <- Oarray(1:10, offset=0)
> v
[0,] [1,] [2,] [3,] [4,] [5,] [6,] [7,] [8,] [9,]
1 2 3 4 5 6 7 8 9 10
> dim(v)
2024 Aug 07
1
Manually calculating values from aov() result
Dear Brian,
As Duncan mentioned, the terms type-I, II, and III sums of squares
originated in SAS. The type-II and III SSs computed by the Anova()
function in the car package take a different computational approach than
in SAS, but in almost all cases produce the same results. (I slightly
regret using the "type-*" terminology for car::Anova() because of the
lack of exact