Re: [R] [External] Re: Help please

2021-03-10 Thread Richard M. Heiberger
> table(scrounging) substr behav air ground tree vine active 1 536 foraging 2 630 inactive 6 113 snoozing 2 137 > likert(t(table(scrounging))) From: R-help on behalf of Ji

Re: [R] Help please

2021-03-10 Thread Jim Lemon
Hi Areti, Maybe this will help: scrounging<-data.frame( behav=sample(c("inactive","active","foraging","snoozing"),50,TRUE), substr=sample(c("tree","ground","vine","air"),50,TRUE)) scrounge.tab<-table(scrounging) barplot(scrounge.tab) legend(3.8,14,c("inactive","active","foraging","snoozing"), f

Re: [R] [External] Help please

2021-03-10 Thread Richard M. Heiberger
> counts <- with(mtcars, table(gear, vs)) > counts vs gear 0 1 3 12 3 4 2 10 5 4 1 > likert(counts) > If this isn't enough, ask a more specific question. From: R-help on behalf of Richard M. Heiberger Sent: Wednesday, March 10, 2021 1

Re: [R] Help please

2021-03-10 Thread Rui Barradas
Hello, Please read the posting guide at the end of this and every R-Help mail. You should post the output of dput(data) or, if the data set 'data' is too big, the output of dput(head(data, 20)) for us to be able to help you. Rui Barradas Às 18:29 de 10/03/21, Areti Panopoulou escreveu: Hel

Re: [R] [External] Help please

2021-03-10 Thread Richard M. Heiberger
install.packages("HH") library(HH) ?likert >From your description, I think your data is set up to work with likert() From: R-help on behalf of Areti Panopoulou Sent: Wednesday, March 10, 2021 13:29 To: r-help@r-project.org Subject: [External] [R] Help p

[R] Help please

2021-03-10 Thread Areti Panopoulou
Hello, I am trying to make a stacked barplot with different behaviours ("inactive", "active", "foraging" etc) on different substrates ("tree", "ground" etc). I have found this function: # Stacked Bar Plot with Colors and Legend counts <- table(mtcars$vs, mtcars$gear) barplot(counts, main="Car Dis

[R] [R-pkgs] {peruse}

2021-03-10 Thread Jacob Goldsmith
Hello all, R package {peruse 0.3.1} is on CRAN. {peruse} provides simple tools for sequence iteration and set comprehension. It is especially useful for analyzing recursively generated sequences, including any stochastic process. The main page at https://jacgoldsm.github.io/peruse/ provides in-

Re: [R] Color in stripchart

2021-03-10 Thread Dr. Robin Haunschild
and slicing the df > according to the color, like so > > set.seed(20210310) > years <- sample(x=seq(2011, 2018), size = 365*8, replace = TRUE) > values <- sample(x=seq(0,100), size = 365*8, replace = TRUE) > df <- data.frame(year = years, value = valu

Re: [R] Color in stripchart

2021-03-10 Thread Rasmus Liland
Hello there again, Sorry, I missed that part in the middle about set.seed. As per [1], you need to run stripchart again with the add argument set to TRUE, and slicing the df according to the color, like so set.seed(20210310) years <- sample(x=seq(2011, 2018), size = 36

Re: [R] Color in stripchart

2021-03-10 Thread Dr. Robin Haunschild
r <- 'red' >> stripchart(df$value ~ df$year, pch=18, col=df$color, method='stack') >> >> When I use multiple values per y axis category, all points in a specific >> y axis category have the same color: >> >> set.seed(20210310) >> y

Re: [R] Color in stripchart

2021-03-10 Thread Dr. Robin Haunschild
Dear Rasmus, there is no difference in the small exmaple, because there is only one point per year. If you use the example with multiple points per year, you will see the difference. Best, Robin On 3/10/21 3:15 PM, Rasmus Liland wrote: > Dear Robin and Gerrit, > > I am unable to see the diffe

Re: [R] Color in stripchart

2021-03-10 Thread Rasmus Liland
Dear Robin and Gerrit, I am unable to see the difference in the plot in the two cases ... df <- data.frame(year = seq(2011, 2018), value = seq(10, 80, 10)) df$color <- 'black' df[df$value<33,]$color <- 'blue' df[df$value>66,]$color <- 'red' file

Re: [R] Color in stripchart

2021-03-10 Thread Gerrit Eichner
lor <- 'red' stripchart(df$value ~ df$year, pch=18, col=df$color, method='stack') When I use multiple values per y axis category, all points in a specific y axis category have the same color: set.seed(20210310) years <- sample(x=seq(2011, 2018), size = 365*8, rep

[R] Color in stripchart

2021-03-10 Thread Dr. Robin Haunschild
x27;blue' df[df$value>66,]$color <- 'red' stripchart(df$value ~ df$year, pch=18, col=df$color, method='stack') When I use multiple values per y axis category, all points in a specific y axis category have the same color: set.seed(20210310) years <- sample(x=seq(2011,