[R] F test

2013-09-09 Thread Trying To learn again
Hi, I want to obtain the F test associated an ADF test In tseries, I can obtain t t stat of Dickey fuller, it is posible to obtain the related F test? Many thanks in advance [[alternative HTML version deleted]] __ R-help@r-project.org

[R] Obtaing the maximum

2013-05-28 Thread Trying To learn again
y a priori what is the maximum and when "stops" there is some function in r doing something similar this? Thans in advance to all. 1 2 3 4 5 1 2 3 1 1 1 2 3 4 5 1 2 3 [[alternative HTML version deleted]] __ R-help@r-project.or

[R] Tablet and executing R

2013-04-08 Thread Trying To learn again
Hi all, Have any of you instaled R on a Tablet, in this case, which Tablet. My family wants me to gift a Tablet but I suposse R can not be instaled on a Tablet. And my few "free" time I pass mainly trying to "improve" in R. Can yoy tell me, if there are, wich Tablet

Re: [R] plot

2013-04-01 Thread Trying To learn again
Hi Many Thanks to all. dev.print(jpeg, file="test.jpeg", height=800,width=800) Works perfectly it saves in the default directory the jpeg file. I use RStudio. Many Thanks. 2013/4/1 David Winsemius > > On Apr 1, 2013, at 9:26 AM, R. Michael Weylandt wrote: > > > On

[R] plot

2013-04-01 Thread Trying To learn again
Hi all if I plot a graph on R, I press on the plot Export/Save Plot as Image I change name on "File name:" I select DirectoryBibliotecas\Documentos And select Width 800 and Height 800 And finally save in format JPEG It is posible to "type" code so that I can run m

[R] Fit a mixture of lognormal and normal distributions

2013-03-18 Thread To . .
Hello I am trying to find an automated way of fitting a mixture of normal and log-normal distributions to data which is clearly bimodal. Here's a simulated example: x.1<-rnorm(6000, 2.4, 0.6) x.2<-rlnorm(1, 1.3,0.1) X<-c(x.1, x.2) hist(X,100,freq=FALSE, ylim=c(0,1.5))lines(den

[R] Fit a mixture of lognormal and normal distributions

2013-03-18 Thread To . .
Hello I am trying to find an automated way of fitting a mixture of normal and log-normal distributions to data which is clearly bimodal. Here's a simulated example: x.1<-rnorm(6000, 2.4, 0.6)x.2<-rlnorm(1, 1.3,0.1)X<-c(x.1, x.2) hist(X,100,freq=FALSE, ylim=c(0,1.5))lines(densi

Re: [R] how to convert a data.frame to tree structure object such as dendrogram

2013-03-12 Thread Not To Miss
Thanks. Is there any more elegant solution? What if I don't know how many levels of nesting ahead of time? On Tue, Mar 12, 2013 at 8:51 AM, Greg Snow <538...@gmail.com> wrote: > You can use the lapply or rapply functions on the resulting list to break > each piece into a list i

Re: [R] how to convert a data.frame to tree structure object such as dendrogram

2013-03-11 Thread Not To Miss
Thanks. That's just an simple example - what if there are more columns and more rows? Is there any easy way to create nested list? Best, Zech On Mon, Mar 11, 2013 at 2:12 PM, MacQueen, Don wrote: > You will have to decide what R data structure is a "tree structure". But >

[R] how to convert a data.frame to tree structure object such as dendrogram

2013-03-10 Thread Not To Miss
I have a data.frame object like: > data.frame(x=c('A','A','B','B'), y=c('Ab','Ac','Ba','Bd')) x y 1 A Ab 2 A Ac 3 B Ba 4 B Bd how could I create a tree structure object like this: |---Ab A---| _| |---Ac | | |---Ba B---| |---Bb Thanks, Zech [[alternative HTML version

Re: [R] get current plot dimensions?

2013-03-09 Thread Not To Miss
Learned a new trick. thanks! Zech On Fri, Mar 8, 2013 at 6:41 PM, William Dunlap wrote: > Try using the combination >plot.new() ; par(new=TRUE) > to advance to the next position in the layout before querying par("pin"). > Be sure to actually plot something after the

[R] get current plot dimensions?

2013-03-08 Thread Not To Miss
Hi R users, I find par("pin") is kind of confusing (or maybe just me?). The manual said it will give " The current plot dimensions, ‘(width,height)’, in inches." The word "current" is the key here. I thought it would give the dimensions of the to-be plot, but it a

[R] what is absolute size of mar

2013-03-07 Thread Not To Miss
Hi R users, The margin parameter mar is measured in unit of lines, the size of which is automatically adjusted during plotting. I am wondering how can get the size of a line and how can I control the margin size by controlling the line size? (I know I can use mai to control the absolute size of

[R] Loop

2013-02-17 Thread Trying To learn again
Hi all, I want to execute a loop of a program: for (u in Timeframemin:Timeframe){} Imagine that Timeframemin<-10 Timefram<-1 Is it posible to execute the loop but only proving from 10 to 1 but jumping 10 each time, for example, execute for 10,20,30.to Timeframe. Other quest

[R] DAtes

2012-08-04 Thread Trying To learn again
Hi all, I´m trying to convert as a data frame (with format "date") this copied excel column of dates (exposed below), I have tried to save them in a txt file tfr<-read.table("tfra.txt") tfr<-data.frame(tfr) I have tried several things, as date, so on, but always err

[R] order or sort doesn´t work properly

2012-07-17 Thread Trying To learn again
Hi all, I want to order a series that is included on the second column in MCT.csv. I do but R doesn´t order, could be because is a csv? I have prove MCT<-read.csv("MCT.csv") a<-order(MCTor[,2],2,decreasing = FALSE) a<-order(MCTor[,2],1,decreasing = FALSE) or the same w

Re: [R] eclipse cran r

2012-06-12 Thread Trying To learn again
Hi JEssica I have tried but for the moment I´m getting crazyso I let for the future to understand for instance why the viewer doesn´t goes, and so on. Actually I´m using "Tex Maker" and I attach code using funtion \begin{lstlisting} so on The only "inconvenience" i

[R] eclipse cran r

2012-06-11 Thread Trying To learn again
hi i see you can create latex pdf files using eclipse and that cran r code can be put on it direcctly. I have tried but it seems very difficult there is an easy way step by step manual and explaining all programs and folders needed? [[alternative HTML version deleted]] ___

Re: [R] Order all the columns ascending elements on a matrix or a data frame

2012-06-11 Thread Trying To learn again
Many ThanKs to all. 2012/6/10 Bert Gunter > On Sun, Jun 10, 2012 at 2:22 PM, arun wrote: > > Hi Bert, > > > > I tried the code. > > > > dat2<-data.frame(dat1) > >> do.call(order,dat2) > > [1] 3 6 1 10 2 5 7 9 8 4 > > > &g

[R] Order all the columns ascending elements on a matrix or a data frame

2012-06-10 Thread Trying To learn again
Imagine I have a csv KT.csv I want to create a new dataframe o convert KT in a matrix and create a new matrix with each column of KT ordered by ascending order. I have tried to make this b<-read.csv("KT.csv") for(i in 1:ncol(b)){ b[,i]<-sort(b[,i]) } But it puts a message

[R] Inf and NA

2012-06-09 Thread Trying To learn again
Hi all, I have a csv matrix "KT.csv" and it has Inf and NA I want to calculate the mean of each row so I use rowMeans(KT,na.rm = TRUE) but with this Inf cannot be omminted. I´m trying to use before running rowMeans(KT,na.rm = TRUE) KT<-range(KT,finite=TRUE) but it doesn´t wor

[R] Plot txt

2012-05-23 Thread Trying To learn again
Hi all Sorry in advance I have this txt with data and I want to plot the data with a line between dots. The thing is that if I run this g<-read.table("ip.txt") plot(g,type="l") I have prove to attach(g) but doesn´ t work. I know is a begginer question and sure is of

[R] Matrix invert

2012-05-11 Thread Trying To learn again
I all, I have a matrix like this a= 1 4 2 7 3 6 I want to create a new matrix b= 3 6 2 7 1 4 Anyone knows if there is a "reverse" function? I can do it with loops if no exits. [[alternative HTML version deleted]] _

Re: [R] Error t value matrix

2012-05-11 Thread Trying To learn again
I have it, I have used a simply programmation using loops I have to run the multiple lm with at least 3 variables (because it needs at least 2 degrees of freedom). Many Thanks 2012/5/11 Trying To learn again > Hi all, > > I have I got it. I see the way on my mind. I will try

Re: [R] Error t value matrix

2012-05-11 Thread Trying To learn again
Hi all, I have I got it. I see the way on my mind. I will try this week end and if I get it I will send. Thanks. 2012/5/10 Trying To learn again > Hi all, > > I want to make the following: > > I want to run a linear regression on each column of a matrix "estima" on &

[R] Error t value matrix

2012-05-10 Thread Trying To learn again
Hi all, I want to make the following: I want to run a linear regression on each column of a matrix "estima" on the correspondent column on the matrix "estima2". You see I want to regress estima[,1] on estima2[,1] this way to all columns At the same time I want to make

[R] Saving a variable

2012-05-06 Thread Trying To learn again
Hi all, I´m trying to use write function to save the output of a program (my constructed "H" matrix) randz<-matrix(rnorm(100),500,2000) H<-matrix(0,500,2000) H[1,]<-randz[1,] for (j in 1:2000){ for (i in 2:500){ if(i<251) H[i,j]<-0.6*H[i-1,j]+randz[i,j] else H

[R] PLot a matrix

2012-05-06 Thread Trying To learn again
Hi, I want to plot this matrix (I attach the data), it is suposed that each column is a different time series. If I do g<-read.table("dataADF.txt", header=F) and plot(g[,1],type="l") it plots the first column plot if I want in a unique graph each colums of dataA, a

[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-help@r

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 > Hi all, > > I´m re-starting (as my name indicates) my little knowlegde

[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<-funct

[R] Database

2012-02-28 Thread Trying To learn again
Hi all, I´m new using Access. I see that many things that you can do on Access you can do on CRAN R but not on contrary. My question is: Is there any manual with examples comparing how to do data base analysis on access and making the same on CRAN R? Imagine I want to compare two columns "

[R] MAximum location

2011-12-15 Thread Trying To learn again
Hi all, I have a matrix a<-c(2,3,4,Inf) > b<-as.matrix(a) [,1] [1,]2 [2,]3 [3,]4 [4,] Inf > range(b, finite=TRUE)[2] (this is the maximum) [1] 4 There is a pre-def function to extract the location (in terms of rows) of the value in the matrix. In my example woul

[R] Omit Inf

2011-12-14 Thread Trying To learn again
Hi all > a<-c(2,Inf) > max(a) [1] Inf > How can I say...omit Inf? I cannot find anything... [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guid

Re: [R] Hi

2011-12-14 Thread Trying To learn again
Hi all, I have solved my question Output<- matrix(0, length(x), 1) for (i in 1:length(x)){ files <- paste('KT', i, '.csv', sep = '') da1 <- read.csv(files) Output[i,1]<-da1[1,2] } 2011/12/14 Trying To learn again > Hi all, > > I

Re: [R] Hi

2011-12-14 Thread Trying To learn again
First PRoblem solved > read.csv("KT80.csv") X x 1 1 0.01331361 > I ommitt "" in calling the file name... 2011/12/14 Trying To learn again > Hi all, > > I have 100 csv files always with this information (I Attach two example > exc

Re: [R] Loops on data˜1

2011-09-13 Thread Trying To learn again
Hi Michael, First of all thanks for your response. I do know that if I make my stimation on a single data the regression has no sense but it will be getting sense in the growing next estimations. I change my asking doubt. I want to use this regressions as a first filter. Only this. Can anyone

[R] Loops on data˜1

2011-09-12 Thread Trying To learn again
Hi all, I have a time series a column vector with the ordered data so that the first column is the first observation and so on. The fact is that I want to run a multiple regression with only intercept. My first task is to run the regression on the first observation (1 from 276) and at the same

[R] Avoiding loops to detect number of coincidences

2011-07-12 Thread Trying To learn again
3 3 I want to now how many positions are identical between each row in pru compared with ht. n and m are the col and row of pru (m is the same number in pru and ht) I tried this with loops n<-nrow(pru) m<-ncol(pru) dacc2<-mat.or.vec(n, m) for (g in 1:n){ for (j in 1:m){ if(pru[g,j]-ht

Re: [R] Creating a zero matrix when a condition doesn´t get it

2011-07-12 Thread Trying To learn again
Many Thanks¡¡¡ I will try this night, I have read this I think could help me. I´m conscient the question was badly formulated now, I will try to explain better next time¡¡¡ On a side note: apply always accesses the function you use at least once. If the input is a dataframe without any rows but

[R] Creating a zero matrix when a condition doesn´t get it

2011-07-12 Thread Trying To learn again
Hi all, I first create a matrix/data frame called "d2" if another matrix accomplishes some restrictions "dacc2" da2<-da1[colSums(dacc2)>9,] da2<-da2[(da2[,13]=24),] write.csv(da2, file =paste('hggi', i,'.csv',sep = '')) The thing is if finally da2 cannot get/passs the filters, it cannot writte a

Re: [R] Executing a function several time, how to save the output

2011-07-05 Thread Trying To learn again
Hi, I find the solution¡¡¡ It was the 1:2 so if I put a loop for iand replace it works¡¡¡ So Many Thanks¡¡¡ Forget My doubt¡¡ 2011/7/5 Trying To learn again > Hi all, > > I try to exceute a function "myfun" that should use as input "input1.csv" > and

[R] Executing a function several time, how to save the output

2011-07-05 Thread Trying To learn again
Hi all, I try to exceute a function "myfun" that should use as input "input1.csv" and "input2.csv" . Then I try to save the output dat33 on a csv file (on per each time I execute input1..input 2 and so on). So my problem is how to finally obtain several csv file wit

Re: [R] How many times occurs

2011-07-03 Thread Trying To learn again
I suppose the easiest way to make this is to use loops and construct a zero matrix to be completed each time the sequence accompleixes, don´t you? I will try this evening¡¡¡ 2011/7/2 Trying To learn again > Hi all, > > I have a data matrix likein "input.txt" > > 8 9

[R] How many times occurs

2011-07-02 Thread Trying To learn again
Hi all, I have a data matrix likein "input.txt" 8 9 2 5 4 5 8 5 6 6 8 9 2 8 9 2 8 9 2 1 8 9 2 5 4 5 8 5 6 4 8 9 2 5 4 5 8 5 6 6 8 9 2 8 9 2 8 9 2 1 8 9 2 5 4 5 8 9 2 2 In this example will be an 6x10 matrix (or data frame) I want to detect how many times in a row appears this c

Re: [R] Eliminating a row if something happens

2011-07-01 Thread Trying To learn again
Hi I know that putting write(f,file="bar.txt") it should work but the txt cannot be openned well I don ´t know exactly why. My mai doubt is how to make this I want to create a new matrix based on a previous matrix. You see, If my "data" matrix accomplises this: if(rowSums(

[R] Eliminating a row if something happens

2011-07-01 Thread Trying To learn again
Hi all, I want to create a new matrix based on a previous matrix. You see, If my "data" matrix accomplises this: if(rowSums(data[i,])>16|rowSums(data[i,])<28) data[i,]= data[i,] # if sum of rows is more than 16 and less 28 I conservate the row #but How I say if else "remo

Re: [R] Executing a script "hand-made" and time

2011-06-29 Thread Trying To learn again
Hi all, My file that worked with a thin matrix (with few rows and colums) finally made an error but I can´t comprehed why? valor ausente donde TRUE/FALSE es necesario (absent value TRUE/FALSE is necessary?) Error en if (data[i, j] - last1[1, j] != 0) data2[i, j] = 0 else { : You recommed to

[R] Executing a script "hand-made" and time

2011-06-29 Thread Trying To learn again
Hi all, I have a function written by me that read a matrix (data frame) from a txt with 4 million of rows and 13 columns. The think is my function works with an input matrix of 100x13 and now I tried to execute my function with the big "input file" and it is running form the moment

Re: [R] Separator of data

2011-06-28 Thread Trying To learn again
6 > 3 5 5 8 8 8 8 5 5 5 > > > > > On Tue, Jun 28, 2011 at 3:47 PM, Trying To learn again > wrote: > > Hi all, > > > > I have a matrix like this: > > > > 188556644 > > 225588666 > > 55555 > > > > I try to r

[R] Separator of data

2011-06-28 Thread Trying To learn again
Hi all, I have a matrix like this: 188556644 225588666 55555 I try to read the table using read table but if I put sep="" I have seen it expects a white space, is there a "sep" option to read this matrix so each single number is a position of the matrix You see thi

[R] Executing the same function on consecutive files

2011-06-27 Thread Trying To learn again
Hi all, I have the next problem: I have a matrix with size 8,000,000x18. My personal computer...blocks...so I have cut my original file into 100 different file. I have written a function that should be run on each of this file. So imagine I need to read data from q1 to q100 file data

Re: [R] Item analysis

2011-06-21 Thread Trying To learn again
Hi I have tried the first version, it works. BUT I have an additional problem. I expose; The first I solved, I tried to execute on xx data.frame but I used a matrix wich columns I put name you see col.names=c("Date","Time","Tip") the thing was that I didn´t er

[R] Required libraries

2011-06-18 Thread Trying To learn again
Hi all, I´m trying to "recuperate" old files I wrotte and I´m trying to execute on R version 2.13.0 (2011-04-13), the thing is I execute my old file and nothing happens...I suposse I need to install some library but there no appears no message, no text telling "required graf

[R] Item analysis

2011-06-09 Thread Trying To learn again
Hi all, For several reasons I have no used CARN R in monthsI have an idea and I want to retry to learn CRAN R. I know I need to formulate more "intelligent" questions but I will expose and if someone can help me I would be very gratefull I promise to try to learn again The

Re: [R] Combinations

2010-10-05 Thread Trying To learn again
lumns that contain this pre-requisite. 2010/10/4 Trying To learn again > Hi all, > > I´ve been ill and I have lost a lot of time without seen the pc. > > I want you to help if you can if you want. > > Only I need an initial guide. I´ve been out a lot of time and I need a >

[R] Combinations

2010-10-04 Thread Trying To learn again
Hi all, I´ve been ill and I have lost a lot of time without seen the pc. I want you to help if you can if you want. Only I need an initial guide. I´ve been out a lot of time and I need a hope. Is only for "joby" purposes. The problem: I want to simulate each of the posible combin

[R] lm length

2010-08-02 Thread Trying To learn again
Hi all, I wanto to run a plot about the levels of a variable parting on an ols regression. The regression in done on the rate of return of the variable. Imagine R_{t}=a+b*R_{t-1} So If P, the "estimated" price would be P_{t}=P_{t-1}*R_{t} Imagine that I obtain lm fitted valu

Re: [R] Add an arrow to a plot

2010-07-28 Thread Trying To learn again
Hi many thank¡¡¡ I promise work hard¡¡¡ Today I ´ve been very busy but I will wake up tomorrow on 5:00 to see what you have suggested I need work harder but working and having a children (1,5 years is very exhaust 2010/7/28 Greg Snow > In addition to the arrows function, look at

[R] Add an arrow to a plot

2010-07-27 Thread Trying To learn again
Hi I want to plot an x,y plot something like an scatter plot. I always have the same doubt, were is the last point of my file? Imagine it is a time series so I want the last point to indicate with an arrow (but athomatically if posible). Someone knows if it is posible? Could it be posible to

[R] Brewer.pal error

2010-07-08 Thread Trying To learn again
Hi all, I have 35 years, I have been working since I exit from University. I have returned to make a phd...I´m fortunatelly I´m working so unfortunatelly I have few time to study (I have also a baby with 16 months). I´m trying to use R but sometimes it gets very difficult. I´m trying to put

Re: [R] Installing package RODBC error - please help

2009-02-09 Thread Vaz Joao (QPT TO EPA)
Hi, Anyone please help installing RODBC? Cumprimentos, Joao Vaz Product Engineer QPT Product Engineering Qimonda Portugal S.A. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Vaz Joao (QPT TO EPA

[R] Installing package RODBC error - please help

2009-02-05 Thread Vaz Joao (QPT TO EPA)
Hi, I have R version 2.8.1 running on Windows 2000 and can't seem to be able to install package RODBC. I've tried reinstalling R but that wasn't successful. Can some one please help? This is the command I'm using and the subsequent error message: > install.packages(&

[R] Installing package RODBC error - please help

2009-02-05 Thread Vaz Joao (QPT TO EPA)
I have R version 2.8.1 running on Windows 2000 and can't seem to be able to install package RODBC. I've tried reinstalling R but that wasn't successful. Can some one please help? This is the command and the subsequent error message: > install.packages("RODBC", .L

Re: [R] unable to install packages

2009-02-03 Thread Vaz Joao (QPT TO EPA)
Hi, Sorry, just one correction: the error message that appears is: Warning: unable to access index for repository http://ftp5.gwdg.de/pub/misc/cran/bin/windows/contrib/2.8 Cumprimentos, Joao Vaz Product Engineer QPT Product Engineering Qimonda Portugal S.A

[R] R: unable to install packages

2009-02-03 Thread Vaz Joao (QPT TO EPA)
Hi, I'm running R version 2.8.1 on Windows and I'm having quite a lot of trouble just to install package RODBC. When I run command install.packages("RODBC"), the following error message appears: Warning: unable to access index for repository http://cran.pt.r-project.org

Re: [R] Question Regarding 'pipe'

2008-04-08 Thread born . to . b . wyld
Reason, I need to do this in awk and not R: Let's say 'x' is the tabular representation of a sparse contingency table > x x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 Freq 10 0 0 2 2 2 0 2 0 2 54 51 0 0 2 2 2 0 2 1 21 61 0

[R] Question Regarding 'pipe'

2008-04-07 Thread born . to . b . wyld
Can anyone point out why this is not working? y<-read.table(pipe(' awk '{ n = $1; sub( ".*" $1 " " ,"") ; while ( n-- ) print }' temp.txt ')) [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailm

[R] Tabulating Sparse Contingency Table

2008-03-28 Thread born . to . b . wyld
x11 2 3 1 0 0 0 2 0 0 0 3 0 0 0 Now, I do can do the following to get the sparse representation 'y' for the table above: > idx<-2 > y<-as.data.frame.table(xtabs(~.,data[,idx:(idx+4)])) > y<-y[y$Freq>0,] > z<-sort(y$Freq,

[R] accessing dimension names

2007-12-18 Thread born . to . b . wyld
I have a matrix y: > dimnames(y) $x93 [1] "1" "2" $x94 [1] "0" "1" "2" .. so on (there are other dimensions as well) I need to access a particular dimension, but a random mechanism tells me which dimension it would. So, s

Re: [R] creating objects of class "xtabs" "table" in R

2007-10-05 Thread born . to . b . wyld
Neat! Thanks. On 10/5/07, Deepayan Sarkar <[EMAIL PROTECTED]> wrote: > > On 10/5/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I have an application that would generate a cross-tabulation in array > > format in R. In particular, my application would give me a

[R] creating objects of class "xtabs" "table" in R

2007-10-05 Thread born . to . b . wyld
I have an application that would generate a cross-tabulation in array format in R. In particular, my application would give me a result similar to that of : array(5,c(2,2,2,2,2)) The above could be seen as a cross-tabulation of 5 variables with 2 levels each (could be 0 and 1). In this case, the