similar to: How to make a table of a desired dimension

Displaying 20 results from an estimated 1000 matches similar to: "How to make a table of a desired dimension"

2003 Oct 02
3
indexing a vector
Dear All: I'd like to know how to sort and then index a vector of floats by several levels in R. For example >x<-rnorm(100) > MyLevels<-quantile(x,probs=c(0,.5,1)) > MyLevels 0% 50% 100% -2.11978442 -0.03770613 2.00186397 next i want to replace each x[i] in x by 1,2,3 or 4 depending on which quantile that x[i] falls. How do I do that in a
2009 May 06
4
tapply changing order of factor levels?
Hi, Does tapply change the order when applied on a factor? Below is the code I tried. > mylevels<-c("IN0020020155","IN0019800021","IN0020020064") >
2010 Apr 18
3
xtabs() of proportions, and naming a dimension (not a row)
Hi, xtabs() creates a table of counts. I want a table of proportions -- that is, I want to divide every vector (along a particular dimension) by its sum. The tiny example below does that. The call to xtabs() creates a matrix "A" with dimensions ("x1","x2","y"). I transform "A" using aperm() and aaply() to get the matrix "B". The
2008 Sep 10
1
Return dimension index from array with n-dimensions
Hi, I have been dealing with some problems finding a fast way of getting to know in what dimension a specific value is located out of an array (like the 'which' function for a vector returns its position). Unable to find anything about this on the internet I wrote a function myself. Could you please comment if such a function already exists, and if not, please feel free to comment the
2010 Jan 29
1
Plotmath: suprscript on scalable delimiter?
ComRades, How do you put a superscript on a scalable delimiter? I want to put 'b' as the power of the expression in the following plot: t <- 1:25 K <- 0.2 y <- ((1-exp(-K*t))/(1-exp(-K*t)*exp(K)))^3 plot(t,y,"l",main="K=0.2, b=3") text(15,5,expression(bgroup("(",frac(1-e^-Kt,1-e^-Kt*e^K),")"))) Plotmath examples in demo(plotmath) do not
2011 Mar 31
1
Simple lattice question
DeaR ComRades, require(lattice) data <- data.frame(SP=sort(rep(as.factor(c('A','B','C','D','E')),12)), x=rpois(60,10), y=rep(c(rep(0,4),rep(10,4),rep(20,4)),5), z=rep(1:4,15)) xyplot(x~y|SP,data=data,groups=z,layout=c(2,3),pch=1:4,lty=1:4,col='black',type='b') How do I put a legend
2005 Jan 21
4
which.pmin?
I have two vectors (k.floor and k.ceiling) of integers of the same length, and a function (fpr). b <- 10:40 k.floor <- floor(log(2) * b) k.ceiling <- ceiling(log(2) * b) fpr.floor <- fpr(b, k.floor) fpr.ceiling <- fpr(b, k.ceiling) If R had a element-wise ternary function, I'd like to do something like this: (fpr.floor < fpr.ceiling) ? k.floor :
2011 Mar 23
1
R helps win competitions
DeaR ComRades, This is a quote from a News article in Science's 11-February issue, about competitions to model data: "For Chris Raimondi, a search-engine expert based in Baltimore, Maryland, and winner of the HIV-treatment competition, the Kaggle contest motivated him to hone his skills in a newly learned computer language called R, which he used to encode the winning data model.
2008 Apr 03
1
help with R semantics
Greetings: I'm running R2.6.2 on a WinXP DELL box with 2 gig RAM. I have created a new glm link function to be used with family = binomial. The function works (although any suggested improvements would be welcome), logit.FC <- function(POD.floor = 0, POD.ceiling =1) { if (POD.floor < 0 | POD.floor > 1) stop ("POD.floor must be between zero and one.") if
2006 Sep 11
1
Extracting mean level of factor for all levels from a glm
ComRades: I have a glm where interest lies in the estimated mean levels of the response Y for every level of factor Year (regardeless of statistical significance of the factor), when the effect of other factors have been accounted for. The model is of the form: fit<-glm(Y~Year+Mo+Area+Ship+Eff,family=gaussian(link="log"),data=data) where Year is categorical and has T levels
2010 Jun 21
1
Problem with package installation
Dear ComRades, I am having the "wrong MD5 checksums" error with every package I try to install. It happened with R 2.11.0, then I updated to R 2.11.1, same thing. sessionInfo() R version 2.11.1 (2010-05-31) i386-pc-mingw32 locale: [1] LC_COLLATE=Spanish_Spain.1252 LC_CTYPE=Spanish_Spain.1252 LC_MONETARY=Spanish_Spain.1252 [4] LC_NUMERIC=C
2005 Feb 01
1
multiple defaults
I have 1 100MB NIC with two 2MB-subnets trough a router behind it. I''d like to create multiple default classes: 1: + |\_ 1:10 default, ceiling 100000kbit, rate 96000kbit | |\_ 1:11 ceiling 2048kbit, rate 2048kbit | | | |\_1:110 ceiling 2048kbit, rate 1536kbit | \_1:111 ceiling 2048kbit, rate 512kbit (default subnet1) | \_ 1:12 ceiling 2048kbit, rate
2004 Sep 17
4
Guaranteed rate per class and maximum ceiling per element in class???
Hi all, It is my understanding that with HTB, the rate and the ceiling are divided over the elements of the class. E.g. using a rate of 100 kb and a ceiling of 2000 kb for a class with 10 elements on a 100Mb NIC, the effect of the ceiling will be that if all elements are generating their maximimum possible trafic they will be effectively limited to ~ ceiling / number of elements, in this case
2012 Jul 24
2
limit of detection (LOD) by logistic regression
Dear all, I am trying to apply the logistic regression to determine the limit of detection (LOD) of a molecular biology assay, the polymerase chain reaction (PCR). The aim of the procedure is to identify the value (variable "dilution") that determine a 95% probability of success, that is "positive"/"total"=0.95. The procedure I have implemented seemed to work looking
2006 Feb 12
1
floor and ceiling can't handle more than 15 decimal places (PR#8590)
Full_Name: Ben Phalan Version: 2.2.1 OS: Win XP Submission from: (NULL) (131.111.111.231) I have noticed that floor returns the wrong number when there are more than 15 decimal places: > floor(6.999999999999999) [1] 6 > floor(6.9999999999999999) [1] 7 There is a similar problem with ceiling, so this may apply to all/most rounding functions? > ceiling (2.000000000000001) [1] 3 >
2008 Jan 14
6
Ceiling to the nearest ten?
R-users, Is there a function for ceiling to the nearest ten? a <- 1:10*4 a [1] 4 8 12 16 20 24 28 32 36 40 The resulting vector should look like this ("ceiling to the nearest ten") [1] 10 10 20 20 20 30 30 40 40 40 Thanks in advance Lauri
2009 Mar 12
3
Map using projection
Hi list, I have a real problem with plotting US state map. When I try to plot the northern state, there will be some blank space in the top of graph (see case 1 example), and when I plot southern states, there will be a blank space in the bottom of plot (see case 2). I spent almost 2 days to figure out a solution, but could not. Would you help me if you know what the problem is? Regards, Alireza
2012 Nov 29
3
Ceiling function gives me wrong answer
Hi all, I have a very simple code, but gives a wrong answer. a=1000 b=1000^(1/3) c=ceiling(a/b) then c=101, if change the code to be a=1000 b=10 c=ceiling(a/b) then c=100 is fine. Thank you for the help. [[alternative HTML version deleted]]
2005 Oct 10
2
possible bug in image() ??
Hi everyone. The function image() seems not to be correctly plotting some matrices that I give it. (I佲檓 using R 2.1.1) The following code creates a matrix (denoted x) with 1500 rows and 3 columns, with all entries 0 or 1, and then plots the image of this matrix. cc=runif(n=1500,min=0.1,max=1.2) ccc=ceiling(cc-1) dd=runif(n=1500,min=0.1,max=1.2) ddd=ceiling(dd-1)
2012 Jul 05
1
reshape2 errors on data frame
I've successfully reformatted data frames from long to wide with reshape2, but this time I'm getting errors that I want to understand and resolve. Here's the data frame structure and the results of the melt() and dcast() functions: str(waterchem) 'data.frame': 128412 obs. of 8 variables: $ site : Factor w/ 64 levels "D-1","D-2","D-3",..: 1 1