Hello,

sedm1000 wrote:
Sorry - I figured that this to be a more common defined error than anything
specific to the data/function...  Thanks for looking at this.

The data and function are below. Creating a single line of the data.frame at
a time will work (i.e. fold(s))

For multiple line data.frames, an error is generated. Ideally I would like
to record the output from fold(sq) in a two column data.frame, whether it
requires reading in the data to fold one line at a time or in bulk.

library(GeneRfold)
s<- "ATTATGCATCGACTAGCATCACTAG"
fold(s)
[[1]]
[1] "...((((........))))......"

[[2]]
[1] -2.3


sq <- data.frame(c("ATGTGTGATATGCATGTACAGCATCGAC",
+               "ACTAGCACTAGCATCAGCTGTAGATAGA",
+               "ACTAGCATCGACATCATCGACATGATAG",
+               "CATCGACTACGACTACGTAGATAGATAG",
+               "ATCAGCACTACGACACATAGATAGAATA"))

fold(sq)
Error in fold(sq) : STRING_ELT() can only be applied to a 'character vector', not a 'list'

struct <- t(as.data.frame(sapply(sq[,1], fold, t=37)))

Error in FUN(X[[1L]], ...) :
 STRING_ELT() can only be applied to a 'character vector', not a 'integer'


This appears to be a Bioconductor package, so if this doesn't help, I'd ask on the specific bioconductor mailing list. I don't have the package installed, so take the following advice with that in mind.

Did you look at the str(sq) ? It is not a character vector, it is a factor, so you might need to convert or see stringsAsFactors in ?options.

Try

lapply(sq[, 1], function(x) fold(as.character(x)))

If that doesn't work, try the other list.

Good luck,
Erik

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to