Re: [R] problem in R-code

2015-11-03 Thread Jim Lemon
Hi thanoon, The problem may lie in your definition of BZ (which I see Boris has also noticed). Given your code, it will be a vector containing 200 zeros. Your code will generate 200 ones as zero is less than 0.25. Try defining BZ as follows: BZ<-runif(200) You should get something more interestin

Re: [R] problem in R-code

2015-11-03 Thread Boris Steipe
Whatever - just type: W <- floor(BZ * 4) + 1 B. On Nov 3, 2015, at 11:09 PM, Boris Steipe wrote: > Are you telling me it contains only zeros? Or is it a vector of length zero? > > B. > > > On Nov 3, 2015, at 11:07 PM, thanoon younis > wrote: > >> BZ is hidden variable with zero values.

Re: [R] problem in R-code

2015-11-03 Thread Boris Steipe
Are you telling me it contains only zeros? Or is it a vector of length zero? B. On Nov 3, 2015, at 11:07 PM, thanoon younis wrote: > BZ is hidden variable with zero values. > > On 4 November 2015 at 07:02, Boris Steipe wrote: > Your approach does not make sense. > > If you initialize a vect

Re: [R] problem in R-code

2015-11-03 Thread Boris Steipe
Your approach does not make sense. If you initialize a vector as say ... BZ <- numeric(5) ... what do you _expect BZ contains? Also: if you run a loop like you do for (j in 1:1) { print(j) } ... what do you _expect_ will happen? B. On Nov 3, 2015, at 10:43 PM, thanoon younis wrote: >

Re: [R] R in UNIX OS

2015-11-03 Thread Eric Brown
Javier Villacampa González writes: is possilbe to install R in a AIX OS Machine? Where can I found the download files? Hi Javier, I tried to install on AIX using xlc/xlf and the native stack, but it did not work. In the bowels of Google, there are some patches proposed for the 2.x serie

Re: [R] problem in R-code

2015-11-03 Thread thanoon younis
Thank you for your response I have a vector of unknown values BZ which is defined already BZ=numeric(N) and i want to transfer BZ to ordered categorical variable with 4 categories W but when i write this code for(j in 1:1){ if(BZ[j] < 0.25){ W[j] = 1 }else if(BZ[j] >=0.25 &

Re: [R] problem in R-code

2015-11-03 Thread Boris Steipe
Sorry, not round. floor() B. On Nov 3, 2015, at 10:35 PM, Boris Steipe wrote: > Why don't you just multiply by four, round, and add one? > > > > B. > On Nov 3, 2015, at 10:02 PM, thanoon younis > wrote: > >> Dear R-users >> >> I have a problem in the code below, the problem is because i

Re: [R] problem in R-code

2015-11-03 Thread Boris Steipe
Why don't you just multiply by four, round, and add one? B. On Nov 3, 2015, at 10:02 PM, thanoon younis wrote: > Dear R-users > > I have a problem in the code below, the problem is because i want to change > the variable BZ which is a vector with 200x1 dimension to the var. W which > is categ

Re: [R] [FORGED] problem in R-code

2015-11-03 Thread Rolf Turner
I have not mustered the stamina to go through your code in detail, but it looks to me like the "1:1" constructions are typos and should perhaps be "1:N". Aside from that, I conjecture that what you want to accomplish could be very simply done with the cut() function. This is not entirely cl

[R] problem in R-code

2015-11-03 Thread thanoon younis
Dear R-users I have a problem in the code below, the problem is because i want to change the variable BZ which is a vector with 200x1 dimension to the var. W which is categorical variable with same dimension of BZ but with categorical values with 4 categories but i got on only zero values in w why

Re: [R] CRAN - Package "activity" - how do you convert time (hh:mm) into radians in R 3.1.2 on Windows 7 OS 64bit

2015-11-03 Thread Jim Lemon
Hi Typhenn, Have a look at clock24.plot in the plotrix package. Jim On Wed, Nov 4, 2015 at 9:00 AM, Typhenn Brichieri-Colombi via R-help < r-help@r-project.org> wrote: > Hello, > I am using the "activity" package developed by Marcus Rowcliffe (released > in February, 2015). This package uses ti

Re: [R] Working with Data Frames

2015-11-03 Thread Joshua Ulrich
On Tue, Nov 3, 2015 at 6:26 PM, Robert Sherry wrote: > I have created what I believe to be a data frame. It is called env1$SPY. It's not a data.frame. You can use str() to look at the *str*ucture of an object: R> str(env1$SPY) An ‘xts’ object on 1995-01-03/2015-11-02 containing: Data: num [1:

Re: [R] Working with Data Frames

2015-11-03 Thread Bert Gunter
Have you gone through any R tutorials? There are innumerable good ones on the web -- and one that ships with R (An Intro to R). Don't you think you should make an effort to learn some basics on your own before posting here? ... or do I misinterpret your question? (And if so, my apologies -- feel f

Re: [R] Working with Data Frames

2015-11-03 Thread Peter Alspach
Tena koe Robert Many times in R one can do things without a loop. In this case, see ?rle. You might also need to check substring or months depending on how you dates are stored. HTH Peter Alspach -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of

[R] Working with Data Frames

2015-11-03 Thread Robert Sherry
I have created what I believe to be a data frame. It is called env1$SPY. The r statement head( env1$SPY ) produces the following output: SPY.Open SPY.High SPY.Low SPY.Close SPY.Volume SPY.Adjusted 1995-01-03 45.7031 45.8437 45.6875 45.7812 324300 31.55312 1995-01-04 45.9843

Re: [R] CRAN - Package "activity" - how do you convert time (hh:mm) into radians in R 3.1.2 on Windows 7 OS 64bit

2015-11-03 Thread Bert Gunter
... should have said: with a 24 hour "clock". -- Bert Bert Gunter "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." -- Clifford Stoll On Tue, Nov 3, 2015 at 2:52 PM, Bert Gunter wrote: > Hint: 24 hours = 24x60 = 1440 minutes = 2 pi radians. > >

Re: [R] CRAN - Package "activity" - how do you convert time (hh:mm) into radians in R 3.1.2 on Windows 7 OS 64bit

2015-11-03 Thread Bert Gunter
Hint: 24 hours = 24x60 = 1440 minutes = 2 pi radians. Cheers, Bert Bert Gunter "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." -- Clifford Stoll On Tue, Nov 3, 2015 at 2:00 PM, Typhenn Brichieri-Colombi via R-help wrote: > Hello, > I am using

[R] CRAN - Package "activity" - how do you convert time (hh:mm) into radians in R 3.1.2 on Windows 7 OS 64bit

2015-11-03 Thread Typhenn Brichieri-Colombi via R-help
Hello, I am using the "activity" package developed by Marcus Rowcliffe (released in February, 2015). This package uses time in radians to estimate activity. I have camera trap data in 24 hour times (hh:mm) - how do I convert these into radians? (e.g. My time-of-detection at 19:44, how do I conve

Re: [R] R in UNIX OS

2015-11-03 Thread David Winsemius
> On Nov 3, 2015, at 7:10 AM, Loris Bennett wrote: > > Javier Villacampa González > writes: > >> Hello, >> >> I have a silly questions: >> >> is possilbe to install R in a AIX OS Machine? >> Where can I found the download files? >> >> Thank you in advance >> >> Javier > > It may be diffic

Re: [R] R in UNIX OS

2015-11-03 Thread Jeff Newmiller
You are in the hinterlands of operating systems. If you Google for R and AIX you should find an R-forge project that purports to offer some assistance, but I suspect that a copy of the R source code and the R Installation and Administration document will be your best friends. Your success will p

Re: [R] merging-binning data

2015-11-03 Thread Ista Zahn
Probably split(binDistance, test). Best, Ista On Tue, Nov 3, 2015 at 10:47 AM, Alaios via R-help wrote: > Dear all,I am not exactly sure on what is the proper name of what I am trying > to do. > I have a vector that looks like > binDistance >[,1] > [1,] 238.95162 > [2,] 143.0859

Re: [R] Color & pch functionalities in dotchart()

2015-11-03 Thread Bert Gunter
... and see also the "color specification" info in ?par as well as the linked ?palette. You may be wrapping around if yu have more categories than colors in your palette. -- Bert Bert Gunter "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." -- C

[R] merging-binning data

2015-11-03 Thread Alaios via R-help
Dear all,I am not exactly sure on what is the proper name of what I am trying to do. I have a vector that looks like  binDistance    [,1]  [1,] 238.95162  [2,] 143.08590  [3,]  88.50923  [4,] 177.67884  [5,] 277.54116  [6,] 342.94689  [7,] 241.60905  [8,] 177.81969  [9,] 211.25559 [10,] 27

Re: [R] Color & pch functionalities in dotchart()

2015-11-03 Thread Duncan Murdoch
On 03/11/2015 8:58 AM, GINGINS Simon wrote: Hi, I am currently building graphs using dochart(). I plotted the points in two different colors according to specific criteria from my dataset. Later, I decided to also give them different symbols, for easier reading if printed. I got quite a surpr

Re: [R] Color & pch functionalities in dotchart()

2015-11-03 Thread Bert Gunter
Look at your code! color was specified as "as.factor..." and pch was specifed as "..." (no as.factor() ) Read an R tutorial on how factors are coded for why this would make a difference. -- Bert Bert Gunter "Data is not information. Information is not knowledge. And knowledge is certainly not

Re: [R] replace NA's with row means for specific columns

2015-11-03 Thread David L Carlson
This should be a bit quicker since it just loops through the column blocks: > Zdf <- structure(list(ID = structure(1:4, .Label = c("b", "c", "d", + "e"), class = "factor"), A1 = c(4L, 4L, NA, 4L), A2 = c(5L, 5L, + 5L, 5L), A3 = c(NA, 1L, 1L, 4L), B1 = c(2L, NA, 1L, 5L), B2 = c(NA, + 3L, NA, NA)

Re: [R] R in UNIX OS

2015-11-03 Thread Loris Bennett
Javier Villacampa González writes: > Hello, > > I have a silly questions: > > is possilbe to install R in a AIX OS Machine? > Where can I found the download files? > > Thank you in advance > > Javier It may be difficult to find a version pre-packaged for AIX, but you can always compile R yoursel

[R] R in UNIX OS

2015-11-03 Thread Javier Villacampa González
Hello, I have a silly questions: is possilbe to install R in a AIX OS Machine? Where can I found the download files? Thank you in advance Javier -- [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE a

[R] Color & pch functionalities in dotchart()

2015-11-03 Thread GINGINS Simon
Hi, I am currently building graphs using dochart(). I plotted the points in two different colors according to specific criteria from my dataset. Later, I decided to also give them different symbols, for easier reading if printed. I got quite a surprise when I realized that, even though I gave t

[R] Package 'var' and standard errors for the impulse response coefficients?

2015-11-03 Thread Katja.Haavanlammi
Dear R-specialists, I'm using package 'vars' and especially irf-command for a basic VAR-model. How can I compute standard errors for the received impulse response coefficients? I've read that one option could be bootstrapped standard errors but I cannot find any information how to perform that