Re: [R] merge dataframes with condition
Hi @ all, thanks for the solutions! Now I can go on. Greetz GeoPhagUS -- View this message in context: http://r.789695.n4.nabble.com/merge-dataframes-with-condition-tp4649605p4649712.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] merge dataframes with condition
Refering the discussed issue: As a result I have dataframe like the following. animal-c(bear,lion,monkey,fish,zebra) S-c(10,20,40,5,12) N-c(5,8,15,26,1) Z-c(24,12,8,7,2) R-c(21,14,2,5,3) Q-c(13,9,9,16,1) df1-data.frame(animal,S,N,Z,R,Q) Now, I want to plot it as a stacked barchart so that it looks like on the example below. examp3.png http://r.789695.n4.nabble.com/file/n4649714/examp3.png It's clear to me, that I have to transform the frame again - but I'm not quite sure how to do it. Thanks GeO -- View this message in context: http://r.789695.n4.nabble.com/merge-dataframes-with-condition-tp4649605p4649714.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] no y-axis
thank you! -- View this message in context: http://r.789695.n4.nabble.com/no-drawn-y-axis-but-values-tp4649298p4649718.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] merge dataframes with condition
Hi @ all, I wamnt to combine two dataframes including a condition. I have two dataframes like the following: animal-c(bear,bear,lion,monkey,fish,monkey,bear,zebra,zebra) val-c(2,42,67,5,12,9,87,1,12) place-c(S,N,N,Z,R,O,E,I,Q) df1-data.frame(animal,val,place) animal-c(bear,bear,lion,monkey,fish,monkey,bear,zebra,zebra) val-c(21,45,78,6,18,77,89,17,28) place-c(S,N,N,Z,R,G,O,P,Q) df2-data.frame(animal,val,place) I would like to merge them with a condition. If animal and place are eqal in both df's, then add the values. If not add all three parameters (animal,value,place) at the bottom (like rbind). I hope somebody can help me. Thank a lot. geo -- View this message in context: http://r.789695.n4.nabble.com/merge-dataframes-with-condition-tp4649605.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] no y-axis
Hi Jim and thanks for your answer. It does not work how I want. When I use your proposal, the values are superimposed like shown on the pic. pic.png http://r.789695.n4.nabble.com/file/n4649368/pic.png Thats my code (what I need is a y-scale with the following interrupts: 5,10,100,1000,5000): plot(BE_UK_ABFG$year, BE_UK_ABFG$ammo, type=s, col= #DB270F, xaxt=n, #yaxt=n, ylim=c(0,5000), xlab=, ylab=, main=Ammo Rep 1885b, adj=0, las = 1, lwd=3, bty=n ) abline(h=0:0, lwd=1, col=black) abline(h=1000:1000, lwd=0.3, col=darkgray, lty=dashed) abline(h=2000:2000, lwd=0.3, col=darkgray, lty=dashed) abline(h=3000:3000, lwd=0.3, col=darkgray, lty=dashed) abline(h=4000:4000, lwd=0.3, col=darkgray, lty=dashed) abline(h=5000:5000, lwd=0.3, col=darkgray, lty=dashed) lines (BE_UK_AW$year, BE_UK_AW$ammo, type=s, col= #826A9F, lwd=3.5) axis(1,at=seq(2007,2010)) mtext(c(5,10,100,1000,5000),at=c(5,10,100,1000,5000),side=2,line=1, las=1) Thank you and best greetings GeO -- View this message in context: http://r.789695.n4.nabble.com/no-drawn-y-axis-but-values-tp4649298p4649368.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Labeling position barchart
Hi and thanks a lot for your advices. Both work fine! Thanks GeoPhagUS -- View this message in context: http://r.789695.n4.nabble.com/Labeling-position-barchart-tp4649031p4649294.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] no y-axis
HI @ all, I'm looking for a simple solution to supress the y-axis - but only the drawn scale - not the values. Only the numbers should be displayed. I tried yaxt=n but there everything of the y-axis is supressed. Thanks GeO -- View this message in context: http://r.789695.n4.nabble.com/no-y-axis-tp4649298.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] no y-axis
Hi and thanks for your answer, I need no axis - only the labels. In your example 1 to 10. Greetz GeO -- View this message in context: http://r.789695.n4.nabble.com/no-drawn-y-axis-but-values-tp4649298p4649324.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] no y-axis
thanks, that works fine! good idea. I have one last question regarding this problem. My y-scale now is grouped from 0 - 4000 in 1000. Is it possible to set the scale into not equal breaks like 5,10,100,1000,5000 ? My axis now: axis(2,at=seq(0,4000,1000),col = white, las=1) thanks a lot GeO -- View this message in context: http://r.789695.n4.nabble.com/no-drawn-y-axis-but-values-tp4649298p4649336.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Labeling position barchart
Hi @ all, I try to set a labeling on simple barchart. I do it with the text function. I want to see values of the x axis (BE_AKT$ammo) above the bars. When I try the following code, the values are shown, but not in the correct position. They should be labeled 0.08 above the bars. text(BE_AKT$ammo, BE_AKT$ammo + 0.08, label = BE_AKT$ammo, family=Calibri) Can somebody help me? Thank you very much! GeO -- View this message in context: http://r.789695.n4.nabble.com/Labeling-position-barchart-tp4649031.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Stacked Barchart as relative share
Hi @ all, I'm looking for a solution to plot a dataframe as a stacked bar chart like on this picture: http://4.bp.blogspot.com/_79SognVSu7A/S6OtzgksPSI/Brw/-IuFNewdZFE/s400/Stacked%2BBar%2BChart.png My dataframe example2.csv http://r.789695.n4.nabble.com/file/n4648854/example2.csv My questions: Is there a standard function to convert the values to 100 percent relate to realize the stacked chart or does a library generate the complete plot inculding an automatically conversion? I need the states (WA, MT, ND etc.) on the x-axis and the distribution of the values (related to 100 %) on the y-axis (stacked) to compare the shares per state. I'm hoping for help from you. Thanks a lot. GeO -- View this message in context: http://r.789695.n4.nabble.com/Stacked-Barchart-as-relative-share-tp4648854.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Stacked Barchart as relative share
It Works :-) Thank you very much! Thats my way ! Best greetings GEO -- View this message in context: http://r.789695.n4.nabble.com/Stacked-Barchart-as-relative-share-tp4648854p4648883.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Regrouping dataframe
Hi @ all, I hope for some help of you. I have a dataframe and I want to regroup it. examp4.csv http://r.789695.n4.nabble.com/file/n4648927/examp4.csv I need the arguments of VAL as table heads and the TYPE only in individual expression. The result should look like in the example pic. exp4.png http://r.789695.n4.nabble.com/file/n4648927/exp4.png I think reshape can do it? Thanks GeO -- View this message in context: http://r.789695.n4.nabble.com/Regrouping-dataframe-tp4648927.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Regrouping dataframe
Thank you very much! It works ! Best greetings GeO -- View this message in context: http://r.789695.n4.nabble.com/Regrouping-dataframe-tp4648927p4648956.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] plot dataframe with inconsistently relations
yes thats right. I want to see all points - so I need a line with dots -- View this message in context: http://r.789695.n4.nabble.com/plot-dataframe-with-inconsistently-relations-tp4642766p4643116.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] plot dataframe with inconsistently relations
Hi @ all and thanks a lot for your advises. So far I don't know the function dput. Now I read something about it and I have the following result: TEST year value state 1 200715FL 2 200816FL 3 200814TX 4 200813TN 5 200918FL 6 200915OH 7 201019TX 8 201012OH dput(TEST) structure(list(year = c(2007L, 2008L, 2008L, 2008L, 2009L, 2009L, 2010L, 2010L), value = c(15L, 16L, 14L, 13L, 18L, 15L, 19L, 12L ), state = structure(c(1L, 1L, 4L, 3L, 1L, 2L, 4L, 2L), .Label = c(FL, OH, TN, TX), class = factor)), .Names = c(year, value, state), class = data.frame, row.names = c(NA, -8L)) class(TEST) [1] data.frame I hope this will help you. Thank and greetings Geo -- View this message in context: http://r.789695.n4.nabble.com/plot-dataframe-with-inconsistently-relations-tp4642766p4642883.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] plot dataframe with inconsistently relations
Hi @ all, I work with a dataframe like the attached one. I want to plot it, so that value is listed on the y-axis, year on the x-axis and states as lines in the coordinate system. I tried the following code: require(ggplot) plot1-ggplot(TEST, aes(year, value)) + geom_line(aes(colour = state)) The result could be very nice but the the lines are stacked. Maybe there is an easier way to do that? Thanks a lot for your help. Geo -- View this message in context: http://r.789695.n4.nabble.com/plot-dataframe-with-inconsistently-relations-tp4642766.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] barchart with 3 rows
Thanks a lot 2 all of you. Both proposals work very fine!! Thank you and best greetings. Geophagus -- View this message in context: http://r.789695.n4.nabble.com/barchart-with-3-rows-tp4641572p4641809.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] barchart with 3 rows
Thank you - I'll try it today and give you a reply!! Thanks a lot Geo -- View this message in context: http://r.789695.n4.nabble.com/barchart-with-3-rows-tp4641572p4641697.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] barchart with 3 Arguments
Hi @ all, I have a problem concerning the barplot (barchart lattice) of a dataframe. I work with the attached dataframe. When I try to plot this dataframe I only get two rows plottet. When I try to plot the whole dataframe, there is message, that it is 'height' must be a vector or a matrix. On the y-axis, the amount_cattle should be displayed and on the x-axis the year and the country so that I can compare the amount over the years in each country. Each country on the x-axis needs 4 bars (2000-2003). I hope you can help me. Thanks a lot geophagus -- View this message in context: http://r.789695.n4.nabble.com/barchart-with-3-Arguments-tp4641572.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] colored outliers
Thank you so much - now it works! Tanks for your patience with me! GeO -- View this message in context: http://r.789695.n4.nabble.com/colored-outliers-tp4282207p4315743.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] colored outliers
Dear Petr and Justin, my problem ist, that I only want to have the 4 highest values for Ni as a red point or with a red circle. The other points should not be modificated. In your proposals always all points get a red circle or a red point not only the 4 highest Ni values! I hope you could understand me! Thanks for your help! GeO -- View this message in context: http://r.789695.n4.nabble.com/colored-outliers-tp4282207p4313278.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] colored outliers
Hi Justin, it still does not work. All points become red. I use this skript with your modifications: TOC_NI-read.csv2(C:/Users/hilliges/Desktop/Master/Daten/Statistik/TOC-NI.csv, sep=;, dec=,, encoding=UTF-8) circ-TOC_NI[order(TOC_NI$NI,decreasing=T),][1:4,] plot(NI~TOC,data=TOC_NI,col=blue, pch=16, xlim=c(0,450)) abline(lm(NI~TOC,data=TOC_NI),col = red,lwd=3) points(NI~TOC,data=TOC_NI,col='red',pch=1,size=3) Maybe the the Sourcefile will help to solve the prob? http://r.789695.n4.nabble.com/file/n4291954/TOC-NI.csv TOC-NI.csv Thank you so muich! GeO -- View this message in context: http://r.789695.n4.nabble.com/colored-outliers-tp4282207p4291954.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] colored outliers
Hi @ all, I have question how to mark significant outliers in R. This is my very simple script to plot a regression: TOC_NI-read.csv2(C:/Users/XYZ/Desktop/Master/Daten/Statistik/TOC-NI.csv, sep=;, dec=,, encoding=UTF-8) plot(NI~TOC,data=TOC_NI,col=blue, pch=16, xlim=c(0,450)) abline(lm(NI~TOC,data=TOC_NI),col = red,lwd=3) summary(lm(NI~TOC,data=TOC_NI)) The result is the following pic: http://r.789695.n4.nabble.com/file/n4282207/nickel_TOC_5f.png nickel_TOC_5f.png Now I want to make small red circles around the four highest values of Ni. Does anyone has an idea how to do that? Thanks a lot! Best Regards Geophagus -- View this message in context: http://r.789695.n4.nabble.com/colored-outliers-tp4282207p4282207.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] colored outliers
Hi Justin, thanks a lot for your quick answer. If I use your code, all points become red. How do you include the sorted and separated four values into the points argument? The variable in your script is called circ but this is not fronted up anymore. Here the script again: TOC_NI-read.csv2(C:/Users/hilliges/Desktop/Master/Daten/Statistik/TOC-NI.csv, sep=;, dec=,, encoding=UTF-8) circ-TOC_NI[order(TOC_NI$NI,decreasing=T),] plot(NI~TOC,data=TOC_NI,col=blue, pch=16, xlim=c(0,450)) abline(lm(NI~TOC,data=TOC_NI),col = red,lwd=3) points(NI~TOC,data=TOC_NI,col='red',pch=1,size=3) Thanks a lot for your help! GeO -- View this message in context: http://r.789695.n4.nabble.com/colored-outliers-tp4282207p4282481.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Matrix for correlation
hi @ all, I have problem with creating a matrix for a cor() function. I try to use the cor() function on a matrix to test the correlation between each value in a column. Maybe like corr(x, method = xyz). My x has two columns maybe like this: MEDIA VALUE Car 23 Train26 Plane 25 Cab 22 Bike 15 and so on. Now I want to calculate the correlation between Car and Train, Car and Plane, Train and Plane and so on. Sorry but I don't have a clue and I hope there is an easy way to solve my problem. Thanks a lot for all answers. Greetz Geo -- View this message in context: http://r.789695.n4.nabble.com/Matrix-for-correlation-tp4119590p4119590.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Matrix for correlation
Hi Michael, thank you so much for your fast reply. On the image below there is an example of what I mean. I need the correlation between the values on the fields with ?. http://r.789695.n4.nabble.com/file/n4119734/corr_ex.png But my source data is not in a matrix. It looks like the table in my first post. Do you understand my problem? Thanks a lot! Geophagus -- View this message in context: http://r.789695.n4.nabble.com/Matrix-for-correlation-tp4119590p4119734.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Matrix for correlation
Hi @ all and sorry for the confusion, my problem is solved. I also know a corellation is - it was only a formatting and describing problem. Grant gave me the right advice with the kruskal-wallis! Thanks GeOphagus -- View this message in context: http://r.789695.n4.nabble.com/Matrix-for-correlation-tp4119590p4120561.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] cbin *-* Problem with different vector lenghts
Hi @ all, I have the following question: Is there a possibilty to cbind tree dataframes with different numbers of rows? Here is my example: b2007 5 8 1 1 b2008 3 6 8 3 1 2 b2009 1 3 8 1 2 1 cbind (b2007,b2008,b2009) b2007 b2008 b2009 3 1 3 1 6 1 1 2 8 1 2 1 Warnmeldung: In cbind(b2007, b2008, b2009) : number of rows of result is not a multiple of vector length (arg 1) I also need the row name 5 and the 1 with NA or 0 as value in the result. I hope my problem was understandable. Thanks a lot in advance! Falk aka Geophagus -- View this message in context: http://r.789695.n4.nabble.com/cbin-Problem-with-different-vector-lenghts-tp3746473p3746473.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Grouping columns
Hi @ all, both possibilities are working very fine. Thanks a lot for the fast help! Best Greetinx from the Earth Eater Geophagus -- View this message in context: http://r.789695.n4.nabble.com/Grouping-columns-tp3681018p3683076.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Grouping columns
*Hi @ all, I have a question concerning the possibilty of grouping the columns of a matrix. R groups the columns alphabetically. What can I do to group the columns in my specifications? The script is the following:* #R-Skript: Anzahl xyz #Quelldatei einlesen b-read.csv2(Z:/int/xyz.csv, header=TRUE) #Teilmengen für die Einzeljahre generieren b1-subset(b,jahr==2007) b2-subset(b,jahr==2008) b3-subset(b,jahr==2009) #tapply für die Einzeljahre auf die jeweilige BranchenID b1_1-tapply(b1$betriebs_id,b1$umweltkompartiment,length) b1_2-tapply(b2$betriebs_id,b2$umweltkompartiment,length) b1_3-tapply(b3$betriebs_id,b3$umweltkompartiment,length) #Verbinden der Ergebnisse b11-rbind(b1_1,b1_2,b1_3) Gesamt-apply(X=b11,MARGIN=1, sum) b13-cbind(Gesamt,b11) b13 Gesamt Abwasser Boden Gefährliche Abfälle Luft nicht gefährliche Abfälle Wasser b1_1 9832 432183147 2839 1592 1804 b1_2 10271 413283360 2920 1715 1835 b1_3 9983 404213405 2741 1691 1721 *Now I want to have the following order of the columns: Gesamt, Wasser, Boden, Luft, Abwasser, Gefährliche Abfälle, nicht gefährliche Abfälle Thanks a lot for your answers! Fak* -- View this message in context: http://r.789695.n4.nabble.com/Grouping-columns-tp3681018p3681018.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.