similar to: Problem with command apply

Displaying 20 results from an estimated 10000 matches similar to: "Problem with command apply"

2006 Aug 11
1
x tick labels - sparse?
Hi, I'm stuck on creating a plot with x tick labels for every Nth tick mark - how is that done? I don't see a simple solution to this in help(plot) or help(par) and what I've tried is not working, eg, the following does not work, although it seems intuitive to me that it should work: x <- seq(-100,1000,25) y <- x * x % find all the x values that are multiples of 100 tmp <-
2013 May 27
1
Question about subsetting S4 object in ROCR
Dear list I'm testing a predictor and I produced nice performance plots with ROCR package utilizing the 3 standard command pred <- prediction(predictions, labels) perf <- performance(pred, measure = "tpr", x.measure = "fpr") plot(perf, col=rainbow(10)) The pred object and the perfo object are S4 with the following slots An object of class "performance"
2011 Sep 07
2
ggplot2-Issue placing error bars behind data points
Hi all, This seems like a basic problem, but no amount of playing with the code has solved it. I have a time-series data set like that shown below (only longer) and am seeking to plot the data with filled, circular points and error bars. I would like the error bars to be behind the points otherwise they tend to obscure the points (especially when I have a lot of points in the actual data set).
2011 Nov 14
2
How to compute eigenvectors and eigenvalues?
Hello. Consider the following matrix: mp <- matrix(c(0,1/4,1/4,3/4,0,1/4,1/4,3/4,1/2),3,3,byrow=T) > mp [,1] [,2] [,3] [1,] 0.00 0.25 0.25 [2,] 0.75 0.00 0.25 [3,] 0.25 0.75 0.50 The eigenvectors of the previous matrix are 1, 0.25 and 0.25 and it is not a diagonalizable matrix. When you try to find the eigenvalues and eigenvectors with R, R responses: > eigen(mp) $values [1]
2004 Sep 14
3
Signs of loadings from princomp on Windows
I start a clean session of R 1.9.1 on Windows and I run the following code: > library(MASS) > data(painters) > pca.painters <- princomp(painters[ ,1:4]) > loadings(pca.painters) Loadings: Comp.1 Comp.2 Comp.3 Comp.4 Composition 0.484 -0.376 0.784 -0.101 Drawing 0.424 0.187 -0.280 -0.841 Colour -0.381 -0.845 -0.211 -0.310 Expression 0.664 -0.330 -0.513
2013 Jun 15
2
quick Help needed
Hi, i am new to this forum and not sure how it works, I am trying to do deskriptive descripe my data in terms of gender: head(scltotal) pbnr dat dep dys sop ago mis age female messpunkt2 messpunkt1 tage eintrittsjahr 1 10023 1994-02-21 0.75 1.00 0.50 0.50 0.75 35 1 8817 8817 0 1994 2 10023 1994-05-25 0.75 1.00 0.50 0.50 0.75 35 1 8910 8817
2011 Mar 24
1
Two matrix loop
Hi, I'm trying to create a distance matrix. And it works out somewhat ok. However, I suspect that there are some efficiency issues with my efforts. Plz have a look at this: donor <- matrix(c(3,1,2,3,3,1,4,3,5,1,3,2), ncol=4) receiver <- matrix(c(1,4,3,2,4,3,1,5,1,3,2,1,4,5,3,5,1,3,2,4,5,1,2,3,1,4,5,5,1,2,1,3,4,3,2,5,5,1,4,2,5,4,3,2), ncol=4) The above creates my two matrices. I have
2009 Jul 21
1
problem with heatmap.2 in package gplots generating non-finite breaks
I have written a wrapper for heatmap.2 called heatmap.w.row.and.col.clust which auto-generates breaks using breaks<-round((c(seq(from=(-20 * stddev), to=(20 * stddev))))/20, digits = 2) #(stddev in this case = 2.5) This has always worked well in the past but now I am getting an error that non-finite breaks are being generated. Drilling down, it seems that my wrapper is generating finite
2011 Feb 10
3
help - "the condition has length > 1 and only the first element will be used"
Hello there, I don't know if I'm addressing my question to the right e-mail address, I hope I do. Actually I have a little problem concerning writing a code in R. I try to briefly sum up my problem. As you can see below, I created the functions "Equation1" and "Equation2" with some conditions. Equation1 <-function(x){ if
2003 Nov 11
1
cor
Greetings: It would seem to me that the three arguments "a", "c" and "p" ought to produce the same result with a data frame that doesn't have any missing data which is not the case. What am I doing wrong or what don't I understand? > tmp <- data.frame(vol,con,mot,esp,pri,sec) > tmp vol con mot esp pri sec 1 1.00 120 90 78 21 1 2 0.50
2008 Jan 28
2
matrix creation
Hello, I am trying to create multiple matrices (to run a PVA) but can't import all of them from a .csv without the numbers treated as labels and not factors. I can enter the matrix slowly: Site05_96 <- matrix(c(0.07,0,0.03,0.00,NA,0.00, 0.09,0.166666667,0.31,0.42,NA,0.00, 0.00,0,0.00,0.00,NA,0.00, 0.00,0,0.00,0.00,NA,0.00,
2011 Sep 27
2
Pearson chi-square test
Dear all, I have some trouble understanding the chisq.test function. Take the following example: set.seed(1) A <- cut(runif(100),c(0.0, 0.35, 0.50, 0.65, 1.00), labels=FALSE) B <- cut(runif(100),c(0.0, 0.25, 0.40, 0.75, 1.00), labels=FALSE) C <- cut(runif(100),c(0.0, 0.25, 0.50, 0.80, 1.00), labels=FALSE) x <- table(A,B) y <- table(A,C) When I calculate the test statistic by hand
2005 Apr 05
2
Principle Component Analysis in R
Dear R Should I be concerned if the loadings to a Principle Component Analysis are as follows: Loadings: Comp.1 Comp.2 Comp.3 Comp.4 X100m -0.500 0.558 0.661 X200m -0.508 0.379 0.362 -0.683 X400m -0.505 -0.274 -0.794 -0.197 X800m -0.486 -0.686 0.486 0.239 Comp.1 Comp.2 Comp.3 Comp.4 SS loadings 1.00 1.00 1.00 1.00 Proportion Var 0.25 0.25 0.25
2005 May 23
1
Can't reproduce clusplot princomp results.
Dear R folk: Perhaps I'm just dense today, but I am having trouble reproducing the principal components plotted and summarized by clusplot. Here is a brief example using the pluton dataset. clusplot reports that the first two principal components explain 99.7% of the variability. But this is not what princomp is reporting. I would greatly appreciate any advice. With best regards, -- Tom
2005 May 25
3
Rounding fractional numbers to nearest fraction
Hi all, I've got a matrix of fractional data that is all positive and greater than zero that I would like to "loosely" classify, for lack of a better word. It looks something like this : 1.07 1.11 1.27 1.59 0.97 0.76 2.23 0.98 0.71 0.88 1.19 1.02 What I'm looking for is a way to round these numbers to the nearest 0.25, i.e. the above matrix would be
2011 Nov 08
2
Sorting Panel Data by Time
I have panel data in the following form: TIME X1 S1 1 1 0.99 1 2 0.50 1 3 0.01 2 3 0.99 2 1 0.99 2 2 0.25 3 3 0.75 3 2 0.50 3 1 0.25 ... ... ...... And desire a new vector of observations in which one column (S1 above) is sorted for each second from least to largest. That
2010 Mar 31
1
Weird R behaviour?
Dear list, I have observed a weird behaviour from R --- apologies if I am missing something obvious! df3f826f28 df3f826f28 Say you type in R: >c.preec <- 10074 >c.gd <- 2200 >p1 <- .2 >c.neo <- p1*9451 + (1-p1)*3883 >n.preec <- 3710 >n.gd <- 2650 >n.neo <- 2120 >n.pcos <- 53000 >unit.met <- 94 >cost.met <- 94*n.pcos >effect <-
2011 Apr 23
3
Problem having tick marks aligned when plotting three graphs on top of one another.
R 2.10 Windows 7 I am trying to plot three graphs on top of each other. I need to have the axises perfectly aligned. For some reason the ticks on the y axes are slightly off so they do not perfectly align. Can someone tell me how I can get the to overlay each other perfectly? I thought the yaxp parameter would solve my problem, but it does not. My data and code follows: >
2016 May 25
1
Slow RAID Check/high %iowait during check after updgrade from CentOS 6.5 -> CentOS 7.2
On 2016-05-25 19:13, Kelly Lesperance wrote: > Hdparm didn?t get far: > > [root at r1k1 ~] # hdparm -tT /dev/sda > > /dev/sda: > Timing cached reads: Alarm clock > [root at r1k1 ~] # Hi Kelly, Try running 'iostat -xdmc 1'. Look for a single drive that has substantially greater await than ~10msec. If all the drives except one are taking 6-8msec, but one is very
2008 Jun 15
1
Help finding the mode and maximum for a specified 'window' of time series data
I am relatively new to R, so apologize up front for my long question, particularly if there is too much or too little information. I have a large time series data set where each subject's behavior was originally coded on .25s intervals for 3min task. I am trying to determine if the findings are different depending on the coding interval (i.e. Compare .25s to 1s to 5s to 10s). I also need to