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

Querying customDimensions in Google Bigquery
NHibernate - QueryOver criteria appearing in Where instead in Having clause, error
Howto aggregate on full data set in Spring Batch jobs?
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

Categories

HOME
reactjs
spring-boot
system-calls
sip
oracle-sqldeveloper
cluster-analysis
mifare
spss
lithium
query-string
opengl-es
obd-ii
ios-universal-links
google-search-appliance
aspectj
solidity
virtualenv
watson-dialog
appsettings
greensock
facebook-marketing-api
views
google-street-view
novacode-docx
udeploy
restructuredtext
formulas
android-wear-2.0
sha
drombler-fx
sqldependency
angular-schema-form
osgi-bundle
jboss-arquillian
keil
webmock
angularjs-resource
tunnel
form-fields
byobu
cowboy
google-cloud-powershell
java-5
quartz
runner
standard-error
appcmd
extjs3
sharpdevelop
seyren
hellosign
scikit-image
x12
hdr
deck.js
geokit
scriptengine
patching
system-integration
android-progressbar
hana-sql-script
wordpress-plugin
yfiles
computability
skscene
recode
gitk
roslyn-code-analysis
winforms-interop
eaaccessory
sparkcore
waterline
genome
accpac
qxorm
alpha-beta-pruning
report-builder2.0
diffmerge
famous-engine
vundle
mvcgrid
django-tests
dateadd
image-preloader
new-operator
html5-filesystem
dylan
zend-db-table
oc4j
bho
system.transactions
gssapi
xcode4.6.3
sup
nserror
motorola-droid
execjs
functional-specifications
web-search
hp-trim
datadude
scala-designer
content-delivery-network

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