Hello all!
I have a problem with my data.
My initial data is a list years and months (see below). I want to transpose
my data (12 rows (months) and year values as column). I try t(spi3), but
the year values do not appear as column names, but as values. Please help
me to solve this problem!
Thank you!

c("year","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
> dput(spi3)
structure(list(year = c(1961, 1962, 1963, 1964, 1965, 1966, 1967,
1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978,
1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989,
1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008), Jan =
c(-0.282216147062508,
-0.861634120174172, 0.210428394247925, -1.22064034884735,
-0.139710298881862,
1.22064034884735, -0.508488059109357, 0.210428394247925,
-0.589455797849779,
-0.210428394247925, -0.355490417839531, -0.355490417839531,
-0.764709673786387,
-0.967421566101701, -0.967421566101701, -0.282216147062508,
-0.355490417839531,
-1.91450582505556, -0.282216147062508, -0.764709673786387,
-0.282216147062508,
-0.764709673786387, -0.967421566101701, -0.282216147062508,
-0.508488059109357,
-0.967421566101701, -0.508488059109357, -0.0696849203184557,
-1.38299412710064, -0.967421566101701, -0.967421566101701,
-1.91450582505556,
-1.22064034884735, -0.589455797849779, -0.210428394247925,
-0.508488059109357,
-1.22064034884735, 0.210428394247925, -0.210428394247925,
-0.764709673786387,
-0.508488059109357, -0.967421566101701, -0.589455797849779,
0.210428394247925,
-0.355490417839531, -0.589455797849779, -0.967421566101701,
-1.22064034884735
), Feb = c(-0.967421566101701, -0.430727299295457, -0.764709673786387,
-0.589455797849779, -0.0696849203184557, -1.08532490807676,
0.430727299295457,
-0.210428394247925, 0.430727299295457, 0.0696849203184557,
-0.674489750196082,
-1.91450582505556, 0.0696849203184557, -0.861634120174172,
-0.764709673786387,
-2.2, -0.764709673786387, 0.210428394247925, -0.589455797849779,
-0.967421566101701, -0.967421566101701, -0.674489750196082,
-0.967421566101701,
0.355490417839531, -0.764709673786387, 0.0696849203184557,
-0.967421566101701,
-0.508488059109357, -1.22064034884735, -0.967421566101701,
-0.764709673786387,
-0.764709673786387, -0.589455797849779, -0.674489750196082,
-0.589455797849779,
-0.210428394247925, -0.355490417839531, -0.967421566101701,
-0.355490417839531,
-0.282216147062508, -0.764709673786387, -1.59321881802305,
-0.764709673786387,
-0.589455797849779, 0.0696849203184557, -0.967421566101701,
-0.282216147062508,
-1.22064034884735), Mar = c(0.282216147062508, 0.210428394247925,
-0.139710298881862, -0.508488059109357, 0.355490417839531,
-0.355490417839531,
-0.430727299295457, 0.210428394247925, -0.210428394247925,
0.210428394247925,
-0.967421566101701, -0.210428394247925, -1.59321881802305, -2.2,
-0.967421566101701, -0.764709673786387, -0.355490417839531,
-0.589455797849779,
0.210428394247925, 0, -0.210428394247925, -0.764709673786387,
-0.0696849203184557, -2.2, -0.967421566101701, -0.967421566101701,
0.967421566101701, -0.508488059109357, -1.22064034884735,
-0.589455797849779,
-0.210428394247925, 0.861634120174172, -0.967421566101701,
0.0696849203184557,
-0.0696849203184557, -0.967421566101701, -0.210428394247925,
-0.0696849203184557, -0.210428394247925, 0.0696849203184557,
0.0696849203184557, -0.355490417839531, -0.589455797849779,
-0.282216147062508,
0.674489750196082, -0.589455797849779, -0.210428394247925,
-0.282216147062508
), Apr = c(0.967421566101701, -0.139710298881862, 0.0696849203184557,
-0.355490417839531, 0.210428394247925, 0.0696849203184557,
0.764709673786387,
-0.861634120174172, 0.508488059109357, 0.861634120174172,
-0.355490417839531,
0.764709673786387, 0, 0.0696849203184557, 0.430727299295457,
-0.0696849203184557, 0.674489750196082, 1.38299412710064, 1.38299412710064,
1.22064034884735, 0.210428394247925, 0.430727299295457, -0.210428394247925,
1.38299412710064, 0.430727299295457, -0.210428394247925,
0.0696849203184557,
0.967421566101701, 0.210428394247925, 1.22064034884735, 0.210428394247925,
0.0696849203184557, 0.861634120174172, -0.764709673786387,
-0.674489750196082,
0.210428394247925, 1.08532490807676, 0, 0.764709673786387,
0.764709673786387,
0.355490417839531, -0.764709673786387, -0.355490417839531,
-0.0696849203184557,
1.08532490807676, 0.861634120174172, 0.0696849203184557, 1.38299412710064
), May = c(1.22064034884735, -0.0696849203184557, 0.0696849203184557,
-0.355490417839531, 0.210428394247925, 0.764709673786387,
0.674489750196082,
-0.210428394247925, 0.355490417839531, 1.91450582505556, 1.38299412710064,
0.430727299295457, 1.08532490807676, 1.22064034884735, 1.22064034884735,
0.355490417839531, 0.430727299295457, 1.22064034884735, 0.0696849203184557,
0.967421566101701, 1.91450582505556, 0.0696849203184557, 1.38299412710064,
2.2, 0.674489750196082, -0.764709673786387, 0.861634120174172,
1.38299412710064, 0.674489750196082, 0.967421566101701, 2.2,
0.967421566101701, 0.210428394247925, 0.967421566101701, 1.22064034884735,
0.0696849203184557, -0.508488059109357, 0.861634120174172,
0.355490417839531,
-0.764709673786387, 0.210428394247925, 1.08532490807676,
-0.674489750196082,
0.508488059109357, 1.22064034884735, 0.430727299295457,
-0.0696849203184557,
0.861634120174172), Jun = c(0.355490417839531, 0.861634120174172,
0.674489750196082, -0.355490417839531, 2.2, 1.08532490807676,
0.861634120174172, 0.674489750196082, 1.22064034884735, 1.08532490807676,
1.38299412710064, 1.91450582505556, 0.210428394247925, 1.22064034884735,
1.22064034884735, 1.22064034884735, 0.430727299295457, 0.508488059109357,
1.91450582505556, 1.91450582505556, 1.08532490807676, 0.861634120174172,
1.38299412710064, 1.08532490807676, 2.2, 0.861634120174172,
0.355490417839531,
1.22064034884735, 1.91450582505556, 0.861634120174172, 1.38299412710064,
1.59321881802305, 0.861634120174172, 1.08532490807676, 1.22064034884735,
0.589455797849779, 0.764709673786387, 1.59321881802305, 0.861634120174172,
-0.210428394247925, 2.2, 0.210428394247925, 0.355490417839531,
0.355490417839531, 1.08532490807676, 1.38299412710064, 0.210428394247925,
1.08532490807676), Jul = c(1.08532490807676, 0.589455797849779,
0.355490417839531, 1.08532490807676, 0.508488059109357, 0.355490417839531,
0.674489750196082, 1.38299412710064, 1.59321881802305, 1.91450582505556,
1.59321881802305, 0.508488059109357, 0.210428394247925, 2.2,
0.967421566101701, 1.08532490807676, 1.38299412710064, 1.08532490807676,
0.210428394247925, 1.38299412710064, 0.674489750196082, 1.38299412710064,
1.08532490807676, 1.38299412710064, 0.861634120174172, 1.38299412710064,
0.861634120174172, 1.38299412710064, 0.589455797849779, 1.38299412710064,
2.2, -0.210428394247925, 0.430727299295457, 0.0696849203184557,
-0.210428394247925, 0.861634120174172, 0.674489750196082, 1.59321881802305,
1.59321881802305, 1.38299412710064, 1.22064034884735, 1.91450582505556,
1.91450582505556, 1.91450582505556, 1.38299412710064, -0.139710298881862,
0.967421566101701, 2.2), Aug = c(-0.508488059109357, -0.764709673786387,
0.210428394247925, 0.355490417839531, -0.210428394247925, 1.22064034884735,
0.210428394247925, 0.0696849203184557, 1.22064034884735, 1.38299412710064,
0.355490417839531, 2.2, 0.0696849203184557, 0.861634120174172,
-0.355490417839531, 0.355490417839531, 2.2, 0.210428394247925,
1.22064034884735, 0, 0, 0.210428394247925, 1.38299412710064,
0.861634120174172, 0.430727299295457, 0.764709673786387, 1.08532490807676,
-0.355490417839531, 1.59321881802305, -0.0696849203184557, 2.2,
0.210428394247925, -0.282216147062508, 0.861634120174172,
0.210428394247925,
0.861634120174172, 1.38299412710064, -0.282216147062508,
0.0696849203184557,
0.210428394247925, 0.674489750196082, 1.38299412710064, 0.0696849203184557,
1.22064034884735, 1.38299412710064, 1.91450582505556, 0.861634120174172,
0.674489750196082), Sep = c(-1.38299412710064, 0.0696849203184557,
-0.508488059109357, 0.589455797849779, -0.0696849203184557,
-0.210428394247925,
-0.355490417839531, 1.22064034884735, -0.674489750196082,
-0.139710298881862,
0.861634120174172, 1.38299412710064, -0.967421566101701, 0.508488059109357,
-1.22064034884735, 1.38299412710064, 0.589455797849779, 1.22064034884735,
-0.589455797849779, -0.0696849203184557, 0.861634120174172, -2.2,
-1.59321881802305, -0.0696849203184557, 0, -0.764709673786387,
-0.967421566101701, 0.861634120174172, 2.2, -0.861634120174172,
1.22064034884735, 0.508488059109357, 1.22064034884735, -0.967421566101701,
1.38299412710064, 1.59321881802305, -0.210428394247925, 1.22064034884735,
-0.282216147062508, 1.22064034884735, 1.38299412710064, -0.355490417839531,
0.210428394247925, 0, -0.0696849203184557, -0.355490417839531,
1.22064034884735, 0.0696849203184557), Oct = c(-1.08532490807676,
-1.22064034884735, -0.967421566101701, -0.210428394247925,
-1.22064034884735,
-0.210428394247925, -0.967421566101701, 0.210428394247925,
-1.22064034884735,
0, -0.861634120174172, 1.59321881802305, -0.967421566101701,
0.0696849203184557, 1.38299412710064, 0.355490417839531,
-0.589455797849779,
-1.22064034884735, 0.210428394247925, 0.355490417839531,
-0.210428394247925,
-0.355490417839531, -0.674489750196082, -0.355490417839531,
-0.967421566101701,
-0.355490417839531, 0.355490417839531, -0.967421566101701,
-0.355490417839531,
0.0696849203184557, 0.430727299295457, 0.0696849203184557, 0,
1.08532490807676, -2.2, -0.210428394247925, 0.355490417839531,
1.38299412710064, 0.674489750196082, -0.967421566101701, 0.210428394247925,
0.210428394247925, 0.861634120174172, -0.0696849203184557,
-0.430727299295457,
-0.210428394247925, 1.08532490807676, 0.430727299295457), Nov = c(0,
0.674489750196082, -1.59321881802305, 0, -0.355490417839531,
0.674489750196082, -0.674489750196082, 0.0696849203184557,
-0.508488059109357,
-0.764709673786387, -0.355490417839531, 0.210428394247925,
-1.22064034884735,
0.210428394247925, -0.508488059109357, -0.139710298881862,
-0.0696849203184557,
0, 0, 0.0696849203184557, 0.430727299295457, -0.589455797849779,
-0.210428394247925, 0.0696849203184557, 0, -1.22064034884735,
0.764709673786387, -0.967421566101701, -0.355490417839531,
-0.967421566101701,
-0.0696849203184557, -0.508488059109357, 0.508488059109357,
-0.508488059109357,
0.210428394247925, 0.210428394247925, -0.355490417839531,
0.355490417839531,
-0.282216147062508, -0.355490417839531, 0.355490417839531,
0.210428394247925,
-0.967421566101701, -0.210428394247925, -0.210428394247925,
-1.22064034884735,
0.355490417839531, -0.589455797849779), Dec = c(-0.674489750196082,
-0.589455797849779, 0.0696849203184557, -0.430727299295457,
-0.967421566101701,
-0.355490417839531, -0.210428394247925, -0.355490417839531,
0.861634120174172,
-0.355490417839531, 0.0696849203184557, -1.59321881802305,
-0.589455797849779,
0, -2.2, 0.210428394247925, -0.589455797849779, -0.282216147062508,
-0.508488059109357, 0.430727299295457, -0.355490417839531,
0.0696849203184557,
-0.764709673786387, -0.282216147062508, -0.967421566101701,
-0.967421566101701,
0.0696849203184557, -0.589455797849779, -1.22064034884735,
0.861634120174172,
-0.764709673786387, -0.355490417839531, 0.0696849203184557,
-0.210428394247925,
-0.210428394247925, 0.674489750196082, 0.210428394247925,
-0.764709673786387,
0.355490417839531, -0.355490417839531, -0.589455797849779,
-1.22064034884735,
-0.282216147062508, -0.967421566101701, -0.210428394247925,
-1.22064034884735,
0.355490417839531, 0.210428394247925)), .Names = c("year", "Jan",
"Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct",
"Nov", "Dec"), row.names = c(NA, -48L), class = "data.frame")

-- 
---
Catalin-Constantin ROIBU
Lecturer PhD, Forestry engineer
Forestry Faculty of Suceava
Str. Universitatii no. 13, Suceava, 720229, Romania
office phone     +4 0230 52 29 78, ext. 531
mobile phone   +4 0745 53 18 01
                       +4 0766 71 76 58
FAX:                +4 0230 52 16 64
silvic.usv.ro

	[[alternative HTML version deleted]]

