[R] Not able to convert data.frame to numeric properly

2014-04-09 Thread Sachinthaka Abeywardana
I have the following: a #note that the 28 is a row.name GHP GP T Tn 28 2.2194 2.6561 2.9007 3.2988 min(as.numeric(a)) 2.9007 min(as.numeric(as.character(a))) 2.9007 as.numeric(as.character(a)) #What's going on here??? [1] 33. 29. 2.9007 3.2988

Re: [R] Not able to convert data.frame to numeric properly

2014-04-09 Thread Frede Aakmann Tøgersen
We can't say because we don't know how a was created. Please email the output from str(a) and dput(a) Yours sincerely / Med venlig hilsen Frede Aakmann Tøgersen Specialist, M.Sc., Ph.D. Plant Performance Modeling Technology Service Solutions T +45 9730 5135 M +45 2547 6050

Re: [R] Not able to convert data.frame to numeric properly

2014-04-09 Thread Sachinthaka Abeywardana
a is ofcourse a subset of data.frame, a ROW of the original table specifically. str(a) 'data.frame': 1 obs. of 4 variables: $ GHP: Factor w/ 51 levels 0.0944,0.1446,..: 33 $ GP : Factor w/ 51 levels 0.1755,0.3582,..: 29 $ T : num 2.9 $ Tn : num 3.3 dput(a) structure(list(GHP =

Re: [R] moses extreme reaction test

2014-04-09 Thread Berend Hasselman
On 09-04-2014, at 00:56, David Winsemius dwinsem...@comcast.net wrote: On Apr 8, 2014, at 2:41 PM, Bert Gunter wrote: Just for the fun of it, I searched for R package moses extreme reaction test on google. The 8th hit was the package DescTools, but that included the 3 earlier hits and

Re: [R] Not able to convert data.frame to numeric properly

2014-04-09 Thread Frede Aakmann Tøgersen
Now we are able to help you. What you see is an artefact of an object in T of class 'factor' ## So please, see ?factor ## first 2 columns subset of a factor str(a) 'data.frame': 1 obs. of 4 variables: $ GHP: Factor w/ 51 levels 0.0944,0.1446,..: 33 $ GP : Factor w/ 51 levels

Re: [R] Replacement Value

2014-04-09 Thread arun
Hi Dila, If 'dat' is the dataset: dat$C[dat$B==0] - 0  A.K. On Wednesday, April 9, 2014 1:30 AM, dila radi dilarad...@gmail.com wrote: Dear arun Yes indeed..if the value in B is O..next value in the same row also 0.. other value than 0 remains unchanged. On Apr 9, 2014 12:48 PM, arun

Re: [R] Not able to convert data.frame to numeric properly

2014-04-09 Thread arun
Hi, Try: min(sapply(lapply(a,as.character),as.numeric))  #[1] 2.2194 A.K. On Wednesday, April 9, 2014 2:27 AM, Sachinthaka Abeywardana sachin.abeyward...@gmail.com wrote: a is ofcourse a subset of data.frame, a ROW of the original table specifically. str(a) 'data.frame': 1 obs. of  4

Re: [R] Label axis tick marks with a simple function of axis value

2014-04-09 Thread Jim Lemon
On 04/09/2014 01:12 PM, Hurr wrote: This still puts tick marks at data points: h=c(1,2,3,4,5,6,7,8,9) v=c(9,8,7,6,5,4,3,2,1) plot(h,v,xaxt='n') x-c(1.6,2.6,6.6,9.6,12.9) axis_labels-1/pretty(x) axis(1,at=pretty(x),labels=axis_labels) How do I get the axis to approx 13 ?

Re: [R] Label axis tick marks with a simple function of axis value

2014-04-09 Thread Hurr
Thanks Jim, Labels for the following are at 0,2,4,6,8,10,12, not data, good. and omitted where lack of room. h=c(1.2,2.4,3.1,4.7,5.3,6.2,7.6,8.8,9.7) v=c(9,8,7,6,5,4,3,2,1) plot(h,v,xaxt='n',xlim=c(-1,13)) x-c(1.6,2.6,6.6,9.6,12.9) axis_labels-1/pretty(x) axis(1,at=pretty(x),labels=axis_labels)

Re: [R] Label axis tick marks with a simple function of axis value

2014-04-09 Thread Jim Lemon
On 04/09/2014 06:17 PM, Hurr wrote: Thanks Jim, Labels for the following are at 0,2,4,6,8,10,12, not data, good. and omitted where lack of room. h=c(1.2,2.4,3.1,4.7,5.3,6.2,7.6,8.8,9.7) v=c(9,8,7,6,5,4,3,2,1) plot(h,v,xaxt='n',xlim=c(-1,13)) x-c(1.6,2.6,6.6,9.6,12.9) axis_labels-1/pretty(x)

[R] Fw: Re: Splitting columns and forming new data files in R

2014-04-09 Thread arun
On Wednesday, April 9, 2014 1:26 AM, arun smartpink...@yahoo.com wrote: Hi Atem, If you change colnames(mat1)[-(2:3)] - ' ' in 'lst1New' lst1New - lapply(lst1,function(x) {lst2 - setNames(lapply(x,function(y) {dat - read.table(y,sep= ,header=TRUE, stringsAsFactors=FALSE); dat[,1:104]} ),

[R] How to implement a recurring check for updates for R and packages?

2014-04-09 Thread Tal Galili
Hello all, I wish to add to the installrhttp://cran.r-project.org/web/packages/installr/package the ability to check for new versions of R once every X units of time (maybe once every two weeks). I would like to keep a time stamp somewhere, that would stay persistent across R sessions (i.e.:

Re: [R] Not able to convert data.frame to numeric properly

2014-04-09 Thread Bert Gunter
I would suggest that unlist(lapply(... should always be preferable to sapply(lapply... if you want to convert data in a data frame to a vector. I can't see any reason to run the same loop twice. But check timings -- maybe I'm overly sensitive to unimportant aesthetics. Cheers, Bert Bert Gunter

Re: [R] Issues with fa() function in psych

2014-04-09 Thread William Revelle
Sagnik raises the question as to why the psych package does not offer the ‘equamax’ rotation. It is because all rotations are handled through the GPArotation package which does not offer equamax. Sagnik also points out that if the requested rotation is not available, fa defaults to

Re: [R] Generate Crosstab in R

2014-04-09 Thread arun
Hi, Try: dat - structure(list(Custom = c(Judi, Judi, Ben, Tom, Tom, Bill, Lindy, Shary, Judu, Judu, Billy, Tommy, Tommy, Benjum, Linda, Shiry), Gender = c(Female, Female, Male, Male, Male, Male, Female, Female, Female, Female, Male, Male, Male, Male, Female, Female), Product = c(A, B, A, A,

[R] Error object .Source not found when using package tm.plugin.webmining

2014-04-09 Thread brian arb
I don't understand this error or how to resolve it. Error in get(name, envir = asNamespace(pkg), inherits = FALSE) : object '.Source' not found Using R version 3.1.0 beta (2014-03-28 r65330) -- Spring Dance # output from console ## library(quantmod) Loading required package:

[R] flowDensity package

2014-04-09 Thread Raghu
I am unable to install flowDensity package from bioconductor in R version 3.0 or 3.1. did anyone have the same problems with this. Thanks, Raghu __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] Ignore escape characters in a string...

2014-04-09 Thread Jonathan Greenberg
Thanks all, I'll try some of these suggestions out but it seems like a raw string ability could come in helpful -- there aren't any packages out there that have this capability? --j On Tue, Apr 8, 2014 at 1:23 PM, Jeff Newmiller jdnew...@dcn.davis.ca.us wrote: What is wrong with winpath -

[R] glmulti wrapper for lmer does not produce results

2014-04-09 Thread anto.r
I posted this on SO, got no response. Sorry about cross-posting, but atleast I would like to know if I am understading something totally wrong I am using a `glmulti` wrapper for glmer (binomial) and the `summary` is: `This is glmulti 1.0.7, Apr. 2013. Length Class Mode 0 NULL NULL`

Re: [R] How to implement a recurring check for updates for R and packages?

2014-04-09 Thread Henrik Bengtsson
[Sounds like a question for R-devel] On Wed, Apr 9, 2014 at 5:02 AM, Tal Galili tal.gal...@gmail.com wrote: Hello all, I wish to add to the installrhttp://cran.r-project.org/web/packages/installr/package the ability to check for new versions of R once every X units of time (maybe once

Re: [R] flowDensity package

2014-04-09 Thread Martin Morgan
On 04/09/2014 07:23 AM, Raghu wrote: I am unable to install flowDensity package from bioconductor in R version 3.0 or 3.1. did anyone have the same problems with this. Please ask questions about Bioconductor packages on the Bioconductor mailing list

Re: [R] Meta-analysis of prevalence at the country level with mgcv/gamm4

2014-04-09 Thread Michael Dewey
At 09:31 08/04/2014, Julien Riou wrote: Dear R community, Comments in line below I'm working on a meta-analysis of prevalence data. The aim is to get estimates of prevalence at the country level. The main issue is that the disease is highly correlated with age, and the sample ages of

[R] Summing up realizations

2014-04-09 Thread Morway, Eric
Due in large part to my nonexistent statistics vocabulary, I'm not sure what the name is for the type of analysis I'm trying to do. I have, however, started to cobble something together (below) that is undoubtedly reinventing the wheel (i.e., someone has probably already written something to do

[R] logistical indexing in R

2014-04-09 Thread Si Qi L.
Dear mates, I am bit of stuck with a coding, all I have to do is to clean and tranform the missing data -97 of the attribute ej into a normal number value in a range from 0 to 22. My steps are : 1) first return the subsets, as check, they do sum to original 2) manipulate the attribute ej

Re: [R] Summing up realizations

2014-04-09 Thread Bert Gunter
Have you read An Introduction to R (or a web tutorial) to learn R? This looks straightforward, if I understand you correctly. ?sample and indexing operations might be all you need. Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 Data is not information. Information

Re: [R] Generate Crosstab in R

2014-04-09 Thread arun
Hi, Try: datNew - read.csv(customer_samples.csv,stringsAsFactors=FALSE) #I could reproduce similar error message with: dat[] - lapply(dat,as.factor)  dat1 - within(dat, Categ - ave(Product, Custom, FUN= function(x) if(length(x)1) A and B else x)) #Warning messages: 1: In

[R] Fractional multinomial logit model or similar in R for analysis of behavior?

2014-04-09 Thread Brian Battaile
I'm looking for a method to analyse behavior data that can be assigned to multiple categories as a proportion with all the categories adding to 1 and some explanatory variables and repeated measures on some individuals. Data would look something like this AnimalID Behavior1 Behavior2 Behavior3

[R] Memory allocation using .C interface

2014-04-09 Thread Cassiano dos Santos
I am testing a call to a C function from R, using .C interface. The test consists in passing a numeric vector to the C function with no entries, dynamically allocates n positions, makes attributions and return the vector to R. I'm using Calloc from R.h. The prototype of the function is type*

[R] illumina probeID to entrezID

2014-04-09 Thread Kripa R
Hi, how do you convert the illumina ProbeID to entrezID? I've used LIMMA to identify top genes but i'm not sure how to apply illuminaHumanv4.db to get the EntrezID. Thanks in advance, .kripa [[alternative HTML version deleted]]

Re: [R] Summing up realizations

2014-04-09 Thread Jeff Newmiller
You might be thinking of bootstrap analysis. Note that measures are often correlated, so beware of just introducing randomness one measure at a time. Discussions about background theory are not really R-specific, so further chatter about this would not be on topic here, but the term bootstrap

[R] Generate Binary Matrix

2014-04-09 Thread Doran, Harold
I am trying to generate a binary matrix where every row in the matrix is guaranteed to have at least one 1. Ideally, I would like most rowSums to be equal to 2 or 3 with some 1s and some 4s. But, rowSums cannot be equal to 0. I can tinker with the vector of probability weights, but in doing so

Re: [R] Generate Binary Matrix

2014-04-09 Thread ken knoblauch
Doran, Harold HDoran at air.org writes: I am trying to generate a binary matrix where row in the matrix is guaranteed to have at least one 1. Ideally, I would like most rowSums to be equal 2 or 3 with some 1s and some 4s. But, rowSums cannot be equal to 0. I can tinker with the

Re: [R] getting arg names in function calls?

2014-04-09 Thread Spencer Graves
Thanks very much to both Bill Dunlap and Hadley Wickham. Per Bill's second suggestion, match.call(eval(bo[[1]]), bo) returned the desired plot(x = 0, y = 1) [with bo - body(function()plot(0, 1)]. Hadley's standardise_call(bo) [from library(pryr)] is much simpler.

Re: [R] Generate Binary Matrix

2014-04-09 Thread Clint Bowman
A bit kludgey but how about: dimMat - matrix(0, 1000, 4) for(i in 1:1000){ while(sum(dimMat[i, ] - sample(c(0,1), 4, replace = TRUE, prob = c(.3, .7)))==0) dimMat[i, ] - sample(c(0,1), 4, replace = TRUE, prob = c(.3, .7)) } table(rowSums(dimMat)) Clint BowmanINTERNET:

Re: [R] Generate Binary Matrix

2014-04-09 Thread David Carlson
You could randomly assign 1 to a single column in each row and then use binomial draws on the remaining 0's: set.seed(42) dimMat - matrix(0, 1000, 4) dimMat[cbind(1:1000, sample.int(4, 1000, replace=TRUE))] - 1 dimMat[dimMat1] - sample(0:1, 3000, replace=TRUE, prob=c(.6, .4))

Re: [R] How to implement a recurring check for updates for R and packages?

2014-04-09 Thread Tal Galili
Thank you very much for the reply Henrik, you gave great pointers for me to look at. I am now curious about R.cache (although I am not sure it will help in my case, I'll need to look at it further). Also, I was debating if to use R-help or R-devel for this, since I was not sure from the

Re: [R] Memory allocation using .C interface

2014-04-09 Thread Peter Langfelder
On Wed, Apr 9, 2014 at 11:27 AM, Cassiano dos Santos crn...@gmail.com wrote: I am testing a call to a C function from R, using .C interface. The test consists in passing a numeric vector to the C function with no entries, dynamically allocates n positions, makes attributions and return the

Re: [R] Memory allocation using .C interface

2014-04-09 Thread Dirk Eddelbuettel
Cassiano dos Santos crns13 at gmail.com writes: I am testing a call to a C function from R, using .C interface. The test consists in passing a numeric vector to the C function with no entries, dynamically allocates n positions, makes attributions and return the vector to R. Asking on

Re: [R] Label axis tick marks with a simple function of axis value

2014-04-09 Thread Hurr
What we've covered so far is of great value. For a neater plot, the next step will be to learn how to put numbers with units at each tick mark. I suppose I can form the number-unit string myself in separate code and put the tickmark in a place that I calculate in separate code. But I need to

[R] simulation data

2014-04-09 Thread thanoon younis
hi i want to simulate multivariate dichotomous data matrix with categories (0,1) and n=1000 and p=10. thanks alot in advance [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Generate Crosstab in R

2014-04-09 Thread arun
Hi, Suppose your data is similar to below: dat - structure(list(Custom = c(Judi, Judi, Ben, Tom, Tom, Bill, Lindy, Shary, Judu, Judu, Billy, Tommy, Tommy, Benjum, Linda, Shiry, Shiry, Shiry, Judu, Billy, Tommy, Lindy), Gender = c(Female, Female, Male, Male, Male, Male, Female, Female, Female,

Re: [R] Label axis tick marks with a simple function of axis value

2014-04-09 Thread David Winsemius
On Apr 9, 2014, at 6:17 PM, Hurr wrote: What we've covered so far is of great value. For a neater plot, the next step will be to learn how to put numbers with units at each tick mark. I suppose I can form the number-unit string myself in separate code and put the tickmark in a place that

Re: [R] Fractional multinomial logit model or similar in R for analysis of behavior?

2014-04-09 Thread David Winsemius
On Apr 9, 2014, at 10:25 AM, Brian Battaile wrote: I'm looking for a method to analyse behavior data that can be assigned to multiple categories as a proportion with all the categories adding to 1 and some explanatory variables and repeated measures on some individuals. Maybe expanding your

[R] ggplot / ggmap: fixing geom_point size to break bins

2014-04-09 Thread Trevor Davies
Hello, I'm been playing around trying to get some maps working in ggplot ggmap. I have a series of maps I'm trying to make and I want to fix the bubble area size of banana catches to the specified breaks. I.e so banana catches of 2 will always be a specified size so when I make the next map,

Re: [R] simulation data

2014-04-09 Thread Rolf Turner
On 10/04/14 09:28, thanoon younis wrote: hi i want to simulate multivariate dichotomous data matrix with categories (0,1) and n=1000 and p=10. Nobody's stopping you! :-) cheers, Rolf Turner __ R-help@r-project.org mailing list