similar to: select and do some calculations/manipulations on certain rows based on conditions in R

Displaying 20 results from an estimated 2000 matches similar to: "select and do some calculations/manipulations on certain rows based on conditions in R"

2007 Mar 10
3
long character string problem
Hi All I am having 2 very long character strings (550chars) and I want to put them as expressions together with c(). The problem is that I also get these double-quotes, as seen below in 'fct'. How can I remove these double-quotes? I tried as.name() but it did not work (because of size?). These are creating trouble with subsequent programs, which I tested with strings that for some
2013 Mar 19
4
Copying rows in data frames
Hi, I'm trying to copy the first row of one data frame to another. This is the statement I am using : df2[1,]<-df1[1,]; I have printed them out separately: df1[1,] = A C D E F But after copying: df2[1,] = 96 29 88 122 68 Why isn't it copying? They are both data frames, and "as.character" isn't working either. Thanks for your input :) [[alternative HTML version
2012 Feb 17
5
How to change the order of columns in a data frame?
Dear all, I have a data frame in which the columns need to be ordered. The first column X is at the right position, but the remaining columns X1-Xn should be ordered like this: X1, X2, X3 etc instead of like below. > colnames(pos1) [1] "X" "X1" "X10" "X11" "X12" "X13" "X14" "X15" "X16"
2011 Jun 01
3
error in model specification for cfa with lavaan-package
Dear R-List, (I am not sure whether this list is the right place for my question...) I have a dataframe df.cfa
2018 Feb 20
5
Take the maximum of every 12 columns
Dear all, I have monthly data in wide format, I am only providing data (at the bottom of the email) for the first 24 columns but I have 2880 columns in total. I would like to take max of every 12 columns. I have taken the mean of every 12 columns with the following code: byapply <- function(x, by, fun, ...) { # Create index list if (length(by) == 1) { nc <- ncol(x)
2012 Aug 09
4
debug vs regular mode
Dear all, I had a R segmentation fault, and then invoked debug mode and ran step by step. When I reached "terms(Y~X1*X2*...*X16)", I would then have "segmentation" fault. However, if I just ran this under regular "R interactive" mode, it would be fine though taking long time. My questions are: 1. Is there a known limit of terms for a formula? 2. Why does the
2012 Aug 09
4
debug vs regular mode
Dear all, I had a R segmentation fault, and then invoked debug mode and ran step by step. When I reached "terms(Y~X1*X2*...*X16)", I would then have "segmentation" fault. However, if I just ran this under regular "R interactive" mode, it would be fine though taking long time. My questions are: 1. Is there a known limit of terms for a formula? 2. Why does the
2018 Feb 20
3
Take the maximum of every 12 columns
This is what I was looking for. Thank you everyone! Sincerely, Milu <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Mail priva di virus. www.avast.com <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
2006 Mar 11
1
Non-linear Regression : Error in eval(expr, envir, enclos)
Hi.. i have an expression of the form: model1<-nls(y~beta1*(x1+(k1*x2)+(k1*k1*x3)+(k2*x4)+(k2*k1*x5)+(k2*k2*x6)+(k3*x7)+(k3*k4*x8)+(k3*k2*x9)+(k3*k3*x10)+ (k4*x11)+(k4*k1*x12)+(k4*k2*x13)+(k4*k3*x14)+(k4*k4*x15)+(k5*x16)+(k5*k1*x17)+(k5*k2*x18)+(k5*k3*x19)+
2015 Feb 19
2
[LLVMdev] ScheduleDAGInstrs computes deps using IR Values that may be invalid
Hi All, I've encountered an issue where tail merging MIs is causing a problem with the post-RA MI scheduler dependency analysis and I'm not sure of the best way to address the problem. In my case, the branch folding pass (lib/CodeGen/BranchFolding.cpp) is merging common code from BB#14 and BB#15 into BB#16. It's clear that there are 4 common instructions (marked with an *) in BB#14
2006 Nov 06
5
memory issues with new release (PR#9344)
Full_Name: Derek Elmerick Version: 2.4.0 OS: Windows XP Submission from: (NULL) (38.117.162.243) hello - i have some code that i run regularly using R version 2.3.x . the final step of the code is to build a multinomial logit model. the dataset is large; however, i have not had issues in the past. i just installed the 2.4.0 version of R and now have memory allocation issues. to verify, i ran
2018 Feb 20
0
Take the maximum of every 12 columns
Hi Milu, byapply(df, 12, function(x) apply(x, 1, max)) You might also be interested in the matrixStats package. Best, Ista On Tue, Feb 20, 2018 at 9:55 AM, Miluji Sb <milujisb at gmail.com> wrote: > Dear all, > > I have monthly data in wide format, I am only providing data (at the bottom > of the email) for the first 24 columns but I have 2880 columns in total. > > I
2018 Feb 20
0
Take the maximum of every 12 columns
Ista, et. al: efficiency? (Note: I needed to correct my previous post: do.call() is required for pmax() over the data frame) > x <- data.frame(matrix(runif(12e6), ncol=12)) > system.time(r1 <- do.call(pmax,x)) user system elapsed 0.049 0.000 0.049 > identical(r1,r2) [1] FALSE > system.time(r2 <- apply(x,1,max)) user system elapsed 2.162 0.045 2.207 ##
2018 Feb 20
2
Take the maximum of every 12 columns
Don't do this (sorry Thierry)! max() already does this -- see ?max > x <- data.frame(a =rnorm(10), b = rnorm(10)) > max(x) [1] 1.799644 > max(sapply(x,max)) [1] 1.799644 Cheers, Bert 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
2009 Oct 23
4
How to apply the Wilcoxon test to a hole table at once?
Hi, I have a data set: > Dataset X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13 X14 X15 X16 X17 1 user1 m 22 19 28 24 12 18 9 7 4 5 4 7 5 7 9 2 user2 f 25 19 23 18 18 15 6 8 6 6 7 10 7 7 7 3 user3 f 28 21 24 18 15 12 10 6 7 9 5 10 5 9 5 4 user4 f 26 19 26 21 12 18 6 6 5 1 3 8 6 5 6 5 user5 m 21 22 26 18 9 6 4 6 1
2018 Feb 08
4
plotting the regression coefficients
Hi Dear all; I would like to create a plot for regression coefficients with each independent variable (x) along the side and the phenotypes (y) across the top (as given below). For each data point, direction and magnitude of effect could be color and significance could be the size of the circle? Is this possible? I would greatly be appreciated your help. Thanks, Greg y1 y2 y3 y4 y5 y6 x1
2018 Feb 20
0
Take the maximum of every 12 columns
The maximum over twelve columns is the maximum of the twelve maxima of each of the columns. single_col_max <- apply(x, 2, max) twelve_col_max <- apply( matrix(single_col_max, nrow = 12), 2, max ) ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie
2011 Aug 20
2
a Question regarding glm for linear regression
Hello All, I have a question about glm in R. I would like to fit a model with glm function, I have a vector y (size n) which is my response variable and I have matrix X which is by size (n*f) where f is the number of features or columns. I have about 80 features, and when I fit a model using the following formula,? glmfit = glm(y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 + x10 + x11 + x12 + x13
2018 Feb 20
2
Take the maximum of every 12 columns
On Tue, Feb 20, 2018 at 11:58 AM, Bert Gunter <bgunter.4567 at gmail.com> wrote: > Ista, et. al: efficiency? > (Note: I needed to correct my previous post: do.call() is required for > pmax() over the data frame) > > > x <- data.frame(matrix(runif(12e6), ncol=12)) > > > system.time(r1 <- do.call(pmax,x)) > user system elapsed > 0.049 0.000
2017 Dec 21
2
[bug report] null ptr deref in nouveau_platform_probe (tegra186-p2771-0000)
Hi Thierry, Thanks for the patch. I applied on top of linux-next-2017-12-14. Different output this time. [ 11.862495] WARNING: CPU: 1 PID: 254 at drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgf100.c:391 gf100_vmm_new_+0x60/0x128 [nouveau] [ 11.863458] tegra-dpaux 155c0000.dpaux: 155c0000.dpaux supply vdd not found, using dummy regulator [ 11.866197] tegra-sor 15580000.sor: failed to probe