r - Can corr.test be used for any dataframe? -


i trying find correlations , p-values between variables in dataframe (df1) using corr.test in psych package. variables in dataframe integers , there no nas. when run corr.test(df1), there error message.

error in data.frame(lower = lower, r = r[lower.tri(r)], upper = upper,  :    arguments imply differing number of rows: 0, 28 

i tried run example (corr.test(sat.act)) in psych package , there no error. new r, can tell me wrong dataframe.

> head(df1)   s1.pre s2.pre s1.post s2.post v1.pre v2.pre v1.post v2.post 1     21     31      25      35      7      1      19       4 2     15     26      21      29     13     11      16      14 3     18     27      23      31      8      2       3       3 4     17     31      18      39     13     11      15      14 5     15     26      16      29     26     15      32      20 6     17     28      16      28      2      4       2       7  > dput(head(df1)) structure(list(s1.pre = c(21l, 15l, 18l, 17l, 15l, 17l), s2.pre = c(31l,  26l, 27l, 31l, 26l, 28l), s1.post = c(25l, 21l, 23l, 18l, 16l,  16l), s2.post = c(35l, 29l, 31l, 39l, 29l, 28l), v1.pre = c(7l,  13l, 8l, 13l, 26l, 2l), v2.pre = c(1l, 11l, 2l, 11l, 15l, 4l),  v1.post = c(19l, 16l, 3l, 15l, 32l, 2l), v2.post = c(4l,  14l, 3l, 14l, 20l, 7l)), .names = c("s1.pre", "s2.pre", "s1.post",  "s2.post", "v1.pre", "v2.pre", "v1.post", "v2.post"), row.names = c(na,  6l), class = "data.frame")  > sapply(df1, class) s1.pre    s2.pre   s1.post   s2.post    v1.pre    v2.pre   v1.post   v2.post  "integer" "integer" "integer" "integer" "integer" "integer" "integer" "integer"  

i contacted william revelle - author of psych package , here said:

mark, unfotunately found bug introduced 1.4.3. 1.4.4 go out cran weekend. in meantime can fix @ http://personality-project.org/r (choose source other repository if using mac) or http://personality-project.org/r/src/contrib , zip file if using pc. otherwise, wait until next week. sorry problem. still work long have unequal number of subjects or missing data.


Comments

Popular posts from this blog

Why can rails not find a route created by a helper? -

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -