similar to: How to speed up or avoid the for-loops in this example?

Displaying 20 results from an estimated 20000 matches similar to: "How to speed up or avoid the for-loops in this example?"

2013 Mar 14
1
ggplot2 problem
Hello all! I have a problem with ggplot2 library. I want to do an heat map and the y variables are the year months. If I use the following code, he y values are in alphabetical order, but I want it in month order. The code is: library(reshape) library(ggplot2) library(scales) p <- ggplot(data.m, aes(variable, Month)) + geom_tile(aes(fill = value),
2009 Jan 14
1
publication statistics from Web of Science
Dear list, This is a bit of an off-topic question, but I'm hoping to get some advice from more experienced people. I've used the website "Web of Science" to manually collect publication counts responding to several keywords as a function of date, since the 1960s. http://apps.isiknowledge.com/RAMore.do?product=UA&search_mode=&SID=P1g9lFJp9 at
2013 Mar 12
5
extract values
Hello all! I have a problem to extract values greater that for example 1820. I try this code: x[x[,1]>1820,]->x1 Please help me! Thank you! The data structure is: structure(c(2.576, 1.728, 3.434, 2.187, 1.928, 1.886, 1.2425, 1.23, 1.075, 1.1785, 1.186, 1.165, 1.732, 1.517, 1.4095, 1.074, 1.618, 1.677, 1.845, 1.594, 1.6655, 1.1605, 1.425, 1.099, 1.007, 1.1795, 1.3855, 1.4065, 1.138, 1.514,
2013 Apr 07
2
group data in classes
Hello all! I have a problem to group my data (years) in 10 years classes. For example for year year decade 1598 1590-1600 1599 1590-1600 1600 1590-1600 1601 1600-1610 --- my is like this> [1] 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 [16] 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 [31] 1628 1629 1630 1631 1632 1633
2010 Jan 11
3
interpolation
Dear R-users, I have a complex line by xy-values (ordered by z). And I would like to get interpolated y-values on the positions of x = 0:600. How do I get the correct points? x=c(790,790,790,790,790,786,783,778,778,766,763,761,761,761,715,628,521,350,160,134,134,129,108,101,93,111,161,249,288,243,139,45,7)
2013 Mar 13
2
merge datas
Hello all! I have a problem with R. I try to merge data like this: structure(c(2.1785, 1.868, 2.1855, 2.5175, 2.025, 2.435, 1.809, 1.628, 1.327, 1.3485, 1.4335, 2.052, 2.2465, 2.151, 1.7945, 1.79, 1.6055, 1.616, 1.633, 1.665, 2.002, 2.152, 1.736, 1.7985, 1.9155, 1.7135, 1.548, 1.568, 1.713, 2.079, 1.875, 2.12, 2.072, 1.906, 1.4645, 1.3025, 1.407, 1.5445, 1.437, 1.463, 1.5235, 1.609, 1.738, 1.478,
2002 May 31
2
error in seq.POSIXt?
I am trying to extract only the winters (defined to be 01-Dec through 28-Feb) of daily data from 1948-2002. There are 90 days in each winter season. I wrote the following code to gather the winter dates into a single vector: DJF <- NULL for(year in 1949:1999) { temp.begin <- strptime(paste("01/12", year-1, sep="/"), "%d/%m/%Y") temp.end <-
2003 Apr 15
2
troubles with displaying legend on the plot
Dear colleagues, I have troubles while trying to display legend on the plot. I have data.frame fr > fr year M1 M2 1 1979 58.85198 56.77303 2 1980 57.59725 55.93749 3 1981 57.32133 55.55232 4 1982 54.69320 53.10566 5 1983 56.58973 55.03811 6 1984 58.81363 56.97641 7 1985 58.35583 56.82091 8 1986 60.41842 58.45457 9 1987
2007 Dec 19
3
plot cummulative sum from calendar time
I have the following list of observations of calendar time: [1] 03-Nov-1997 09-Oct-1991 27-Aug-1992 01-Jul-1994 19-Jan-1990 12-Nov-1993 [7] 08-Oct-1993 10-Nov-1982 08-Dec-1986 23-Dec-1987 02-Aug-1995 20-Oct-1998 [13] 29-Apr-1991 16-Mar-1994 20-May-1991 28-Dec-1987 14-Jul-1999 27-Nov-1998 [19] 09-Sep-1999 26-Aug-1999 20-Jun-1997 05-May-1995 26-Mar-1998 15-Aug-1994 [25] 24-Jun-1996 02-Oct-1996
2009 Feb 07
2
Time Series Graphics - "cannot plot more than 10 series"
Hi Experts, I would like to present time series data in meaningful way in building some graphics. I've tried: (1) plot(ts(mbaye3)) and (2) plot(ts(mbaye3), start=1990) But I always get this error-message: Fehler [error] in plotts(x = x, y = y, plot.type = plot.type, xy.labels = xy.labels, : cannot plot more than 10 series as "multiple" my data: mbaye3
2005 Sep 29
1
lmer random effect model matrix question
I have one fixed effect, sor, with two levels. I have eight lots and three wafers from each lot. I have included the data below. I would like to fit a mixed model that estimates a covariance parameter for wafer, which is nested in lot, and two covariance parameters for lot, one for each level of sor. The following command fits the model that I want, except for it estimates the correlation
2004 Mar 09
1
vector extraction
Hello, I could need some help on this one: >From the data.frame "Test.dataset2" below (TSCS data for 151 "countries.to.map" for "year" 1973-95; each "country.to.map" is described by a unique code), I would like to extract a vector "color" that for each "country.to.map" takes on the value of "dv" (a categorical variable with
2013 Mar 29
1
problem with data
Hello all! I have a problem with my data in R. When I want to plot the following data, I have a problem with y scale. The maximum value is cc. 10 degrees and in R is about 100. I use this code: fasy<-read.table("gridd1.txt",sep="\t",dec=",",header=T,row.names=1) # here are the years: x <- as.numeric(rownames(fasy)) # extract a series that you want to plot: y
2008 Nov 08
4
Plotting Standard Regression Fit-Am I wrong or a bug?
I'm trying to plot a time series (quarterly observations, seasonal effect, T=56),regression line and predicted point on the same plot. I'm using following commands: > plot(qdts,xlim=c(1982,1997)) > lines(fitted(m2)~time,data=qd,col="red") > points(predict(m2,newdata=nqd),col="blue") where: qdts<-ts(qd$durables,start=c(1982,1),freq=4)
2005 Jun 15
4
Multiple line plots
Greetings, I would like to plot three lines on the same figure, and I am lost. There is an answer to a similar thread… but I tried matplot and it is beyond me. An example of the data follows: Year EM IM BM 1983 9.1 16.8 -7.7 1984 12.0 18.0 -6.0 1985 13.6 19.1 -5.5 1986 12.4 17.3 -4.9 1987 14.6 20.3 -5.7 1988 20.6 23.3 -2.6 1989 25.0 27.2 -2.2 1990 28.4 30.2 -1.8 1991 33.3 31.2 2.1 1992 40.6
2005 Jul 06
3
plotting on a reverse log scale
I'd like to do some plots of historical event data on a reverse log scale, started, say at the year 2000 and going backwards in time, with tick marks spaced according to log(2000-year). For example, see: http://euclid.psych.yorku.ca/SCS/Gallery/images/log-timeline.gif As an example, I'd like to create a density plot of such data with the horizontal axis reverse-logged, a
2011 Sep 07
1
reshaping data
I have the following data (see RawData using dput below) How do I get it in the following 3 column format (CO2 measurements are the elements of the original data frame). I'm sure the package reshape is where I should look, but I haven't figured out how. Thanks ahead of time Month Year CO2 J 1958 F 1958 M 1958 315.71 A 1958 317.45 M.1 1958 317.5 J.1 1958 J.2 1958 315.86 A.1 1958
2011 Dec 12
2
Colours for sunflowerplot
Dear fellow R users, I would like to draw a "sunflowerplot" because I have data (decade by month) that plots multiple times on the same x-y co-ordinates. Further I would like to colour each of the points/sunflower leaves on the plot according to the group they belong to (i.e. which type of event each represents within that decade and month). I thought that this would be relatively
2008 Jun 18
4
inverse cumsum
I've a matrix like this: 1985 1.38 1.27 1.84 2.10 0.59 3.47 1986 1.05 1.13 1.21 1.54 0.21 2.14 1987 1.33 1.21 1.77 1.44 0.27 2.85 1988 1.86 1.06 2.33 2.14 0.55 1.40 1989 2.10 0.65 2.74 2.43 1.19 1.45 1990 1.55 0.00 1.59 1.94 0.99 2.14 1991 0.92
2015 Jul 01
5
additional leap second
hi, Index: leap_second/src/library/base/R/zdatetime.R =================================================================== --- leap_second/src/library/base/R/zdatetime.R (revision 68608) +++ leap_second/src/library/base/R/zdatetime.R (working copy) @@ -24,7 +24,8 @@ "1979-12-31", "1981-6-30", "1982-6-30", "1983-6-30",