aggregate-functions


R: transposing and aggregating columns


I have this dataframe with v1 as names of categories and v2 as items.
I need to aggregate v1 so fruit will appear only once, and all items in v2 will be transposed and placed in together in a single cell separated by comma.
Any assistance will be appreciated :)
You can easily do it using transpose in aggregate function.
dt<-aggregate(v2~v1,data=dt,fun=t)
However you will have some unwanted text in the rolled up string which you can easily removed using gsub function
dt$v2<-gsub("[c()]","",dt$v2))

Related Links

Creating an aggregate function fails
Necessity of declaration of function in c and cpp
Calculate window average in tableau
Complexity asymptotic relation (theta, Big O, little o, Big Omega, little omega) between functions
What are TOP_COUNT and TOP_MAXCOUNT in BigQuery?
marklogic need advise for approach to aggregate documents
multiply(num) aggregate function in postgresql
Binding the Result of an Aggregate Function to a Projected Variable
tableau aggregate data based on dimension
where clause and aggregate functions
Is there such a thing as a join() aggregate function that concatentates field values at a specific character?
Aggregation of an expression in Django query spanning multiple tables
How to aggregate / roll up percentile measures
A peer-to-peer and privacy-aware data mining/aggregation algorithm: is it possible?
Multiple aggregates in SPARQL
SAP BO XI Desktop Intelligence Aggregate Calculations

Categories

HOME
c#
postgresql-9.3
mifare
cryengine
hiveql
ms-application-insights
browser-cache
kohana
collision-detection
soap-client
gcloud
hql
smooth-scrolling
powerpivot
virtuemart
airbnb
indri
audio-streaming
spring-webflow
custom-component
include-path
policy
rollupjs
gulp-jshint
git-submodules
osgi-bundle
textview
keil
flickr
tunnel
cocoa-scripting
sdl-2
strategy-pattern
stochastic-process
dotnetnuke-module
area
aspose.pdf
jquery-ui-slider
aspnetboilerplate
contenteditable
colorbox
bootstrap-carousel
emacs24
aws-rds
xamarin-test-cloud
kendo-scheduler
fileopendialog
computed-properties
aws-kms
user-profile
archiva
pebble-js
sqlxml
clear
webservices-client
javapackager
personality-insights
first-order-logic
pushwoosh
tooltwist
playn
vspackage
opennebula
skview
shunting-yard
cordova-3
growl
indic
nsmutableurlrequest
time-frequency
ccmenuitem
scjp
webshim
elixir-framework
kuka-krl
flask-mongoengine
nop
pechkin
gpl
zepto
shapado
states
sup
pdf-reader
motorola-droid
sqlbuddy
facebook-winjs-sdk
towerjs
scsf
openwrap
soapexception
windows-xp-embedded
netduino
viewdata
p4.net
dgml
datadude
djangoappengine
user-preferences
onresize
software-update
office-2003

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App