similar to: Local Variable

Displaying 20 results from an estimated 20000 matches similar to: "Local Variable"

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"
2009 Dec 10
1
problem with data processing in R
Hi, I'm stuck with parsing data into R for heatmap representation. The data looks like: 1 id1 x1 x2 x3 .... x20 2 id1 x1 x2 x3 .... x20 3 id1 x1 x2 x3 .... x20 4 id1 x1 x2 x3 .... x20 ......... 348 id2 x1 x2 x3 .... x20 349 id2 x1 x2 x3 .... x20 350 id2 x1 x2 x3 .... x20 351 id2 x1 x2 x3 .... x20 ......... The data is sorted for the IDs (id1,id2 .....id40) and I like to
2012 Mar 09
4
For loop and using its index
Dear All, I have a data set with variables x1, x2, x3, ..., x20 and I want to create z1, z2, z3, ..., z20 with the following formula: z1 = 200 - x1 z2 = 200 - x2 z3 = 200 - x3 . . . z20 = 200 - x20. I tried using a for loop and its index as: for (i in 1:20) { z(i) = 200 - x(i) } But R gives the following error message: "Error: could not find function "x"". Is there any
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)
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
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>
2005 Nov 06
2
OLS variables
Dear all, Is there any simple way in R that can I put the all the interactions of the variables in the OLS model? e.g. I have a bunch of variables, x1,x2,.... x20... I expect then to have interaction (e.g. x1*x2, x3*x4*x5... ) with some combinations(2 way or higher dimensions). Is there any way that I can write the model simpler? Thanks! Leaf
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)+
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
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
2017 Nov 03
4
Problemas con función factor to integer
Hola, estoy teniendo problemas para conseguir que mi función haga lo que quiero. Necesito que coja los valores de la variable que le indico, le quite la letra que precede a dichos valores y los convierta en números enteros. Dejo un ejemplo de los datos que estoy tratando y de varias opciones de función con las que intento que funcione sin resultado. #Ejemplo >
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
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
2005 Oct 24
1
stepAIC formula upper limit guidelines
Hello, I am attempting to refine an lm()-generated model using the stepAIC function. My model has approximately 20 inputs and I am trying to determine the best upper limit scope for using those inputs. My lower limit is "y ~ 1" and my original upper limit was "y ~ x1 + x2 + ... + x20". This is great start, but I am wondering if some other (more broad) upper limit would
2018 Feb 20
0
Take the maximum of every 12 columns
Thank you for your kind replies. Maybe I was not clear with my question (I apologize) or I did not understand... I would like to take the max for X0...X11 and X12...X24 in my dataset. When I use pmax with the function byapply as in byapply(df, 12, pmax) I get back a list which I cannot convert to a dataframe. Am I missing something? Thanks again! Sincerely, Milu
2011 Jan 18
1
lm() portion of data
Hello, I have a set of data for which I am making linear model. I would like to restrict this model for a subset of the data. I have 100 independent variables labeled x1-x100. I would like to only like an lm() that is only accounts for x1-x20. I have tried restricting my plot: plot(Date.Code,cases, xlim=c(x1, x20)) m<-lm(cases~Date.Code) summary(m) But this only restricts the graphic
2022 Dec 28
2
[REGRESSION] GM20B probe fails after commit 2541626cfb79
Hello, Commit 2541626cfb79 breaks GM20B probe with the following kernel log: [ 2.153892] ------------[ cut here ]------------ [ 2.153897] WARNING: CPU: 1 PID: 36 at drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgf100.c:273 gf100_vmm_valid+0x2c4/0x390 [ 2.153916] Modules linked in: [ 2.153922] CPU: 1 PID: 36 Comm: kworker/u8:1 Not tainted 6.1.0+ #1 [ 2.153929] Hardware name: Google
2020 May 06
3
Custom ISO
What is the \x207 ?? and the \x20 ?? on this line ? inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 Jerry
2018 Feb 20
0
Take the maximum of every 12 columns
It looks like OP uses a data.frame, so in order to use matrixStats (I'm the author) one would have to pay the price to coerce to a matrix before using matrixStats::rowMaxs(). However, if it is that the original data could equally well live in a matrix, then matrixStats should be computational efficient for this task. (I've seen cases where an original matrix was turned into a data.frame