similar to: how to apply the function cut( ) to many columns in a data.frame?

Displaying 20 results from an estimated 11000 matches similar to: "how to apply the function cut( ) to many columns in a data.frame?"

2008 Feb 20
3
reshaping data frame
Dear all, I'm having a few problems trying to reshape a data frame. I tried with reshape{stats} and melt{reshape} but I was missing something. Any help is very welcome. Please find details below: ################################# # data in its original shape: indiv <- rep(c("A","B"),c(10,10)) level.1 <- rpois(20, lambda=3) covar.1 <- rlnorm(20, 3, 1) level.2
2006 Nov 30
1
scaling y-axis to relative frequency in multiple histogram (multhist)
Hi, I'm plotting a multiple histogram using the function multhist {package plotrix}, something like: library(plotrix) mh <- list(rnorm(200, mean=200, sd=50), rnorm(200, mean=250, sd=50)) multhist(mh) In this graph y-axis represents the frequency of observations.... but I would like it to be scaled into relative frequencies, does anybody know how to do this with multhist or similar
2008 Feb 22
1
fitting a lognormal distribution using cumulative probabilities
Dear all, I'm trying to estimate the parameters of a lognormal distribution fitted from some data. The tricky thing is that my data represent the time at which I recorded certain events. However, in many cases I don't really know when the event happened. I' only know the time at which I recorded it as already happened. Therefore I want to fit the lognormal from the cumulative
2006 Jan 04
1
silly, extracting the value of "C" from the results of somers2
Sorry I have a very simple question: I used somers2 function from Design package: > z<- somers2(x,y, weights=w) results are: >z C Dxy n Missing 0.88 0.76 500 0.00 Now I want to call only the value of C to be used in further analyses, but I fail to do it. I have tried: > z$C NULL > z[,C] Error in z[,C]: incorrect number of dimensions and some other silly
2007 Feb 28
0
no df to test the effect of an interaccion on a lmer mixed model
Dear useRs, I am fitting a mixed model using the function lmer from the package lme4, but I have some problems when I try to test the effect of my factors of interest. First let me explain the structure of the model: I'm measuring animal movements. Explicitly, I am interested in displacement (straight-line distance from an initial point). Displacements are measured longitudinally, with one
2005 Dec 26
0
evaluation methods for logistic regression with proportion data
Dear list-members, I have made a logistic regression analysis of the spatial distribution of an ecological phenomenon (wildlife-caused crop damage). I divided the region into 5x5 km grids, and in each grid I have performed a number of questionnaires to asses the presence of crop damage in particular houses. As a result, my dependent variable is not a simple presence/ absence data but a
2008 Mar 18
3
UNSOLITED E_MAILS: Integrate R data-analysis projects with Microsoft Office for free
Dear R Admins, I received an unsolicited e-mail from BlueInference as an R user. Does it mean that R that our e-mails (and names) is sharing it's user database with third parties without our consent? Or perhaps the BlueInference guys are using an e-mail address miner to get our contact details? [SNIP] Dear Gorden Jemwa, As a fellow R user, I am sure you agree with me that R is a
2006 Jan 12
4
Loading Excel file into Limma
Dear mailing group, This is my first time here. Glad to have this resource! I am currently trying to load an Excel file into R (limma package loaded) using the source(*name of directory*) command, but it cannot open the file. I renamed the file as .R and .RData, to no avail. The Excel data contains one gene name per row and about 100 data points per gene (columns). I am only used to
2011 Jun 23
0
Loops, Paste, Apply? What is the best way to set up a list of many equations?
Is there a way to apply paste to?list(form1 = EQ1, form2 = EQ2, form3 = EQ3, form4 = EQ4)?such that I don't have to write form1=EQ1 for all my models?(I might have a list of 20 or more)? I also need the EQs to read the formulas associated with them. For example, below, I was able to automate the name assignment but I could not figure out how to?to set up the list using?paste or other
2009 May 25
2
apply fn to many dataframes
Hi, Say I have dataframes d1, d2, ... , dn, and I want to apply a function to all of them. For example, say I want to change the name of the second variable in each dataframe to "x2". The following doesn't work: a = list(d1,d2,d3,d4) lapply(a,function(x) names(x)[2] = "x2") What would work? Thanks for any help.
2011 Mar 09
4
Extracting only odd columns from a matrix
Hi, This might seem like a simple question but at the moment I am stuck for ideas. The columns of my matrix in which some data is stored are of this form: X1 Y1 X2 Y2 X3 Y3 ... Xn Yn with n~100. I would like to look at just the X values (i.e. odd column numbers). Is there an easy way to loop round extracting only these columns? Any help would be appreciated.
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 Mar 25
4
read.xls -> rotate data.frame
Hi to all, how could I to rotate automatically a data sheet which was imported by read.xls? x1 x2 x3 .... xn y1 1 4 7 ... xn/y1 y2 2 5 8 .... xn/y2 y3 3 6 9 ....xn/y2 yn ... ... ... Xn/Yn to y1 y2 y3 .... yn x1 1 2 3 ..... Yn/x1 x2 4 5 6 .... Yn/x2 x3 7 8 9 .... Yn/x2 xn ... ... ... ..... Yn/xn Kind regards Knut
2009 Aug 03
1
apply cut function on various values (factor constrained)
hi all, presumably i have a small request, but i do indeed struggle. i want to use the cut function as follows. 1) imagine two vectors X1 and X2 2) code values of X1 due to it's quantile values (as this is ordinary use of the cut function) 3) code values of X2 due to it's quantile values, by taking the coded values of X1 as factors (AND without having to loop)... most likely a
2004 Jul 19
10
How to compare X1 = X2 = ... = Xn?
Dear All, I have a data frame with n columns: X1, X2, ., Xn. Now I want to create a new column: if X1 = X2 = . = Xn, the value is 1; Otherwise, the value is 0. How to do that in a quick way instead of doing (n choose 2) comparisons? Thank you, Frank [[alternative HTML version deleted]]
2010 Jul 16
2
Creating functions of "many" arguments
Dear users, My apologies for the simple question. I'd like to create a function where the number of arguments is as big as the size of my data set. Supose I have n observations in my data, how can I write a function like fun <- function (x1,x2,....,xn) {x1*x2*.......*xn} Thanks in advance for your help! Axel. [[alternative HTML version deleted]]
2003 Aug 12
2
who to rbind of a list of data.frames
Hello everybody, could anybody give me a hint, who I can use rbind on a list of data.frames, please? I have a list with a large number of data.frames of the same structure, like: LIST <- list(X1=data.frame(a=1,b=2), X2=data.frame(a=3,b=4), X3=data.frame(a=5,b=6), ...., XN=data.frame(a=i,b=k)) I would like to bind all data.frames very fast to a single data.frame, something like that: DF <-
2013 Apr 04
5
help with kriging interpolation
All, I am new to using R and know some basics. I wish to use kriging in R to do the following: given data Y =f(X1,X2,X3,.....,Xn) --1000+ irregular measured data set. I would like to be able to get a single value y given sinle input set (x1,x2,x3,...xn) A google search on this takes me lierally to the same example on involving analysis with soil sampling and I cannot figure out how to
2008 Apr 21
1
How can we predict the value of dependent variable using independent variable
hi , i am trying to predict the value of dependent variable using the independent variable using R . like y is dependent and x1,x2,x3 ...,xn are independent variables so how can predict the value of y using x1,x2,x3 ...,xn . y x1 x2 x3 x4 x5 x6 6 0 1 2 3 1 2 5 1 3 4 5 6 8 8 4 6 9 0 0 1 3 5 7 2 1 0 3 4 5 6 7 8 2
2019 Nov 21
2
[ARM] Peephole optimization ( instructions tst + add )
Hello! I noticed that in some cases clang generates sequence of AND+TST instructions: For example: AND x3, x2, x1 TST x2, x1 I think these instructions should be merged to one: ANDS x3, x2, x1 ( because TST <Xn>, <Xm> is alias for ANDS XZR, <Xn>, <Xm> -