Re: [R] Wide to long format in R

2021-05-17 Thread PIKAL Petr
Hi Please do not post in HTML formating, your messages are then messy. Better to show how your data frame look like is something like dput(bop.df[1:10,]) Anyway, melt/cast functions from reshape2 package are quite handy for such tasks. Cheers Petr > -Original Message- > From: R-help

Re: [R] series of densities

2021-05-17 Thread Troels Ring
Thanks a lot to David and William - I think ggplot( data=ddd, aes(x=pH, y=BC,group=interaction(type,pH), col=type))+geom_boxplot() was very helpful! All best Troels Den 18-05-2021 kl. 02:27 skrev David Winsemius: ggplot( data=ddd, aes(x=pH, y=BC,group=interaction(type,pH), col=type))+geom_

Re: [R] series of densities

2021-05-17 Thread William Michels via R-help
Hi Troels, Have you considered using Lattice graphics? Adapting from examples on the help page: > ?histogram() > histogram( ~ BC | pH, data = ddd, type = "density", xlab = "BC", layout = c(1, 3), aspect = 0.618, strip = strip.custom(strip.levels=c(TRUE,TRUE)), panel = function(x, ...) {

Re: [R] series of densities

2021-05-17 Thread David Winsemius
On 5/17/21 7:44 AM, Troels Ring wrote: Dear friends I'm trying to plot in silico derived values of 3 types of buffer-capacities  over pH values and want densities of the three types together at each pH with the pH values on the abscissa. I have generated some data set.seed(2345) pHs <- c(7

Re: [R] Solving a quadratically constrained linear program with inital values

2021-05-17 Thread Bert Gunter
Have you looked here: https://cran.r-project.org/web/views/Optimization.html (Warning: I have no idea whether your query even makes mathematical sense.) Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed

Re: [R] series of densities

2021-05-17 Thread David Winsemius
On 5/17/21 7:44 AM, Troels Ring wrote: Dear friends I'm trying to plot in silico derived values of 3 types of buffer-capacities  over pH values and want densities of the three types together at each pH with the pH values on the abscissa. I have generated some data set.seed(2345) pHs <- c(7

[R] Solving a quadratically constrained linear program with inital values

2021-05-17 Thread Pascal Kündig
Hi everyone, I'm looking for an R-function that solves a quadratically constrained linear program of the form: min(x) -\mu' x subject to x' \Sigma x <= s 1'x <= 1 -1'x <= -1 Ix <= u -Ix <= -b while considering a given starting value for the vector x. The above problem results from a larger pro

[R] [R-pkgs] blocklength 0.1.4 released

2021-05-17 Thread Alec Stashevsky
Dear R Community, blocklength 0.1.4 has been released to CRAN (https://cran.r-project.org/package=blocklength! blocklength is a package with several methods to automatically select the optimal block-length parameter to be used in a block-bootstrap procedure of dependent data, such as stationary

Re: [R] Filtering a dataframe

2021-05-17 Thread Saneesh C S
Country <- c('Angola', 'Angola','Botswana', 'Botswana','Zimbabwe','Zimbabwe') year <- c('2006', '2007', '2008', '2009', '2010', '2006') bank_ratio <- c(24,25,38,34,42,49) Reserve_ratio <- c(77,59,64,65,57,86) broad_money <- c(163,188,317,361,150,288) id <- (c(1,1,2,2,3,3)) df <- data.frame(Country

Re: [R] phylogenetic correction and MCMC model

2021-05-17 Thread Bert Gunter
Such specialized questions are usually better posted on appropriate R-sigs, in this case, https://stat.ethz.ch/mailman/listinfo/r-sig-phylo I presume. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in

Re: [R] Filtering a dataframe

2021-05-17 Thread Eric Berger
If your data frame is named x then y <- x[ x$id %in% c(1,2), ] would create a new data frame y that has what you want. On Mon, May 17, 2021 at 5:33 PM Admire Tarisirayi Chirume < atchir...@gmail.com> wrote: > Can someone help on how to filter my data frame below such that it retains > a countr

Re: [R] R stalling frequently

2021-05-17 Thread Eric Berger
Hi Ramdas, I have no idea what might be causing this but it would probably help those who might be able to help if you supply additional information, such as the output of sessionInfo() in an R session. Also try to send your emails to the list in plain text (not HTML). Good luck, Eric On Mon, Ma

[R] series of densities

2021-05-17 Thread Troels Ring
Dear friends I'm trying to plot in silico derived values of 3 types of buffer-capacities  over pH values and want densities of the three types together at each pH with the pH values on the abscissa. I have generated some data set.seed(2345) pHs <- c(7.2,7.4,7.6) pH <- rep(pHs,each=30) BC <- r

Re: [R] Wide to long format in R

2021-05-17 Thread Bert Gunter
I believe you'll need to show us exactly what bop.df looks like, e.g. via head(bop.df) . Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Mon, May 17, 2021 at 7:

[R] phylogenetic correction and MCMC model

2021-05-17 Thread David Costantini
Dear All I am trying to apply a phylogenetic correction to an MCMC model, but I have problems in making the inverse matrix. I can visualise the treeplot very well, but when I use the script: inv.phylo<-inverseA(phylo_ultra,nodes="TIPS",scale=TRUE) R tells me that there is an error: Error in

[R] Wide to long format in R

2021-05-17 Thread Admire Tarisirayi Chirume
I need help on reshaping my data frame which is currently in wide format. I ran the following codes to create panel ids based on the variable for country names "*Country"; * *bop.df$id<-as.numeric(as.factor(bop.df$Country))* then ran the code below to reshape from wide to long format; *reshape

[R] Filtering a dataframe

2021-05-17 Thread Admire Tarisirayi Chirume
Can someone help on how to filter my data frame below such that it retains a country if a given id (last column) is satisfied eg filtering a data frame that has countries with id 1 and 2 only Country year bank_ratio Reserve_ratio broad_money id Angola 2006 24 77 163 1 Angola 2007 25 59 188 1 Botsw

[R] R stalling frequently

2021-05-17 Thread Ramdas Menon
I have a working knowledge of R, and have been teaching statistics courses based on R for quite some time now. I started with ver 4.0.2, and am now using Ver 4.0.5 which I downloaded a week ago. The system works when I type Object <- read.csv(file.choose()) for a couple of times, and then just sta

[R] [R-pkgs] New CRAN Package: BI - Generate James (1996) and Bang (2004) Blinding Indexes

2021-05-17 Thread Marc Schwartz via R-packages
Hi All, Version 1.0.0 of the new BI package is now on CRAN. The BI package will generate the James Blinding Index, as described in James et al (1996, https://pubmed.ncbi.nlm.nih.gov/8841652/) and the Bang Blinding Index, as described in Bang et al (2004, https://pubmed.ncbi.nlm.nih.gov/150200

[R] [R-pkgs] diveMove 1.6.0 released

2021-05-17 Thread Sebastian P. Luque
Dear R community, A new version of diveMove (1.6.0) is now on CRAN (https://cran.r-project.org/package=diveMove). diveMove offers tools and utilities for performing essential tasks for the analysis of time-depth recoder (TDR) data loggers. The latest version completes the framework for modelling