similar to: parallel max, min, and median of dataframe columns

Displaying 20 results from an estimated 2000 matches similar to: "parallel max, min, and median of dataframe columns"

2005 Aug 16
1
predict nbinomial glm
Dear R-helpers, let us assume, that I have the following dataset: a <- rnbinom(200, 1, 0.5) b <- (1:200) c <- (30:229) d <- rep(c("q", "r", "s", "t"), rep(50,4)) data_frame <- data.frame(a,b,c,d) In a first step I run a glm.nb (full code is given at the end of this mail) and want to predict my response variable a. In a second step, I would
2008 Aug 13
1
need help with stat functions(like adaboost, random forests and glm)
Ok, so basically I have a dataframe named data_frame data_frame contains: startdate startprice endpricethreshold1 endpricethreshold2 endpricethreshold3 all of these endpricethresholds are true/false binary vectors. They are true or false depending on whether the endprice was above or below whatever the endpricethreshold is. now I want to try to use lets say the general linear model to have
2006 Jan 24
1
No scientific notation in format
Hi I have a data.frame with the following numbers (first column are month numbers) 07,0,0,0,0.315444056314174,0,0,0,12.5827462764176,0.079194498691732, 0.0280828101707015,0,0.0695808222378877 08,0,0,105600,0.393061160316545,0,0,0,8.95551253153947,0.0880023174276553, 0.285714285714286,0,0.0669139911789158 09,0,0,0,0,12.5,0,0,13.5135887094281,0.0557531529154668,0,0, 0.0487526139182026
2012 Jan 01
1
empty files created with trellis xyplot jpeg device
New years greetings. I have been setting up a function to generate multiple jpeg charts. When the calls are issued at the interactive console, the jpeg files are generated without an issue. When I try to issue the same calls from a function, some chart files are empty. It appears to only be related to trellis charts. Any help to troubleshoot this is appreciated. Regards, -mike R version
2002 Mar 02
1
accessing factor levels from C
Hi, I am trying to get information about factors from a C-program. As I see, the factors are basically integers with attribute ,,levels''. But unfortunately I am not been able to read the levels information. I am using: SEXP variable, levels; ... variable = VECTOR_ELT( data_frame, j); switch( TYPEOF( variable)) { case INTSXP: if( isFactor( VECTOR_ELT( data_frame,
2017 Nov 08
2
Ggplot error
Hello, I've an error recently. ggplot(data = mtcars, aes(x= wt, y= mpg)) + geom_line() Error: Found object is not a stat. > sessionInfo() R version 3.4.2 (2017-09-28) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 16.04.3 LTS Matrix products: default BLAS: /usr/lib/openblas-base/libblas.so.3 LAPACK: /usr/lib/libopenblasp-r0.2.18.so locale: [1] LC_CTYPE=tr_TR.UTF-8
2017 Nov 08
0
Ggplot error
I was not able to reproduce this problem. I tried two environments 1. Ubuntu 14.04.5 LTS, R version 3.4.2 (same R version as yours) 2. Windows 10, same R version On Wed, Nov 8, 2017 at 9:50 AM, Zeki ?ATAV <zcatav at gmail.com> wrote: > Hello, > I've an error recently. > > ggplot(data = mtcars, aes(x= wt, y= mpg)) + geom_line() > Error: Found object is not a stat. >
2009 Jul 02
3
Testing for membership in an array of strings
As an R beginner, I feel brain dead today as I can not find the answer to a relatively simple question. Given a array of string values, for example lets say "mary", "bob", "danny", "sue", and "jane". I am trying to determine how to perform a logical test to determine if a variable is an exact match for one of the string values in the array
2007 Feb 13
2
Computing stats on common parts of multiple dataframes
Folks, I have three dataframes storing some information about two currency pairs, as follows: R> a EUR-USD NOK-SEK 1.23 1.33 1.22 1.43 1.26 1.42 1.24 1.50 1.21 1.36 1.26 1.60 1.29 1.44 1.25 1.36 1.27 1.39 1.23 1.48 1.22 1.26 1.24 1.29 1.27 1.57 1.21 1.55 1.23 1.35 1.25 1.41 1.25 1.30 1.23 1.11 1.28 1.37 1.27 1.23 R> b EUR-USD NOK-SEK 1.23 1.22 1.21 1.36 1.28 1.61 1.23 1.34 1.21 1.22
2010 Aug 17
3
Weird differing results when using the Wilcoxon-test
Hi, I became a little bit confused when working with the Wilcoxon test in R. As far as I understood, there are mainly two versions: 1) wilcox.test{stats}, which is the default and an approximation, especially, when ties are involved 2) wilcox_test{coin}, which does calculate the distribution _exactly_ even, with ties. I have the following scenario: #---BeginCode--- # big example size = 60
2017 Nov 08
1
Ggplot error
I get the same result as Eric? withR version 3.4.2 (2017-09-28) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 17.04 It looks like you have "tidyverse" loaded so I tried it with just ggplot2 loaded and with tidyverse loaded.? On Wednesday, November 8, 2017, 4:16:14 AM EST, Eric Berger <ericjberger at gmail.com> wrote: I was not able to reproduce this
2001 Dec 19
2
R strings from C
Hi, I am trying to study R internal behaviour. So long, I have not succeeded to access the value of R strings from C. I use: void salvesta_tabel( SEXP data_frame, SEXP file ) { printf( "nimi %d\n", (R_CHAR)( file)); } and from the R side: salvesta.tabel <- function (x, file = "") { .Call( "salvesta_tabel", x, file) } When calling
2007 Jun 05
4
Refactor all factors in a data frame
Hi all, Assume I have a data frame with numerical and factor variables that I got through merging various other data frames and subsetting the resulting data frame afterwards. The number levels of the factors seem to be the same as in the original data frames, probably because subset() calls [.factor without drop = TRUE (that's what I gather from scanning the mailing lists). I wonder if
2008 Nov 06
2
comparing matrices using max or min
Dear all, I have 3 matrices with the same dimension, A,B,C and I would like to produce a matrix D where in each position would retrieve the max(or min) value along A,B,C taken from the same position. I guess that apply functions should fit, but for matrices objects I am not getting it. thanks in advance, Diogo André Alagador [[alternative HTML version deleted]]
2008 Nov 15
0
min of array
I wanted to get the minimum of an array of dimenstion (nr,nc,6), so the output was of dimension (nr,nc), ie for each row,column the minimum of 6 numbers. I thought apply might be the sensible way, but I also compared it to looping over each row/column. In this case the loop method was faster than my apply (which probably means I wasn't using apply in the best way). Then I found that pmin
2009 Jul 24
2
How to find the min and max of two variables in a data frame
I have two variables in a data frame, I want to generate two additional variables. For every observations (i.e. every row), I want the first new variable 'min' to carry the minimum of the two existing variables, and I want the second new variable 'max' to carry the maximum of the two existing variables. I then want to sort the data frame by min and max, and delete duplicated rows
2010 Apr 17
2
Please help with min()
Hello, I have two vectors of length = 10 x<-c(2,14,79,27,3,126,15,1,12,4) y<-rep(4,10) and I would like to create a third vector of length = 10 that contains the smallest value at each position in the two above vectors. I have tried: z<-min(x,y) but that doesn't work. With the example data above, the third vector would look like this. > z [1] 2 4 4 4 3 4 4 1 4
2017 Sep 04
1
Dataframe Manipulation
Hello Ulrik, Can you please explain this code means how and what this code is doing because I'm not able to understand it, if you can explain it i can use it in future by doing some Lil bit manipulation. Thanks data_help <- data_help %>% mutate(Purchase_ID = 1:n()) %>% group_by(Purchase_ID) %>% do(split_items(.)) cat_help %>% gather("Foo",
2017 Aug 31
0
Dataframe Manipulation
Hi Hemant, the solution is really quite similar, and the logic is identical: library(readr) library(dplyr) library(stringr) library(tidyr) data_help <- read_csv("data_help.csv") cat_help <- read_csv("cat_help.csv") # Helper function to split the Items and create a data_frame split_items <- function(items){ x <- items$Items_purchased_on_Receipts %>%
2010 Nov 25
4
Cumsum with a max and min value
I have a vector of values -1, 0, 1, say a <- c(0, 1, 0, 1, 1, -1, -1, -1, 0, -1, -1) I want to create a vector of the cumulative sum of this, but I need to set a maximum and minimum value for the cumsum, for example: max_value <- 2 min_value <- -2 the expected result would be (0, 1, 1, 2, 2, 1, 0, -1, -1, -2, -2) The only way I managed to do It, was res <-