[R] what is Non-numeric argument to mathematical function in prediction ?

2012-05-05 Thread kiinalist
Hi, I tried to use naivebayes in package 'e1071'. when I use following parameter, only one predictor, there is an error. m - naiveBayes(iris[,1], iris[,5]) table(predict(m, iris[,1]), iris[,5]) Error in log(sapply(attribs, function(v) { : Non-numeric argument to mathematical function

Re: [R] Breaking up a Row in R (transpose)

2012-05-05 Thread Rui Barradas
Ok, I think I've got it this time. The problem was that you have two different types of data in the same data structure, the first row are the result's column names, then the actual numeric data. First, in what follows I've called your data.frame 'df1', df1 - structure(list(A2 = structure(c(9L,

Re: [R] Can't import this 4GB DATASET

2012-05-05 Thread iliketurtles
Your code works! strangelines.txt was created, and it's a text file with just spacebars ... Seems like a few thousand lines of complete blanks (not 1 non-blank entry). One thing, when I ran your code there was an error message; setwd(C:/Users/admin/Desktop/hons/Thesis) con - file(dataset.txt,

[R] Weired location of points on MA plot?

2012-05-05 Thread ali_protocol
Dear all, I have a MA plot for replicate single channnel arrays, the loess curve is aligned to M=0. However, I expect that M values be as close as possible to M=0 for replicate arrays, which is not the case. How may I obtain a measure that indicates the average distance of points to M=0?

Re: [R] France Model

2012-05-05 Thread Sven Garbade
Given your starting values, there is nothing to optimize: f - function(x, A=10, b=152, T=100, c=100) A*(1-exp(-b*(x-T) - c*(sqrt(x) - sqrt(T f(time) [1] -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf [16] -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf

[R] Correct use of ddply with own function

2012-05-05 Thread Johannes Radinger
Hi, I am really confused how ddply work, so maybe you can help me. I created a function that sorts a vector etc. fn - function(x){ x1 - sort(x) x2 - seq(length(x)) x3 - x2/max(x2) df - data.frame(x1,x2,x3) df } Probably this is not the best form of the

Re: [R] what is Non-numeric argument to mathematical function in prediction ?

2012-05-05 Thread Petr Savicky
On Sat, May 05, 2012 at 09:21:10AM +0300, kiinalist wrote: Hi, I tried to use naivebayes in package 'e1071'. when I use following parameter, only one predictor, there is an error. m - naiveBayes(iris[,1], iris[,5]) table(predict(m, iris[,1]), iris[,5]) Error in log(sapply(attribs,

Re: [R] Correct use of ddply with own function

2012-05-05 Thread Tal Galili
Hi Johannes , Try this: var1 - rep(c(a,b),c(100,100)) var2 - runif(200,1,50) df.test - data.frame(var1,var2) fn - function(x){ x - x$var2 x1 - sort(x) x2 - seq(length(x)) x3 - x2/max(x2) df - data.frame(x1,x2,x3) df } require(plyr)

[R] Luis Miguel Delgado Gomez/BBK está ausente de la oficina.

2012-05-05 Thread Luis Miguel Delgado Gomez
Estaré ausente de la oficina desde el 04/05/2012 y no volveré hasta el 14/05/2012. Responderé a su mensaje cuando regrese. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] Panel MNP

2012-05-05 Thread Rajesh Paleti
Hi All, Can the MNP package available in R be used to analyze panel data as well? *i.e., *if there are 3 observed discrete choices for three time periods for the same individual , can i estimate a panel multinomial probit model which allows correlated errors across time periods and individual

Re: [R] Can't import this 4GB DATASET

2012-05-05 Thread Jan van der Laan
Perhaps you could contact the persons that supplied/created the file and ask them what the format of the file exactly is. That is probably the safest thing to do. If you are sure that the lines containing only whitespace are meaningless, then you could alter the previous code to make a copy

Re: [R] lme or lmer for unbalance data

2012-05-05 Thread Ben Bolker
agent dunham crosspide at hotmail.com writes: I'd like to fix a mixed model. I have unbalance data, what should i use: lme in nlme package , or lmer in lme4. Thanks, user at host.com as user at host.com More advanced mixed model questions belong on r-sig-mixed-models at r-project.org ,

Re: [R] R crash when i'm using lme function

2012-05-05 Thread Ben Bolker
gaiarrido gaiarrido at usal.es writes: When I try to adjust a mixed model with random effects I can make this order without problem lm.FA-lme(absFA~trait*condition,random=~1|individual) But if I try to fit a model in which the response (absFA) is not the same in all individuals at

Re: [R] Textwrangler Languages Folder

2012-05-05 Thread David Winsemius
On Dec 10, 2010, at 9:27 AM, Scott Chamberlain wrote: Dear R Community, I recently switched to a Mac (10.6.5), and have installed Textwrangler to run code to R. However, I can't install the syntax highlighting file because I can't find the directory: ~Users/username/Library/Application

Re: [R] Finding local maxima on a loess surface

2012-05-05 Thread David Winsemius
On May 4, 2012, at 3:00 PM, Diego Rojas wrote: Thanks, I know about it but i wat to find several local maxima, so in other words I need a way to identify the places in the surface where both slopes are equal to 0 and the second derivative is negative. There is no way that I know that

Re: [R] Cannot read or write to file in Linux Ubuntu

2012-05-05 Thread John Kane
Relative paths are not a mystery nor are they solely an aspect of linux. They are in fact the norm in DOS and Windows as well as in Linux or any other file system that use a tree structure. Oh, is that all! I just never thought of that behaviour as 'relative paths' just as something that one

Re: [R] Off-Topic: Crime Statistics Don't Pay

2012-05-05 Thread John Kane
And you don't want to know about some of the other problems with the FBI’s Uniform Crime Reports. IRRC, they are fine for what the FBI intended but a lot of reseachers don't read the data descriptions as closely as they should. John Kane Kingston ON Canada -Original Message- From:

Re: [R] Off-Topic: Crime Statistics Don't Pay

2012-05-05 Thread John Kane
And you don't want to know about some of the other problems with the FBI’s Uniform Crime Reports. IRRC, they are fine for what the FBI intended but a lot of reseachers don't read the data descriptions as closely as they should. John Kane Kingston ON Canada -Original Message- From:

Re: [R] estimation problem

2012-05-05 Thread David Winsemius
On May 4, 2012, at 4:22 PM, Petr Savicky wrote: On Fri, May 04, 2012 at 07:43:32PM +0200, Kehl Dániel wrote: Dear Petr, thank you for your input. I tried to experiment with (probably somewhat biased) truncated means like in the following code. How I got the 225 as a truncation limit is a

Re: [R] weird predict function error when I use naive bayes

2012-05-05 Thread Uwe Ligges
On 04.05.2012 13:54, kiinalist wrote: Hi, I tried to use naivebayes in package 'e1071'. when I use following parameter, only one predictor, there is an error. m- naiveBayes(iris[,1], iris[,5]) table(predict(m, iris[,1]), iris[,5]) Error in log(sapply(attribs, function(v) { : Non-numeric

Re: [R] Absolute cumulative curve with ecdf/stepfun?

2012-05-05 Thread Uwe Ligges
On 04.05.2012 14:34, Johannes Radinger wrote: Hi, I have two variables ranging both from 0 to 1 (n=500 each). Now I am interested in plotting them both in one plot (using ggplot2). So far I used ecdf() (from an example I found with google) to get values for the cumulatice distribution

Re: [R] Help with getting values from string

2012-05-05 Thread Uwe Ligges
On 03.05.2012 12:39, renu.s7 wrote: Hi All, I have a doubt. I used macros and i try to pass a value to a macro by concatenating a bunch of strings. But it does not seem to work. Please help. I have written down my code and the error message please tell me how to pass the value that a string

[R] Getting predicted values from a zero-inflated negative binomial using zeroinfl()

2012-05-05 Thread Christopher Desjardins
Hi, I am a little confused at the output from predict() for a zeroinfl object. Here's my confusion: ## From zeroinfl package fm_zinb2 - zeroinfl(art ~ . | ., data = bioChemists, dist = negbin) ## The raw zero-inflated overdispersed data table(bioChemists$art) 0 1 2 3 4 5 6 7

[R] alarm() doesn't beep

2012-05-05 Thread Liviu Andronic
Dear all I'd like to make a beeping sound in R, but alarm() doesn't beep? I checked ?alarm but I couldn't find any pointers to system configuration. Any ideas? Regards Liviu sessionInfo() R version 2.14.2 (2012-02-29) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8

Re: [R] alarm() doesn't beep

2012-05-05 Thread R. Michael Weylandt
It doesn't seem to be super robust and might depend on how you are running R: for me (OS X 10.6), I get the beep at the terminal and in the R.app GUI, but not within RStudio. Michael On Sat, May 5, 2012 at 2:12 PM, Liviu Andronic landronim...@gmail.com wrote: Dear all I'd like to make a

Re: [R] alarm() doesn't beep

2012-05-05 Thread David Winsemius
Liviu; Is there a command you could call with system()? -- David. On May 5, 2012, at 2:12 PM, Liviu Andronic wrote: Dear all I'd like to make a beeping sound in R, but alarm() doesn't beep? I checked ?alarm but I couldn't find any pointers to system configuration. Any ideas? Regards Liviu

[R] something weird in integration (pracma library)

2012-05-05 Thread casperyc
Hi, library(pracma) k=20 mu=4.5 casigma=17000 myint=function(j) { quadinf(function(x) (1/(1+exp(-x)))^j*(1-1/(1+exp(-x)))^(k-j)*dnorm(x,mu,casigma),-Inf,Inf) } sapply(0:k,myint)

[R] [R-pkgs] ROCR source code now available on github

2012-05-05 Thread Tobias Sing
Dear all, the commented source code for the ROCR package (http://cran.r-project.org/web/packages/ROCR) is now available on github -- feel free to fork, add improvements, and contribute back! https://github.com/ipa-tys/ROCR Kind regards, Tobias ___

[R] No error message no display output

2012-05-05 Thread Trying To learn again
Hi all, I´m re-starting (as my name indicates) my little knowlegde of CRAN R. I made this function time before but I don´t know where is the error because nothing appears as an error but the histogram plot doesn´t appear. Should I install some special library to run sapply? pru-function(){

Re: [R] No error message no display output

2012-05-05 Thread Trying To learn again
I´m using this version of R R version 2.13.2 (2011-09-30) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i386-pc-mingw32/i386 (32-bit) 2012/5/5 Trying To learn again tryingtolearnag...@gmail.com Hi all, I´m re-starting (as my name indicates) my

Re: [R] alarm() doesn't beep

2012-05-05 Thread Liviu Andronic
On Sat, May 5, 2012 at 8:34 PM, David Winsemius dwinsem...@comcast.net wrote: Is there a command you could call with system()? Yes. Something like: system(play /tmp/02Canon.mp3) works jsut fine. But I was curious about alarm(). Liviu __

[R] Editor to program with CRAN R

2012-05-05 Thread Trying To learn again
Hi all, I´m using the windows writting pad (not Notepad the simplest version). I think there should be greater and helping note pads to help programming. Can you suggest one? Many thanks [[alternative HTML version deleted]] __

[R] metafor

2012-05-05 Thread Jin Choi
Dear users of metafor, I am working on a meta-analysis using the metafor package. I have a excel csv database that I am working with. I am interested in pooling the effect measures for a particular subgroup (European women) in this csv database. I am conducting both sub-group and meta-regression.

Re: [R] Editor to program with CRAN R

2012-05-05 Thread R. Michael Weylandt
There's a huge spectrum -- all the way from Vim / Emacs to notepad: one that's designed with R in mind (though much heavier than notepad) is RStudio, which is proving pretty popular in the R community: http://rstudio.org/ If you get into more programming, it might be worth it to adopt a general

[R] Pasting with Quotes

2012-05-05 Thread Josh Browning
Hello useRs! So, I have a random question. I'm trying to build a character string, then evaluate it. I think an example would be the easiest way to explain: kern.vec = c(rbfdot,polydot) for( j in 1:length( kern.vec ) ) { formula= paste(ksvm( ind ~ . ,

Re: [R] Editor to program with CRAN R

2012-05-05 Thread Joshua Wiley
There are many, off the top of my head: --Emacs + ESS (what I use). You can get them separately or combined from: http://vgoulet.act.ulaval.ca/en/emacs/ --RStudio --Vim --Eclipse + StatEt Most of those work on different (all?) platforms. Cheers, Josh On Sat, May 5, 2012 at 8:34 AM, Trying To

Re: [R] No error message no display output

2012-05-05 Thread Uwe Ligges
1. You need to call the function pru() after defining it. 2. Next excercise will be to get rid of all those loops. 3. Next excercide will be to reutn something useful from your function (rather than printing). 4. Upgrade to a recent version of R. Uwe Ligges On 05.05.2012 17:31, Trying

Re: [R] Editor to program with CRAN R

2012-05-05 Thread Uwe Ligges
Or more generally, see the overview page at: http://www.sciviews.org/_rgui/projects/Editors.html Uwe Ligges On 05.05.2012 20:44, R. Michael Weylandt wrote: There's a huge spectrum -- all the way from Vim / Emacs to notepad: one that's designed with R in mind (though much heavier than

Re: [R] Pasting with Quotes

2012-05-05 Thread R. Michael Weylandt
What's the big picture of what you're trying to do? eval(parse(text = )) is often a less than optimal idea. Some guesses: Are you trying to construct a formula object (in the strict sense of something that you pass to a modeling function)? Maybe lazy evaluation of the deparse(substitute(x))

Re: [R] Editor to program with CRAN R

2012-05-05 Thread Leandro Marino
I think that if you're not familiar with emacs or vim I suggest you to use RStudio. If you're a programmer that knows how to use eclipse I think eclipse with statet it will be the best solution. Another option that you have is the notepad + + with NppToR plugin Best, Att, Leandro Marino --

Re: [R] alarm() doesn't beep

2012-05-05 Thread Jeff Newmiller
The alarm() function just sends a ctrl-g (ASCII BEL character) to the console terminal. If the terminal type recognizes this byte according to that interpretation, and it is not locally configured to disable sound, then you should hear an audible alert. Linux consoles typically do handle this.

Re: [R] Pasting with Quotes

2012-05-05 Thread David Winsemius
On May 5, 2012, at 2:42 PM, Josh Browning wrote: Hello useRs! So, I have a random question. I'm trying to build a character string, then evaluate it. Actually you are trying to build a language object , a call or an expression. You might have gotten further with: do.call(ksvm, list(

[R] penalized quantile regression (rq.fit.lasso)

2012-05-05 Thread Yuanyuan Tang
Dear all: I have a question about how to get the optimal estimate of coefficients using the penalized quantile regression (LASSO penalty in quantile regression defined in Koenker 2005). In R, I found both rq(y ~ x, method=lasso,lambda = 30) and rq.fit.lasso(x, y, tau = 0.5, lambda = 1, beta =

[R] Query about memory used in list and dataframe

2012-05-05 Thread Shivam
Hi, I had a query regarding which object, a list or a dataframe, consumes more R memory. Let me clarify this: For example, I have a df of 6 rows and 12 columns, say 'test'. I do object.size() and find it uses 3.3 KB of memory. I run a loop and make a list, say 'testlist', of 6 elements, each

[R] download extremely slow

2012-05-05 Thread Hillary Sardiñas
I have been trying to download the latest version to my Macbook X version 10.6.8 from my institutions mirror http://cran.cnr.Berkeley.edu Usually is only takes minutes, but regardless of the browser or where I connect to the internet I have been unable to download because it would take upwards 2

[R] No Data in randomForest predict

2012-05-05 Thread Jennifer Corcoran
I would like to ask a general question about the randomForest predict function and how it handles No Data values. I understand that you can omit No Data values while developing the randomForest object, but how does it handle No Data in the prediction phase? I would like the output to be NA if

[R] c() in Mac does not work

2012-05-05 Thread E Kim
I recently changed to Mac OS X 10.7.3 from Windows and this simple function is giving errors. c(4,7,7) Error in c(4, 7, 7) : unused argument(s) (7) c(1,7:9) Error in d[i, ] : incorrect number of dimensions c(1:5, 10.5, next) Error in c(1:5, 10.5, next) : unused argument(s) (next) c(1,2)

Re: [R] creating a new column assigning values of other columns

2012-05-05 Thread R. Michael Weylandt
Ba -- far too much work to recreate (and I don't think you sent us the file act.lig): here's a much better route: Go to the step immediately before you're in trouble and use dput() on your data. R will print out a nice plaintext representation that we can copy and paste and reproduce

Re: [R] c() in Mac does not work

2012-05-05 Thread Joshua Wiley
Hi, My best guess is that the c() you want to be calling is not the c() you are calling. This can happen if it is masked by a function definition in you global environment or in a package you load. What happens when you type: c at the console? Also, from one of your sessions where it , c(),

Re: [R] download extremely slow

2012-05-05 Thread R. Michael Weylandt
Hmmm, I know it might seem counterintuitive, but try a different mirror -- I seem to remember some complaints about the Berkeley mirror being slow a few weeks back (though I don't have physical evidence thereof so I apologize for any accidental slander to the Berkeley mirrorers) -- perhaps UCLA?

Re: [R] download extremely slow

2012-05-05 Thread Henrik Bengtsson
On Sat, May 5, 2012 at 2:10 PM, Hillary Sardiñas herongr...@gmail.com wrote: I have been trying to download the latest version to my Macbook X version 10.6.8 from my institutions mirror http://cran.cnr.Berkeley.edu Usually is only takes minutes, but regardless of the browser or where I connect

Re: [R] c() in Mac does not work

2012-05-05 Thread R. Michael Weylandt
My guess is that somewhere you've accidentally redefined c to be another function. Try this: Open the Terminal and type R --vanilla this will start R totally clean and then try c(4,7,7) c(1, 7:9) I bet your issues go away. If that's the case, you can probably fix things by clearing your old

Re: [R] download extremely slow

2012-05-05 Thread Joshua Wiley
Does CNR ring any bells as a department at Berkeley?The UCLA mirror is hosted by the statistics department (cran.stat.ucla.edu) so I am guessing your local mirror is hosted by the CNR department, and they are probably the people to inform their system is running very slowly. Maybe the server

[R] correlation between XY coordinates

2012-05-05 Thread Christopher Kurby
Hello r world, Does anyone know a function or package that can compute correlations between sets of XY coordinates? Thanks in advance for your help, Chris __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] c() in Mac does not work

2012-05-05 Thread Richard M. Heiberger
almost certainly you restored an old workspace with a conflicting definition of the c function. type c to confirm, also type conflicts(detail=TRUE) The repair is to remove the conflicting definition rm(c) The long term solution is to adopt the recommended practice of not saving your

Re: [R] Query about memory used in list and dataframe

2012-05-05 Thread jim holtman
I think you really have to show use your exact code that you did along with an 'str' of each intermediate data structure since my quick test does not bear out what you were saying: test.df - data.frame(a1= 1:6, a2= 1:6, a3 = 1:6, a4 = 1:6, a5 = 1:6, a6 = 1:6 + , a7=1:6, a8 = 1:6, a9 = 1:6,

Re: [R] download extremely slow

2012-05-05 Thread Jeff Newmiller
I have been having problems getting recent packages from Berkeley for Windows and Linux, so I have had to change to UCLA anyway. --- Jeff NewmillerThe . . Go Live...

Re: [R] correlation between XY coordinates

2012-05-05 Thread Jeff Newmiller
Isn't that one of the main things base R is used for? Maybe your question is not specific enough. Can you provide some sample data and your best estimate of what the result should look like? The Posting Guide mentioned below could help you elicit more effective answers.

Re: [R] correlation between XY coordinates

2012-05-05 Thread Joshua Wiley
Hi Chris, As Jeff mentioned, it is hard to tell what you want (correlations between sets of coordinates could mean many things it seems like to me), but here is something that perhaps helps: ## some data (usually nice if you provide this rather than us having to make something up) d1 - cbind(x -