This question already has answers here:
placing mean,total and max together in a table in r
(3 answers)
Closed 9 years ago.
I've got some code below which I'd like to be able to combine into one big table. Is this possible?
cbind(sum(michelson[michelson$Expt==1,]$Speed),
mean(michelson[michelson$Expt==1,]$Speed),
max(michelson[michelson$Expt==1,]$Speed))
cbind(sum(michelson[michelson$Expt==2,]$Speed),
mean(michelson[michelson$Expt==2,]$Speed),
max(michelson[michelson$Expt==2,]$Speed))
cbind(sum(michelson[michelson$Expt==3,]$Speed),
mean(michelson[michelson$Expt==3,]$Speed),
max(michelson[michelson$Expt==3,]$Speed))
cbind(sum(michelson[michelson$Expt==4,]$Speed),
mean(michelson[michelson$Expt==4,]$Speed),
max(michelson[michelson$Expt==4,]$Speed))
cbind(sum(michelson[michelson$Expt==5,]$Speed),
mean(michelson[michelson$Expt==5,]$Speed),
max(michelson[michelson$Expt==5,]$Speed))
I'd appreciate some help please from some experts! Thanks
Explaining what you are trying to achieve will help someone answer rather than pasting only the code ... From what I can understand from your code, ddply seems to be a right choice here as pointed out by #Henrik
Related
This question already has answers here:
How to reshape data from long to wide format
(14 answers)
Pivot_wider function (tidyr r package) from multiple variables
(2 answers)
Closed 8 months ago.
Hey guys I am trying to build a pivot table in R which I just started using. I know this topic has been discussed a few times here but I can't find an example that would help me out. I have data table which looks like following
What I am trying to do is build a triangle with Years as columns. Country & City as rows. So it looks like this
I have tried using group_by but can't figure it out. Would really appreciate any advice I can get!
Thanks in advance
This question already has answers here:
Show names of everything in a package
(4 answers)
Closed 9 years ago.
My question is similar to this question and in fact, is answered there. But because it took me a lot effort to find the answer there. I preferred to create a new more organized one and answer it myself.Now the question is:
If I want to see all methods, dataframes, etc of a package that I only know its name, what should I do to access them very easily?
Just enter this code:
help(package='PACKAGENAME', help_type='html')
for example to see all you have in the R basic package, stats:
help(package='stats',help_type='html')
This question already has answers here:
Sort (order) data frame rows by multiple columns
(19 answers)
Closed 9 years ago.
Playing around with airquality, and I want to sort the data by Ozone and Wind (within wind)
I have the following command:
sort.airquality<-airquality[order(Ozone, Wind),]
sort.airquality[1:153,]
For some reason I just don't think this is right, I've tried looking up some of the tutorials but they don't seem to cover exactly what I'm looking for. Any help would be most appreciated.
Thanks.
For improved readability, I suggest
sort.airquality <- airquality[with(airquality, order(Ozone, Wind)),]
You want
sort.airquality <- airquality[order(airquality$Ozone, airquality$Wind),]
This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
R gvisTable pre-selection using event trigger option and javascript code
Hi I have a table/dataframe/xts/matrix object, and would like to be be able to highlight specific rows and columns in different colors ...I think I saw this before, but can't find it anymore.
Any help would be greatly appreciated
Any pretty knitr outputs would also be nice if thats possible...
I re-asked this question focusing in on a gvisTable getting an HTML output and got a fairly good answer from Jeff Allen.
Here is the link to the other question if anybody is interested...
This question already has an answer here:
Closed 11 years ago.
Possible Duplicate:
How to merge cells in DataGrid/AdvancedDataGrid in Adobe Flex
I want to do something as Office Excel with Flex, such as merging cells. How do I do it?
Hi Please given below link you will find out every thing regarding your query....Click Here For Demo & Code