0

I have a dataset names subData which have 12 rows and 3591 columns.

str(subData)
 #'data.frame': 3591 obs. of  13 variables:
 #$ geneNames: Factor w/ 48803 levels "ILMN_1343291",..: 13 17 20 45 48 68 85 86 143 150 ...
 #$ GSM940873: num  9.4 10.45 13.85 10.76 7.77 ...
 #$ GSM940874: num  9.44 10.37 13.84 10.74 7.97 ...
 #$ GSM940875: num  9.43 10.61 13.93 10.73 7.91 ...
 #$ GSM940882: num  9.54 10.24 13.54 10.25 10.74 ...
 #$ GSM940883: num  9.57 10.35 13.23 10.24 10.8 ...
 #$ GSM940884: num  9.58 10.26 13.55 10.33 10.81 ...
 #$ GSM940879: num  8.52 10.92 13.35 10.78 8.7 ...
 #$ GSM940880: num  8.75 10.75 13.24 10.78 8.52 ...
 #$ GSM940881: num  8.7 10.93 13.14 10.94 8.48 ...
 #$ GSM940888: num  8.89 10.03 12.99 10.39 11.21 ...
 #$ GSM940889: num  8.58 10.02 12.87 10.23 11.13 ...
 #$ GSM940890: num  8.68 10.12 13 10.34 11.03 ...

subData$geneNames <- with(subData, reorder(geneNames, GSM940873))

nba.m <- melt(subData)
head(nba.m)
str(nba.m)
nba.m <- ddply(nba.m, .(variable), transform,
               rescale = rescale(nba.m$value))

When I run the code of ddply it gives the following error

Error: Usage: rescale(x,newrange) where x is a numeric object and newrange is the new min and max

Why?

It should be noted that I have called reshape, ggplot2, scales, reshape2 packages before running the code.

Sonali
  • 39
  • 4
  • Please show a small example data that reproduce the error – akrun Aug 16 '15 at 10:43
  • When I run any code like `rescale(1:10)`, it gives the above error. I have install the above packages. Did I miss anything? – Sonali Aug 16 '15 at 10:51
  • Have you load the `library(scales)`? If I do `library(scales); rescale(1:10)#[1] 0.0000000 0.1111111 0.2222222 0.3333333 0.4444444 0.5555556 0.6666667 [8] 0.7777778 0.8888889 1.0000000` works for me – akrun Aug 16 '15 at 10:55
  • Yes, I am using `library(reshape); library(scales); library(plyr); library(dplyr); library(reshape2)`. All the package run without any error or warning, but I have same error _Error: Usage: rescale(x,newrange) where x is a numeric object and newrange is the new min and max_. I am using RStudio Version 0.98.1102. @akrun – Sonali Aug 16 '15 at 11:01
  • May be your function is masked by a similar function in another package. Try `scales::rescale(1:10)` – akrun Aug 16 '15 at 11:02
  • 1
    Thanks. It's now working. Yes, it was amalgamate with another package. Thanks once again. @akrun – Sonali Aug 16 '15 at 11:14

0 Answers0