[R] How to read this data properly?

2012-03-03 Thread Bogaso Christofer
Dear all, I have been given a data something like below: Dat = 2 3 28.3 3.05 8 3 3 22.5 1.55 0 1 1 26.0 2.30 9 3 3 24.8 2.10 0 3 3 26.0 2.60 4 2 3 23.8 2.10 0 3 2 24.7 1.90 0 2 1 23.7 1.95 0 3 3 25.6 2.15 0 3 3 24.3 2.15 0 2 3 25.8 2.65 0 2 3 28.2 3.05 11 4 2 21.0 1.85 0 2 1 26.0 2.30 14 1

[R] Shape manipulation

2012-03-03 Thread Bogaso Christofer
Hi all, let say I have following matrix: Dat - matrix(1:30, 5, 6); colnames(Dat) - rep(c(Name1, Names2), 3) Dat Name1 Names2 Name1 Names2 Name1 Names2 [1,] 1 611 1621 26 [2,] 2 712 1722 27 [3,] 3 813 1823 28

[R] Running R with browser without installing anything

2011-10-20 Thread Bogaso Christofer
Dear all, the company I work for has Matlab installed for statistical/mathematical calculations and really not ready to go with R (even installing exe file for R). Therefore I was wondering is it possible to do analysis R using browser like IE, without installing anything? Thanks for your

[R] Editor for RD file?

2011-10-16 Thread Bogaso Christofer
Dear all, can somebody please update me on what could be the best editor to write and edit the RD files? I need to something with syntax highlighter, auto-completion etc (like Notepad++ for R etc.). Currently I am using plain Notepad however expect something which could be more professional.

[R] Finding solution

2011-10-09 Thread Bogaso Christofer
Dear all, I have a system of simultaneous equations with 2 unknowns as follows: x*y + (1-x) = 0.05 x*(y - .5)^2 + (1-x)*0.6 = 0.56^2 Ofcourse I can do it manually however wondering whether there is any direct way in R available to get the solution of this system? Thanks and regards,

[R] Looking for internal of a function

2011-09-29 Thread Bogaso Christofer
Dear all, when I look at the internal of mapply() function, I see a line of code: answer - .Call(do_mapply, FUN, dots, MoreArgs, environment(), PACKAGE = base) Can somebody please tell me how to find the source code of 'do_mapply' Thanks, [[alternative HTML version

[R] FW: ARIMA - Skipping intermediate lags

2011-09-23 Thread Bogaso Christofer
Sorry that forgot to put R-forum in the loop... -Original Message- From: Bogaso Christofer [mailto:bogaso.christo...@gmail.com] Sent: 23 September 2011 22:53 To: 'Prof Brian Ripley' Cc: 'leighton155' Subject: RE: [R] ARIMA - Skipping intermediate lags Dear Prof. Ripley

Re: [R] ARIMA - Skipping intermediate lags

2011-09-22 Thread Bogaso Christofer
Dear Prof. Repley, may I know in details why ignoring intermediate lags are sin? How the statistical properties will be worse than not ignoring them? If I am correct then, ignoring some parameters means we know the population values for them. Therefore in this case, my MSE estimate should be

Re: [R] p values greater than 1 from lme4

2011-09-06 Thread Bogaso Christofer
Hello Bolker, Hope you will make available at least the problem and reasoning to this list. I am also very much interested to see the problem -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Ben Bolker Sent: 06 September 2011 02:58

[R] 'install package(s) from local zip files': what is the syntax for that?

2011-08-20 Thread Bogaso Christofer
Dear all, if I want to install a package in windows system then generally I use the 'install package(s) from local zip files' from the 'package' menu. However I am interested to know that whether there is any syntax which I can use in the R console instead. I have tried with

[R] Indexing problem with matrix

2011-07-22 Thread Bogaso Christofer
Dear all, assume I have a matrix with just 1 row. Now suppose I want to fetch 1st few rows from that matrix, however resulting object becomes vector. Here is 1 such example: matrix(1:5, 1) [,1] [,2] [,3] [,4] [,5] [1,]12345 matrix(1:5, 1)[,-1] [1] 2 3 4 5

Re: [R] Indexing problem with matrix

2011-07-22 Thread Bogaso Christofer
Thanks Joshua and Berton for your pointers. Yes it was typo as I wanted to mean to select few columns. -Original Message- From: Joshua Wiley [mailto:jwiley.ps...@gmail.com] Sent: 22 July 2011 22:02 To: Bogaso Christofer Cc: r-help@r-project.org Subject: Re: [R] Indexing problem

[R] Printing the loop number for each iteration

2011-07-21 Thread Bogaso Christofer
Hi all, I have a lengthy 'for' loop and for each loop I want to track the iteration number that is currently going on. For this, I have tried following: for (i in 1:10) { + DumDat - rnorm(1000) + cat(iteration:, i, \n) + } iteration: 1 iteration: 2 iteration: 3 iteration: 4

[R] Problem in installing rJava from source

2011-07-15 Thread Bogaso Christofer
Hi all, I was trying to install rJava package (some older version) from source. However could not achieve using Rcmd build -binary rJava syntax with windows cmd. The building process stopped with following error: ERROR* JavaSoft\{JRE|JDK} can't open registry keys. ERROR: cannot find Java

[R] Working with string

2011-07-07 Thread Bogaso Christofer
Hi there, I have to extract some relevant portion from a defined string, which is a mix of numeric and character. However this has following sequence: Some String - Some numerical - c/C (or p/P) - then again some set of numbers. Examples of such string is fdahsdfcha163517253c463278643 or

Re: [R] Working with string

2011-07-07 Thread Bogaso Christofer
2011 21:54 To: Bogaso Christofer Cc: r-help@r-project.org Subject: Re: [R] Working with string On Jul 7, 2011, at 11:21 AM, Bogaso Christofer wrote: Hi there, I have to extract some relevant portion from a defined string, which is a mix of numeric and character. However this has following

[R] Seeking help to define method for show() for an S4 object

2011-06-06 Thread Bogaso Christofer
Dear all, I have created a new S4 class with name MyClass. Please see below for it's definition. Now I want to create a method for the show() function for this class. In defining this method, what I want is, once user would like see an object of this class some values will be displayed. Then R

Re: [R] Normality test

2011-05-29 Thread Bogaso Christofer
Hi Greg, please forgive me as I could not understand one part of your wishful reply. You said: distributions where one is uniform between 0 and 1 with height 1; the other also has height 1 between 0 and 0.99, but is also 1 between 999.99 and 1000, zero elsewhere. Can you be more specific on this

[R] Putting x-axis in opposite order

2011-04-28 Thread Bogaso Christofer
Hi all, please consider this plot: xx - seq(4, 0.01, by = -0.04) yy - rnorm(xx) plot(xx, yy, type=l) Here you see my original 'xx' was in decreasing order, however R puts it in the increasing order. I understand that in any plot x and y axis grow is increasing order, however I am

[R] Question on list object

2011-04-27 Thread Bogaso Christofer
Dear all, let say, I have following list object: listObj - vector(list, length = 3) listObj[[1]] - rnorm(3) listObj[[2]] - rnorm(4) listObj[[3]] - rnorm(5) Now I want to convert above list into a Matrix. Ofcourse I can do it using Reduce(rbind, listObj). However as you notice that as

[R] Undestanding return()

2011-04-26 Thread Bogaso Christofer
Here, I have following generic function: Fn1 - function(x) { return(x) # assume x is calculated in previous steps . return(y) # assume y is calculated in previous steps ..

[R] Reducing dimension of a list object

2011-04-19 Thread Bogaso Christofer
Hi all, I generally use the Reduce() function to reduce the dimension of list object. However in my current session I have few objects which are actually list of list of list..(say n step). If I reduce their dimension then I have call Reduce() function many times. Therefore my question is, is

[R] An extention of outer() ?

2011-04-07 Thread Bogaso Christofer
Dear all, as per my understanding, outer() function is to facilitate 2-dimensional function evaluation, like to evaluate f(x,y) for different values of x and y. However I have slightly modified version of that, where x is a matrix with, say, 5 rows and 2 columns and y is a vector. Let take

Re: [R] An extention of outer() ?

2011-04-07 Thread Bogaso Christofer
values. Would you please help on how those numbers are coming? Thanks and regards, -Original Message- From: Henrique Dallazuanna [mailto:www...@gmail.com] Sent: 07 April 2011 23:36 To: Bogaso Christofer Cc: r-help@r-project.org Subject: Re: [R] An extention of outer() ? Try this: aperm

[R] A zoo related question

2011-04-06 Thread Bogaso Christofer
Dear all, please consider my following workbook: library(zoo) lis1 - vector('list', length = 2) lis2 - vector('list', length = 2) lis1[[1]] - zooreg(rnorm(20), start = as.Date(2010-01-01), frequency = 1) lis1[[2]] - zooreg(rnorm(20), start = as.yearmon(2010-01-01), frequency = 12)

[R] A zoo related question

2011-04-06 Thread Bogaso Christofer
Dear all, please consider my following workbook: library(zoo) lis1 - vector('list', length = 2) lis2 - vector('list', length = 2) lis1[[1]] - zooreg(rnorm(20), start = as.Date(2010-01-01), frequency = 1) lis1[[2]] - zooreg(rnorm(20), start = as.yearmon(2010-01-01), frequency = 12)

[R] Package Installation

2011-03-20 Thread Bogaso Christofer
Dear all, can somebody guide me how to install the package RQuantLib, for which windows binary is not available. I have tried installing it with R CMD INSTALL in my windows vista machine (I have Rtools installed), however it stopped due to an error saying: compilation failed for package

Re: [R] 'Date' elements within a matrix

2011-03-13 Thread Bogaso Christofer
example other than Date class which R forcefully changes to some simpler class if it placed within a matrix? Thanks and regards, -Original Message- From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] Sent: 12 March 2011 02:46 To: Bogaso Christofer Cc: r-help@r-project.org Subject: Re

[R] 'Date' elements within a matrix

2011-03-11 Thread Bogaso Christofer
Dear all, when I put date objects (class of 'Date') in a matrix it becomes numeric: dat - matrix(seq(as.Date(2011-01-01), as.Date(2011-01-09), by=1 day), 3) dat [,1] [,2] [,3] [1,] 14975 14978 14981 [2,] 14976 14979 14982 [3,] 14977 14980 14983 class(dat[1,1]) [1] numeric As

[R] From numeric vector to string vector

2011-02-13 Thread Bogaso Christofer
Hi there, I have a numeric vector let say: Vect - c(12.234, 234.5675, 1.5) Now I want a string vector like: changedVec - c(012.234, 234.568, 001.500) Would be grateful if somebody help me how can I do that. Thanks and regards, [[alternative HTML version deleted]]

[R] Seeking help to define s4 method for 'print'

2011-02-07 Thread Bogaso Christofer
I have got another question on defining a method for print() function for my s4 class. Here is my class definition as well as what I have done till now: setClass(Me, representation(x1 = numeric, x2 = numeric, y1 = character)) [1] Me setMethod(print, Me, definition=function(x) { +

[R] Seeking help to define method for '+'

2011-02-05 Thread Bogaso Christofer
Dear all, I am trying to define + method for my newly defined s4 class which is as follows: setClass(Me, sealed=F,representation(x1 = numeric, x2 = character)) new1 - new(Me, x1=2, x2=comment1) new2 - new(Me, x1=3, x2=comment1) setMethod(+, Me, definition=function(x,y) cat(x@x1 + y@x1,

Re: [R] Seeking help to define method for '+'

2011-02-05 Thread Bogaso Christofer
Christofer Cc: r-help@r-project.org Subject: Re: [R] Seeking help to define method for '+' On 02/05/2011 02:19 PM, Bogaso Christofer wrote: Dear all, I am trying to define + method for my newly defined s4 class which is as follows: setClass(Me, sealed=F,representation(x1 = numeric, x2

[R] How column names/row names are preserved in matrix calculation?

2011-02-02 Thread Bogaso Christofer
Can somebody tell me that, if I do some arithmetic calculation over 2 matrices then how the column names and row names are preserved? It seems that, for multiplication, column names and row names of the 2nd matrix are preserved and for additional, there seems not having any explicit rule:

[R] Working with additional input for user defined function

2011-02-01 Thread Bogaso Christofer
Hi all, suppose I have following user defined function: fn1 = function(x, y, ...) { z - x+y; u=y^2 # if something with name add exists in the function argument then do some calculation and return that calculated value, NOT z

Re: [R] Working with additional input for user defined function

2011-02-01 Thread Bogaso Christofer
(list(...))) : object 'zz' not found As you see, still I am far from the solution. How to pass the value of ... for further calculation? Thanks, -Original Message- From: Eik Vettorazzi [mailto:e.vettora...@uke.uni-hamburg.de] Sent: 01 February 2011 19:08 To: Bogaso Christofer Cc: r-help

[R] From data frame to list object

2011-01-31 Thread Bogaso Christofer
Dear all, let say I have following data frame: data.frame(x=rnorm(18), y=rep(c(a, b, c), each=6)) x y 1 -1.072152537 a 2 0.382985265 a 3 0.058877377 a 4 -0.006911939 a 5 -2.355269051 a 6 -0.303095553 a 7 0.484038422 b 8 0.733928931 b 9 -1.136014346 b 10

Re: [R] From data frame to list object

2011-01-31 Thread Bogaso Christofer
Christofer Cc: r-help@r-project.org Subject: Re: [R] From data frame to list object On Jan 31, 2011, at 1:03 PM, Bogaso Christofer wrote: Dear all, let say I have following data frame: dfrm - data.frame(x=rnorm(18), y=rep(c(a, b, c), each=6)) tapply(dfrm$x, dfrm$y, c) $a [1] 0.9711995

Re: [R] From data frame to list object

2011-01-31 Thread Bogaso Christofer
: David Winsemius [mailto:dwinsem...@comcast.net] Sent: 01 February 2011 00:13 To: Bogaso Christofer Cc: r-help@r-project.org Subject: Re: [R] From data frame to list object On Jan 31, 2011, at 1:56 PM, Bogaso Christofer wrote: Thanks David for this reply. However if my data frame has only 2

[R] How to look into the asterisked function?

2011-01-21 Thread Bogaso Christofer
Hi friends, there is methods() function to see the all available methods for a particular function, for example: head(methods(print)) [1] print.acf print.anova print.aov print.aovlist print.ar print.Arima In this list, there are some functions which are asterisked like

Re: [R] How to look into the asterisked function?

2011-01-21 Thread Bogaso Christofer
make print.anova() asterisked? Thanks and regards, -Original Message- From: jim holtman [mailto:jholt...@gmail.com] Sent: 21 January 2011 18:20 To: Bogaso Christofer Cc: r-help@r-project.org Subject: Re: [R] How to look into the asterisked function? You can also use: getAnywhere

Re: [R] A question on dummy variable

2011-01-12 Thread Bogaso Christofer
Thanks Gabor and other for their input. I admit that I must have placed some reproducible codes on what I wanted. However it was actually in my mind however I restrained because it was not any R related query rather a general Statistics related. Here I am using dummy variables in ***Time series

Re: [R] R-way to doing this?

2010-12-23 Thread Bogaso Christofer
-way to doing this? If I understand your question properly, then you are looking for 'try' or 'tryCatch'. There is an example of using these on page 89 of 'The R Inferno'. On 23/12/2010 04:13, Bogaso Christofer wrote: Dear friends, hope I could be able to explain my problem through following

[R] R-way to doing this?

2010-12-22 Thread Bogaso Christofer
Dear friends, hope I could be able to explain my problem through following example. Please consider this: set.seed(1) input - rnorm(10) input [1] -0.6264538 0.1836433 -0.8356286 1.5952808 0.3295078 -0.8204684 0.4874291 0.7383247 0.5757814 -0.3053884 tag - vector(length=10)

Re: [R] R article in forbes

2010-11-16 Thread Bogaso Christofer
Thanks Mark, for sharing such a great article. Really feeling proud that I am also part of that great community. BTW can anyone share the code on how to draw the picture displayed there (blur surface plot)? Thanks, -Original Message- From: r-help-boun...@r-project.org

[R] How to obtain seed after generating random number?

2010-08-24 Thread Bogaso Christofer
Dear all, I was doing an experiment to disprove some theory therefore performing lot of random simulation. Goal is to show the audience that although something has very rare chance to occur but it doesn't mean that event would be impossible. In this case after getting that rare event I need to

[R] How to see inside of this function?

2010-07-14 Thread Bogaso Christofer
Hi, there is a function Skewness() under fBasics package. If I type skewness, I get followings: skewness function (x, ...) { UseMethod(skewness) } environment: namespace:timeDate Would be great if someone tell me how to see the codes of this function. 2ndly suppose I create

[R] How to create sequence in month

2010-07-12 Thread Bogaso Christofer
Hi all, can anyone please guide me how to create a sequence of months? Here I have tried following however couldn't get success library(zoo) seq(as.yearmon(2010-01-01), as.yearmon(2010-03-01), by=1 month) Error in del/by : non-numeric argument to binary operator What is the correct

[R] Need help on date calculation

2010-07-10 Thread Bogaso Christofer
Hi all, please see my code: library(zoo) a - as.yearmon(March-2010, %B-%Y) b - as.yearmon(May-2010, %B-%Y) nn - (b-a)*12 # number of months in between them nn [1] 2 as.integer(nn) [1] 1 What is the correct way to find the number of months between a and b, still retaining

Re: [R] Need help on date calculation

2010-07-10 Thread Bogaso Christofer
Thanks Gabor for your input. However my question is, is your solution general for any value of a and b? -Original Message- From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] Sent: 11 July 2010 00:42 To: Bogaso Christofer Cc: r-help@r-project.org Subject: Re: [R] Need help on date

Re: [R] Double Integration

2010-07-03 Thread Bogaso Christofer
Hi Ravi, your suggestion helped me as well a lot. If I look into that function, I see this function is calling another function : .Call(doCubature, as.integer(fDim), body(f.check), as.double(lowerLimit), as.double(upperLimit), as.integer(maxEval), as.double(absError),

[R] Multivariate Binomial distribution

2010-06-24 Thread Bogaso Christofer
Dear all, is there any R implementation on the Multivariate binomial distribution like calculate the value of p.m.f., drawing random sample from it etc. Thanks, [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] R vs SAS and Revolution R

2010-06-19 Thread Bogaso Christofer
When the version 2.12 is issued? Is it available for download (windows version)? Currently I am using the version 2.11.1 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of skan Sent: 19 June 2010 19:10 To: r-help@r-project.org Subject: