similar to: reshape data.frame

Displaying 20 results from an estimated 10000 matches similar to: "reshape data.frame"

2017 Jul 05
4
Help with reshape/reshape2 needed
Hi all: I'm struggling with getting my data re-formatted using functions in reshape/reshape2 to get from: 1957 0.862500000 1958 0.750000000 1959 0.300000000 1960 0.287500000 1963 0.675000000 1964 0.937500000 1965 0.025000000 1966 0.387500000 1969 0.087500000 1970 0.275000000 1973 0.500000000 1974 0.362500000 1976 0.925000000 1978 0.712500000 1979 0.337500000 1980 0.700000000 1981 0.425000000
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),
2017 Jul 05
0
Help with reshape/reshape2 needed
The reason it doesn't work easily with reshape/reshape2 is that the order of the rows is not determined. Your answer could be 1957 1958 ... 1985 1986 0.8625000 0.7500000 ... 0.7307692 0.23750000 0.0733945 0.6435644 ... NA 0.05769231 0.5096154 NA ... NA 0.65137615 or 1957 1958 ... 1985 1986 0.0733945 0.6435644 ... NA
2017 Jul 05
0
Help with reshape/reshape2 needed
This does not use reshape/reshape2, but it is pretty straightforward. Assuming X is your example data: > Y <- split(X[, 2], X[, 1]) > vals <- sapply(Y, length) > pad <- max(vals) - vals > Y2 <- lapply(seq_along(Y), function(x) c(Y[[x]], rep(NA, pad[x]))) > names(Y2) <- names(Y) > X2 <- do.call(cbind, Y2) > X2[, 1:6] 1957 1958 1959
2017 Jul 05
1
Help with reshape/reshape2 needed
Hi Tom, Or perhaps: #assume the data frame is named "tadf" library(prettyR) stretch_df(tadf,1,2) Jim On Thu, Jul 6, 2017 at 6:50 AM, Ista Zahn <istazahn at gmail.com> wrote: > The reason it doesn't work easily with reshape/reshape2 is that the > order of the rows is not determined. Your answer could be > > 1957 1958 ... 1985 1986 >
2008 Nov 04
1
perform Kruskal-Wallis test without using the built-in command in R
Hi, again i am stuck in my presentation, and i have never learn R before in my life but need this to be done, so please help me out for a favour: http://www.nabble.com/file/p20333155/kew.dat kew.dat run this in R and these comes up: Month Year Rain 1 Jan 1900 74.400000 2 Feb 1900 80.500000 3 Mar 1900 23.600000 4 Apr 1900 23.600000 5 May 1900 25.100000 6
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,
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)
2009 Nov 22
1
Metaplot Axis Annotation
Hello, We are looking to adjust the font size of the axis annotation on the graph that results from use of the metaplot() function. Metaplot seems to respond to cex and cex.lab to change those graphical parameters, but it doesn't respond to cex.axis. Is there a way to work around this by creating a customized x-axis, and if so, how? Thanks for all your help. Syntax is below. Best, Dawn
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,
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 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
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 <-
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
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
2009 Jan 27
1
Data Frame Manipulation: Time Series
Dear R Helpers: I have a data set where the unit of observation is country-year. I would like to generate a new data set based on some inclusionary (exclusionary) criteria. Here is an example of the type of data that I have. df<-data.frame(cbind("country"=c(rep("Angola", 9), rep("Burundi", 7), rep("Chad", 13)), "year"=c(1975:1983, 1989:1995,
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
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
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