R library(bear) and library(reshape2) conflict in melt -
i have following issue when using bear
package in r
:
origdata.wide <- read.table(header=t, text=' subject sex control cond1 cond2 1 m 7.9 12.3 10.7 2 f 6.3 10.6 11.1 3 f 9.5 13.1 13.8 4 m 11.5 13.4 12.9 ')
in case use reshape2
command works fine , can use melt
(example taken r cookbook).
library(reshape2) melt(origdata.wide, id.vars=c("subject","sex"), variable.name='condition')
but later need use summaryse
function, found out contained in bear
. problem when load bear
variable.name
parameter not have effect cannot define table defined earlier. think bear
overwrites functions. there way around problem?
r inform if overwritten. example:
the following objects masked ‘package:plyr’: rename, round_any
it seems bear
loads reshape
package have different arguments functions:
the following objects masked ‘package:reshape’: colsplit, melt, recast
you can solve problem reloading manually, , being careful in future load packages in order:
unloadnamespace('bear') unloadnamespace('reshape2') library(bear) library(reshape2)
if see errors of form
error in unloadnamespace("reshape2") : namespace ‘reshape2’ imported ‘ggplot2’ cannot unloaded
then unloadnamespace
packages , reload them well. in ~/.rprofile
file, can place
library(bear) library(reshape2)
so new r sessions load correctly in future.
Comments
Post a Comment