Re: [R] Count number of Fridays

2014-10-11 Thread Abhinaba Roy
Thanks Jim :) Regards Abhinaba On Fri, Oct 10, 2014 at 9:02 PM, jim holtman jholt...@gmail.com wrote: Here is one way of doing it: require(lubridate) now - as.Date('2014-10-10') # some date # get first of month first_mon - now - day(now) + 1 # create sequence of days in the month

[R] Problem Invoking System Commands from R

2014-10-11 Thread Matt Borkowski
Hello, First please keep in mind I am not a programmer and know very little about R. I am running the 64bit version of R on a Windows 8.1 machine. I am trying to run a script (which I have successfully run in the past) to download some weather data from a NOAA ftp site. When I attempt to run

Re: [R] Problem Invoking System Commands from R

2014-10-11 Thread Prof Brian Ripley
Please do follow the posting guide and not sent HTML: it gets mangled. There are two issues here: 1) Paths. Use Sys.which(wget) to see if the command is on your path. I suspect it is not, and you need to set the path when running R in the same way as is done for your shell. Compare the

[R] complain about a[-integer(0)]

2014-10-11 Thread PO SU
Dear helpeRs,     let a - 1:10     let b - integer(0) first, then i will randomly write a integer differently in the range(1,10)  or NULL into b. for supposed 5 times.    then i want to get a[-b],that means i not want the values at index b.     if any time of  5 times generate a integer, it

Re: [R] complain about a[-integer(0)]

2014-10-11 Thread Jim Lemon
On Sat, 11 Oct 2014 05:25:14 PM PO SU wrote: Dear helpeRs, let a - 1:10 let b - integer(0) first, then i will randomly write a integer differently in the range(1,10) or NULL into b. for supposed 5 times. then i want to get a[-b],that means i not want the values at index b. if any

Re: [R] complain about a[-integer(0)]

2014-10-11 Thread PO SU
Tks, i have to do it. -- PO SU mail: desolato...@163.com Majored in Statistics from SJTU At 2014-10-11 17:57:40, Jim Lemon j...@bitwrit.com.au wrote: On Sat, 11 Oct 2014 05:25:14 PM PO SU wrote: Dear helpeRs, let a - 1:10 let b - integer(0) first, then i will randomly write

Re: [R] complain about a[-integer(0)]

2014-10-11 Thread Jeff Newmiller
I don't understand what you think it should actually return. As for why it should behave the way it does now... hmmm, keep in mind that each sub-expression needs to make sense as well. Consider -integer(0)... applying the unary negation operator to a vector of integers yields a new vector of

Re: [R] Problem Invoking System Commands from R

2014-10-11 Thread Matt Borkowski
I appreciate the feedback. 1) The paths are properly set...I only wonder if the spaces in the path to wget.exe are problematic for R. The full path (C:\\Program Files (x86)\\GnuWin32\\bin) is properly included in the return list for Sys.getenv(PATH). Sys.which(wget) returns:

[R] xts array in minutes ?

2014-10-11 Thread ce
Dear all, I want to convert to character arrays 2014-10:10 00:00:00 and 2014-10-10:23:59:00 to an array of minutes : 2014-10:10 00:00:00 2014-10:10 00:01:00 2014-10:10 00:02:00 What is the best way to do it ? thanks __ R-help@r-project.org mailing

Re: [R] xts array in minutes ?

2014-10-11 Thread John McKown
On Sat, Oct 11, 2014 at 11:03 AM, ce zadi...@excite.com wrote: Dear all, I want to convert to character arrays 2014-10:10 00:00:00 and 2014-10-10:23:59:00 to an array of minutes : 2014-10:10 00:00:00 2014-10:10 00:01:00 2014-10:10 00:02:00 What is the best way to do it ? thanks

Re: [R] xts array in minutes ?

2014-10-11 Thread ce
that's very good , thanks. -Original Message- From: John McKown [john.archie.mck...@gmail.com] Date: 10/11/2014 12:20 PM To: ce zadi...@excite.com CC: r-help r-help@r-project.org Subject: Re: [R] xts array in minutes ? On Sat, Oct 11, 2014 at 11:03 AM, ce zadi...@excite.com wrote:

[R] understanding the no-label concept

2014-10-11 Thread moonkid
I am new to R but a bit familiar with Stata and SPSS and a software dev. As I understand it right, there is no possibility to give variables or values a lable. Is that right? Just for example. x need a name. And the four values (1, 2, 3, 4) need it to. [code] table(x) 1 2 3 4 17 6 6 2

Re: [R] understanding the no-label concept

2014-10-11 Thread Richard M. Heiberger
It looks like a terminology issue. R has names for elements of a vector and for rows and columns of a matrix or data.frame, and more generally for all dimensions of multi-dimensional array. I think your next step is to read the introductory document. Start with either of these (they are the same

Re: [R] understanding the no-label concept

2014-10-11 Thread Bert Gunter
No, you are wrong. Read the docs! -- start with An Introduction to R which ships with R. Please do not post further until after you have done your homework. x - c(a=1,b=2,c=3) See also ?names. Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 Data is not

Re: [R] errors in initial values in R2winBUGS

2014-10-11 Thread Uwe Ligges
On 11.10.2014 06:09, thanoon younis wrote: Dear all R users I am trying to find the bayesian analysis using R2winBUGS but i have errors in initial values with two groups. the R-code #Initial values for the MCMC in WinBUGS init1-list(uby1=rep(0.0,10),lam1=c(0.0,0.0,0.0,0.0,0.0,0.0),

Re: [R] understanding the no-label concept

2014-10-11 Thread David Winsemius
On Oct 11, 2014, at 1:04 PM, Richard M. Heiberger wrote: It looks like a terminology issue. R has names for elements of a vector and for rows and columns of a matrix or data.frame, and more generally for all dimensions of multi-dimensional array. I think your next step is to read the

Re: [R] understanding the no-label concept

2014-10-11 Thread William Dunlap
You can use 'factors' to assign labels to small integer values. E.g., x - c(1,2,3,4,3) fx - factor(x, levels=1:5, labels=c(One,Two,Three,Four,Five)) table(fx) fx One Two Three Four Five 1 1 2 1 0 Bill Dunlap TIBCO Software wdunlap tibco.com On

Re: [R] errors in initial values in R2winBUGS

2014-10-11 Thread Daniel Miquelluti
You are separating the objects using commas, the correct should be semicolons. Example: xi1=matrix(data=rep(0.0,600),ncol=3);xi2=matrix(data=rep(0.0,600),ncol=3)) Best regards, Daniel Miquelluti Em S�bado, 11 de Outubro de 2014 18:06, Uwe Ligges lig...@statistik.tu-dortmund.de escreveu:

[R] Help with caret, please

2014-10-11 Thread Iván Vallés Pérez
Hello, I am using caret package in order to train a K-Nearest Neigbors algorithm. For this, I am running this code: Control - trainControl(method=cv, summaryFunction=twoClassSummary, classProb=T) tGrid=data.frame(k=1:100) trainingInfo - train(Formula, data=trainData, method =

Re: [R] Help with caret, please

2014-10-11 Thread Max Kuhn
What you are asking is a bad idea on multiple levels. You will grossly over-estimate the area under the ROC curve. Consider the 1-NN model: you will have perfect predictions every time. To do this, you will need to run train again and modify the index and indexOut objects: library(caret)