Re: [R] how to get output from a nested loop

2009-06-10 Thread Linlin Yan
How about like this: t1 - data.frame(row.names=c('c1','c2','c3','c4'), mk1=c(1,1,0,0), mk2=c(0,0,0,1), mk3=c(1,1,1,1), mk4=c(0,0,0,0), mk5=c(0,0,0,1), S=c(4,5,3,2)) t1 mk1 mk2 mk3 mk4 mk5 S c1 1 0 1 0 0 4 c2 1 0 1 0 0 5 c3 0 0 1 0 0 3 c4 0 1 1 0 1 2

Re: [R] R CMD check does not find a mistake

2009-06-10 Thread Martin Maechler
CG == Christophe Genolini cgeno...@u-paris10.fr on Tue, 09 Jun 2009 16:17:15 +0200 writes: CG Hi the list, I build a package. They was a mistake in CG it, but R CMD check did not find it. Is that normal ? CG Here is what Kurt gets (which is right, I did this CG mistake):

[R] Asking for help while using Simplex to solve LP Problem.

2009-06-10 Thread Ren, Shubin
Hello. I am a new user and want to use R to solve Linear Programming problem. I met a problem while using function Simplex and I would kindly ask whether someone could help to figure it out. In my problem, there are 47 parameters and all limited to (0,1). M file has 147 lines and P file has

Re: [R] graphically representing frequency of words in a speech?

2009-06-10 Thread Yihui Xie
Hi, As Gregor Gorjanc mentioned, it's very inconvenient to let R decide the fontsize and placement of words in a plot. There have already been very mature applications of tag cloud; one of them I'm relatively familiar is the WordPress plugin wp-cumulus, which makes use of a Flash object to

Re: [R] Unable to load package:lme4 [ Ubuntu 9.04 ]

2009-06-10 Thread Martin Maechler
GAR == Girish A R garam...@gmail.com on Tue, 9 Jun 2009 22:00:01 -0700 (PDT) writes: GAR Hi folks, GAR When I try to load package 'lme4' on my Linux box (64-bit Ubuntu GAR 9.04), I get the following error: GAR - library(lme4) GAR

Re: [R] graphically representing frequency of words in a speech?

2009-06-10 Thread Ronggui Huang
There is a similar discussion in statalist (http://n2.nabble.com/st%3A-Tag-clouds-in-Stata--tt2992551.html#none), I think they make a reasonable argument that tag cloud is not a good statistical graphic. 2009/6/10 Yihui Xie xieyi...@gmail.com: Hi, As Gregor Gorjanc mentioned, it's very

Re: [R] Unable to load package:lme4 [ Ubuntu 9.04 ]

2009-06-10 Thread Girish A.R.
Hi Martin, I upgraded to R 2.9.0, but still have the same problem. The error message, output of packageDescription(lme4), and sessionInfo() are displayed below. Thanks, -Girish -- library(lme4) Loading required package: Matrix Loading

Re: [R] Unable to load package:lme4 [ Ubuntu 9.04 ]

2009-06-10 Thread Martin Maechler
GAR == Girish A R garam...@gmail.com on Wed, 10 Jun 2009 02:06:57 -0700 (PDT) writes: GAR Hi Martin, GAR I upgraded to R 2.9.0, but still have the same problem. The error GAR message, output of packageDescription(lme4), and sessionInfo() are GAR displayed below. GAR

[R] filled.contour as image

2009-06-10 Thread Muri Soares
Hi, Is there a way to make the filled.contour() function produce a plot similar to the image() function? i.e. not have smooth contours but rather distinct squares corresponding to the different cells of the matrix. The reason I ask is because since image doesn't have an option to display

Re: [R] Unable to load package:lme4 [ Ubuntu 9.04 ]

2009-06-10 Thread Girish A.R.
Hi Martin, Thanks for your prompt response! As suggested, I re-installed 'lme4' and am now able to load it without any problem. best, -Girish --- packageDescription(lme4) Package: lme4 Version: 0.999375-31 Date:

Re: [R] Using ADF.Test

2009-06-10 Thread matifou
ehxpieterse wrote: Hi, I am quite new to R and would appreciate some guidance, if possible. I have imported a csv file: spread - read.csv(Spread.csv) I get the following error when I try to run adf.test: adf.test(spread,alternative = c(stationary, explosive),0) Error in embed(y,

Re: [R] Problem : solving a equation with R , fail with uniroot function

2009-06-10 Thread yann lancien
Thanks for your help ! I got another problem with my function : test - function(x,bb0=-3,bb1=5,c0=2,r0=0) { ((exp(c0-r0)*(bb0+x)*(bb1-x))/((bb0+x+1)*(bb1-x-1))-1)} With this : curve(test(x),from=-10,to=10) we can see that there are 2 roots : one in [3,4] and one in [5,10] uniroot(test,c(5,

Re: [R] poly regression

2009-06-10 Thread Gabor Grothendieck
They have different coefficients because their model matrices are different but they both lead to the same predictions: fitted(lm(y~1+x+I(x^2))) 1 2 3 4 5 6 7 8 9 10 1 4 9 16 25 36 49 64 81 100 fitted(lm(y~poly(x,2))) 1 2 3 4 5 6 7 8 9 10 1

Re: [R] R on EC2 and R CMD javareconf

2009-06-10 Thread Allan Engelhardt
Java on Fedora 8 is a little funny so my guess is that is where the problem is (or that you are missing the Java development (*-devel) packages). I am (right now) building an Amazon image with Fedora 11 on x86_64 with R (and the Engineering and Scientific group) installed: let me know if you

Re: [R] Using ADF.Test

2009-06-10 Thread Achim Zeileis
On Wed, 10 Jun 2009, matifou wrote: ehxpieterse wrote: Hi, I am quite new to R and would appreciate some guidance, if possible. I have imported a csv file: spread - read.csv(Spread.csv) I get the following error when I try to run adf.test: adf.test(spread,alternative = c(stationary,

[R] help with package simsalabim

2009-06-10 Thread mauede
I have attached a text file representing the centralized amplitude of a signal, sampled at 30Hz, whose length N = 6922 My goal is to remove the trend. I am using package simsalabim. I ran command decompSSA with L = length(Amps)/5 The reason is that I have SSA/MTM toolkit running in Mac/OS.

[R] isolating Hour and minute form date and time

2009-06-10 Thread christiaan pauw
Hi everybody. I have a dataframe that contains a factor with the date information in the format like in the example below: 2009/05/12 11:22:31 AM I have been able to convert it to POSIXt using strptime Now I want to print only the date as one vector and the time in another vector but they must

Re: [R] isolating Hour and minute form date and time

2009-06-10 Thread Gabor Grothendieck
Try this and see R News 4/1 for more. now - Sys.time(); now [1] 2009-06-10 07:26:23 EDT library(chron) ch - as.chron(format(now)) dd - dates(ch); dd; dd+1 day 06/10/09 day 06/11/09 tt - times(ch) - times(dd); tt; tt+1/24 day 07:26:23 day 08:26:23 On Wed, Jun 10, 2009 at 7:13

Re: [R] Using ADF.Test

2009-06-10 Thread Wacek Kusnierczyk
Achim Zeileis wrote: [...] is.vector(as.vector(...)) is not necessarily TRUE. Consider x - cars[, 1, drop=FALSE] is.vector(x) is.vector(as.vector(x)) identical(x, as.vector(x)) interesting. i wonder why as.vector does not give, at the very least, a warning when the result of

Re: [R] isolating Hour and minute form date and time

2009-06-10 Thread Allan Engelhardt
There is no class for times only in R. Your best bet is probably a difftime, e.g. time - difftime(posix.date, as.Date(posix.date), units=secs) Allan. christiaan pauw wrote: Hi everybody. I have a dataframe that contains a factor with the date information in the format like in the example

[R] ggplot, qplot: alpha channel for colors corresponding to factor

2009-06-10 Thread Marianne Promberger
Hi, I have a qplot like the one in the minimal example below, except I also have faceting like this: qplot(jitter(Goodall),jitter(Better.adapt),colour=Second.adapt,facets=~Pol,data=d1) and with the real data I get quite a lot of overplotting, so I would like to add an alpha channel. In

Re: [R] filled.contour as image

2009-06-10 Thread Jim Lemon
Muri Soares wrote: Hi, Is there a way to make the filled.contour() function produce a plot similar to the image() function? i.e. not have smooth contours but rather distinct squares corresponding to the different cells of the matrix. The reason I ask is because since image doesn't have an

[R] plot two variograms on a same graph

2009-06-10 Thread damien landais
Hi, I would know how to plot two variograms on a same graph. I can plot one by one but I would draw both on the same one. Is it possible? Do i need any special package? Thanks! Cordialement Damien Landais __ R-help@r-project.org mailing list

Re: [R] ggplot, qplot: alpha channel for colors corresponding to factor

2009-06-10 Thread ONKELINX, Thierry
Dear Marianne, If find that a bit easier with ggplot() instead of qplot() d1 - data.frame(Goodall=c(rep(1:3,5)), Better.adapt = c(rep(1,7),rep(2,8)),Second.adapt=c(rep(1:5,3))) library(ggplot2) ggplot(d1, aes(x= Goodall, y = Better.adapt, colour=Second.adapt)) + geom_jitter(alpha = 0.2) +

Re: [R] R CMD check does not find a mistake

2009-06-10 Thread Martin Maechler
MM == Martin Maechler maech...@stat.math.ethz.ch on Wed, 10 Jun 2009 08:50:46 +0200 writes: CG == Christophe Genolini cgeno...@u-paris10.fr on Tue, 09 Jun 2009 16:17:15 +0200 writes: CG Hi the list, I build a package. They was a mistake in CG it, but R CMD check did not find

Re: [R] plot two variograms on a same graph

2009-06-10 Thread ONKELINX, Thierry
Dear Damien, I tend do use ggplot2 for more advanced plotting. You only have to create a dataframe with all the data you need. Here are some examples. library(gstat) library(ggplot2) data(meuse) coordinates(meuse) = ~x+y g1 - gstat(id = Raw, formula =

Re: [R] filled.contour as image

2009-06-10 Thread David Winsemius
The image function in package Matrix plots a color legend by default. Searching on what seemed like the obvious strategy image legend in R Site Search would have identified this and a huge number of other alternatives, of which Lemon's color2D.matplot is the tenth. -- David Winsemius On

Re: [R] ggplot, qplot: alpha channel for colors corresponding to factor

2009-06-10 Thread Marianne Promberger
Many thanks for the quick reply! d1 - data.frame(Goodall=c(rep(1:3,5)), Better.adapt = c(rep(1,7),rep(2,8)),Second.adapt=c(rep(1:5,3))) library(ggplot2) ggplot(d1, aes(x= Goodall, y = Better.adapt, colour=Second.adapt)) + geom_jitter(alpha = 0.2) + scale_colour_gradient(low = white, high =

[R] arima modeling for multiple time series

2009-06-10 Thread Erin Hodgess
Dear R People: Is there a package for arima modeling of multiple time series, please? I think that Dr. Paul Gilbert may have one, but I'm drawing a blank on the package name. Thanks in advance, Sincerely, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical

Re: [R] plot two variograms on a same graph

2009-06-10 Thread Paul Hiemstra
Hi, It is possible, but without you specifying in which pacakge you are going to fit the variograms it is hard for us to provide an example. And what do you mean by variogram, is that the sample variogram or the fitted variogram model, or both? Try and keep to the posting guide next time to

Re: [R] poly regression

2009-06-10 Thread Ravi Varadhan
To get the result that you were expecting, use the following (which uses the raw polynomial a + bx + cx^2 rather than the orthogonal polynomial of degree 2): lm(y~poly(x,2, raw=TRUE)) Ravi. --- Ravi Varadhan,

Re: [R] arima modeling for multiple time series

2009-06-10 Thread David Winsemius
An R Site Search on the obvious strategy arima Gilbert produces two hits of which the first is: dse-package {dse1} On Jun 10, 2009, at 9:13 AM, Erin Hodgess wrote: Dear R People: Is there a package for arima modeling of multiple time series, please? I think that Dr. Paul Gilbert may have

[R] Predict GARCH

2009-06-10 Thread Daniel Mail
hello, i was trying to predict values for a garch, so i did: predict(fitgarch,n.ahead = 20) but this doesn't work. Someone can tell me how to get the 20 values ahead of a garch model. thanks in advance _ O

[R] (sem assunto)

2009-06-10 Thread Daniel Mail
hello, i was trying to predict values for a garch, so i did: predict(fitgarch,n.ahead = 20) but this doesn't work. Someone can tell me how to get the 20 values ahead of a garch model. thanks in advance _

Re: [R] Problem : solving a equation with R , fail with uniroot function

2009-06-10 Thread Ben Bolker
yann lancien wrote: Thanks for your help ! I got another problem with my function : test - function(x,bb0=-3,bb1=5,c0=2,r0=0) { ((exp(c0-r0)*(bb0+x)*(bb1-x))/((bb0+x+1)*(bb1-x-1))-1)} With this : curve(test(x),from=-10,to=10) we can see that there are 2 roots : one in [3,4] and

Re: [R] Comparing R and SAS

2009-06-10 Thread Terry Therneau
Satish, There are nearly as many opinions as people on this question. So accept these as my views only. 1. I have written S packages, SAS procedures and SAS macros over my career. S was specifically designed for extensibility and it shows. The ratio of time to get a new statistical

Re: [R] Creating a specific skewed distribution

2009-06-10 Thread Mike Lawrence
With skewed unimodal distributions, the mode can't equal the mean, so assuming you want the mean to be around 30, I find that a weibull function can get close to what you want: mean(rweibull(1e5,1.5,33)) [1] 29.77781 pweibull(60,1.5,33) [1] 0.9138475 I'm sure you can play with the parameters

[R] Merge data frame and keep unmatched

2009-06-10 Thread Etienne B. Racine
Hi, With two data sets, one complete and another one partial, I would like to merge them and keep the unmatched lines. The problem is that merge() dosen't keep the unmatched lines. Is there another function that I could use to merge the data frames. Example: completedf -

Re: [R] Merge data frame and keep unmatched

2009-06-10 Thread Marc Schwartz
On Jun 10, 2009, at 8:56 AM, Etienne B. Racine wrote: Hi, With two data sets, one complete and another one partial, I would like to merge them and keep the unmatched lines. The problem is that merge() dosen't keep the unmatched lines. Is there another function that I could use to

Re: [R] Merge data frame and keep unmatched

2009-06-10 Thread Gabor Grothendieck
Try: merge(completedf, partdf, all.x = TRUE) or library(sqldf) # see http://sqldf.googlecode.com sqldf(select * from completedf left join partdf using(beta, alpha)) On Wed, Jun 10, 2009 at 9:56 AM, Etienne B. Racineetienn...@gmail.com wrote: Hi, With two data sets, one complete and

Re: [R] Creating a specific skewed distribution

2009-06-10 Thread Etienne B. Racine
You could also make some algebra. e.g. : ?rweibull gives the formula of the mean and of the cumulative distribution function in the Details section. So using your known parameters (i.e. mean=30 and p(10)=.10, i.e. cumulative function(10) =.90), I think it is sufficient to determine the exact

[R] MCMC validity question

2009-06-10 Thread Thomas Mang
Hello, I have quite a tough problem, which might be able to be solved by MCMC. I am fairly new to MCMC (in the learning process) - so apologize if the answer is totally obvious, and any hints, links etc are greatly appreciated. I'll illustrate the problem in a version cut-down to the

[R] How to get the unique pairs of a set of pairs dataframe ?

2009-06-10 Thread Moumita Das
Hi friends, Please can anyone help me with an easier solution of doing the below mentioned work. Suppose i have a dataset like this:--- i1 i2 i3 i4 i5 1 7 13 1 2 2 8 14 2 2 3 9 15 3 3 4 10 16 4 4 5 11 17 5 5 6 12 18 6 7 *i1,i2,i3,i4,i5 are my items.I am able to find all

[R] Using yum to install R-2.9

2009-06-10 Thread Saptarshi Guha
Hello, On Fedora 8, yum install R , installs R-2.6. I dont have much experience with yum, how do change the repos(?) to install R-2.9? Thank you Saptarshi __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] How to get the unique pairs of a set of pairs dataframe ?

2009-06-10 Thread Henrique Dallazuanna
Try this: do.call(rbind, apply(combn(names(x), 2), 2, function(n)expand.grid(x[,n[1]], x[,n[2]]))) On Wed, Jun 10, 2009 at 11:47 AM, Moumita Das das.moumita.onl...@gmail.comwrote: Hi friends, Please can anyone help me with an easier solution of

Re: [R] How to get the unique pairs of a set of pairs dataframe ?

2009-06-10 Thread jim holtman
?combn x [1] i1 i2 i3 i4 i5 combn(x,2) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] i1 i1 i1 i1 i2 i2 i2 i3 i3 i4 [2,] i2 i3 i4 i5 i3 i4 i5 i4 i5 i5 On Wed, Jun 10, 2009 at 10:47 AM, Moumita Das das.moumita.onl...@gmail.comwrote: Hi friends, Please can anyone help me with

[R] checking and building ROracle on OS X

2009-06-10 Thread Rajarshi Guha
Hi, I'm running R 2.9.0 (from the DMG) on OS X 10.5 and am trying to get ROracle 0.5-9 to check and build. I have installed the full Oracle installation (10.2.0.4.0). The problem I'm facing is that I need to compile ROracle.so as 32 bit, but my environment needs to point to the 64 bit Oracle libs

[R] Best way to plot a Matrix of all possible pair combinations

2009-06-10 Thread suparna mitra
Hallo R Users, I have some distance matrix data like M[1:10,] [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.875 0.500 0.500 0.375 0.625 0. [2,] 0.8928571 1.000 0.000 0.8928571 0.1071429 0. [3,] 0.8928571 1.000

[R] GeoXp package

2009-06-10 Thread Poizot Emmanuel
Dear all, I would like to use GeoXp package under Ubuntu Jaunty. I did install the required package GeoXp, for which I had to install before rgdal package. So when done, I want to load the library (library(GepXp), I got the error when GeoXP want to load rgdal package: library(sp)

[R] Delta in time series

2009-06-10 Thread koj
Hi all, I have time data in the following format: 2009-03-09 12:00:00 2009-03-09 13:30:00 Now I want to compute the delta between the two time points, which results in this example in 1,5 h. I tried this via ts and the related functions but so far without sucess. Can anybody help me? Thank

[R] R: Best way to plot a Matrix of all possible pair combinations

2009-06-10 Thread suparna mitra
Hallo R Users, Please help I have some distance matrix data like M[1:10,] [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.875 0.500 0.500 0.375 0.625 0. [2,] 0.8928571 1.000 0.000 0.8928571 0.1071429 0. [3,] 0.8928571

Re: [R] Delta in time series

2009-06-10 Thread koj
koj wrote: Hi all, I have time data in the following format: 2009-03-09 12:00:00 2009-03-09 13:30:00 Now I want to compute the delta between the two time points, which results in this example in 1,5 h. I tried this via ts and the related functions but so far without sucess. Can

Re: [R] graphically representing frequency of words in a speech?

2009-06-10 Thread Brown, Tony Nicholas
Yihui, This is quite impressive, thanks for helping me think about how to make tag clouds in R. Tony -Original Message- From: Yihui Xie [mailto:xieyi...@gmail.com] Sent: Wednesday, June 10, 2009 3:15 AM To: Brown, Tony Nicholas Cc: r-help@r-project.org Subject: Re: [R] graphically

Re: [R] Delta in time series

2009-06-10 Thread Gabor Grothendieck
Try this: library(zoo) Lines - 2009-03-09 12:00:00,1 + 2009-03-09 13:30:00,2 z - read.zoo(textConnection(Lines), sep = ,, tz = ) 1/frequency(as.zooreg(z)) [1] 5400 noting that 5400 seconds is 1.5 hours. On Wed, Jun 10, 2009 at 5:04 AM, kojjens.k...@gmx.li wrote: Hi all, I have time data

Re: [R] SSOAP failing

2009-06-10 Thread Olivier Cailloux
Duncan Temple Lang a écrit : Olivier Cailloux wrote: Duncan Temple Lang a écrit : Olivier Cailloux wrote: Dear list, Sorry about that, my e-mail has been sent too soon by mistake (also from an incorrect exp. address). I was planning to add further details. So I'm running Debian Lenny.

Re: [R] Using yum to install R-2.9

2009-06-10 Thread Marc Schwartz
On Jun 10, 2009, at 9:53 AM, Saptarshi Guha wrote: Hello, On Fedora 8, yum install R , installs R-2.6. I dont have much experience with yum, how do change the repos(?) to install R-2.9? Thank you Saptarshi Upgrade to a still supported version of Fedora. Fedora 8 went EOL back in January,

Re: [R] Creating a specific skewed distribution

2009-06-10 Thread David Arnold
Etienne et al, This is exactly what I need. So I gave it an algebraic try and set: Mean=30=b*gamma(1+1/a), solve for b and substitute into F(60)=0.10. After a little algebra, this left me with [ 2*gamma(1+1/a) ]^a = -ln(0.10) Now, I don't think this has a closed form solution, at least

Re: [R] Creating a specific skewed distribution

2009-06-10 Thread Ravi Varadhan
Here is one way to solve the equation: require(BB) f - function(x) (2*gamma(1+1/x))^x + log (0.10) ans - dfsane(par=1, fn=f) ans Ravi. --- Ravi Varadhan, Ph.D. Assistant

[R] Two-sided log axis

2009-06-10 Thread John Wiedenhoeft
Hi, I have two curves that are best displayed using a logarithmic y-axis. I want to plot the difference of these curves, which means I would need a log scaling on both the negative and the positive side (i.e. the y-axis should be -100 -10 -1 0 1 10 100). Zero values should not be discarded.

Re: [R] Two-sided log axis

2009-06-10 Thread David Winsemius
I would not have called such an axis logarithmic since the logarithm function is bounded below at 0, but I think that what you seek will be found among the examples that accompany Sarkar's book, chapter 8, figures 8.3 - 8.5: http://lmdvr.r-forge.r-project.org/figures/figures.html On Jun

Re: [R] Two-sided log axis

2009-06-10 Thread David Winsemius
On Jun 10, 2009, at 12:23 PM, David Winsemius wrote: I would not have called such an axis logarithmic since the logarithm function is bounded below at 0, (I meant to say that arguments to log are bounded at zero.) but I think that what you seek will be found among the examples that

[R] Analisys in Multidimensional contingency tables

2009-06-10 Thread José Ignacio Bustos Melo
Dear R-list, Hi everyone, Im trying to make an analysis of multidimensional contingency tables using R. I' working with the Agresti example where you have the data from 3 categories. The thing is how can I do the analisys using the G2 statistics. Somebody can send me an Idea? I attach the

Re: [R] Predict GARCH

2009-06-10 Thread bogaso.christofer
Suppose the GARCH(1,1) equation is : Sigma[t]^2 = w + a* Sigma[t-1]^2 + b*r[t-1]^2 One step ahead forecast : Sigma[t+1]^2 = w + a* Sigma[t]^2 + b*r[t]^2 All informations are available here Two step ahead forecast : Sigma[t+2]^2 = w + a* Sigma[t+1]^2 + b*r[t+1]^2 Here r[t+1] is not known at

Re: [R] is it possible to combine multiple barplots?

2009-06-10 Thread Philipp Schmidt
Thank you for the helpful reply! I am relatively new to R (the software and the community) and was not aware of the example galler. Now I am. The example you found looks very close to what I am trying to do and I should be able to modify it. Best - P On Tue, Jun 9, 2009 at 4:45 PM, Titus von der

Re: [R] Analisys in Multidimensional contingency tables

2009-06-10 Thread Tobias Verbeke
Hi José, Hi everyone, Im trying to make an analysis of multidimensional contingency tables using R. I' working with the Agresti example where you have the data from 3 categories. The thing is how can I do the analisys using the G2 statistics. Somebody can send me an Idea? Please find below a

Re: [R] is it possible to combine multiple barplots?

2009-06-10 Thread Ben Bolker
philipp schmidt-3 wrote: i am working with two sets of likert scale type (4 distinct values) data: dataA - rep(1:4, c(3,2,2,4)) dataB - rep(1:4, c(5,4,3,2)) i can now (bar)plot both of these separately and compare the distributions. plot(table(dataA), type='h') plot(table(dataB),

Re: [R] Creating a specific skewed distribution

2009-06-10 Thread Ravi Varadhan
There are actually two roots to your equation: 0.329 and 1.385. f - function(x) (2*gamma(1+1/x))^x + log (0.10) x - seq(0.1, 5, length=500) plot(x, fn(x), type=l) abline(h = 0, lty=2, col=2) Ravi.

[R] Extracting Sequence Data from a Vector

2009-06-10 Thread Eric Vander Wal
Thanks in advance. I have a vector of numbers which contain sections that are sequences which increase by a value of 1 followed by a gap in the data and then another sequence occurs, etc: x-c(1:3, 6: 7, 10:13) From the vector I need to extract 2 items of information A) the first number in

Re: [R] Extracting Sequence Data from a Vector

2009-06-10 Thread jim holtman
try this: x [1] 1 2 3 6 7 10 11 12 13 # find breaks breaks - c(FALSE, diff(x) != 1) # now create matrix with groupings (just for visual) z - data.frame(x, cumsum(breaks)) # create list with first element of each seq and the length t(sapply(split(z, z[,2]), function(b) c(b[1,1],

Re: [R] rgl vertices

2009-06-10 Thread Duncan Murdoch
On 6/10/2009 1:44 PM, kapo coulibaly wrote: I'm trying to make sense of the following example in the package rgl: vertices - c( -1.0, -1.0, 0, 1.0, 1.0, -1.0, 0, 1.0, 1.0, 1.0, 0, 1.0, -1.0, 1.0, 0, 1.0 ) indices - c( 1, 2, 3, 4 ) open3d() wire3d(

Re: [R] Extracting Sequence Data from a Vector

2009-06-10 Thread David Winsemius
On Jun 10, 2009, at 1:28 PM, Eric Vander Wal wrote: Thanks in advance. I have a vector of numbers which contain sections that are sequences which increase by a value of 1 followed by a gap in the data and then another sequence occurs, etc: x-c(1:3, 6: 7, 10:13) From the vector I need to

Re: [R] Extracting Sequence Data from a Vector

2009-06-10 Thread baptiste auguie
jim holtman wrote: try this: Oh well, i spent the time writing this so i might as well post my (almost identical) solution, x-c(1:3, 6: 7, 10:13) breaks = c(TRUE, diff(x) != 1) data.frame(start = x[breaks], length = tabulate(cumsum(breaks))) Hoping this works, baptiste x

[R] rgl vertices

2009-06-10 Thread kapo coulibaly
I'm trying to make sense of the following example in the package rgl: vertices - c( -1.0, -1.0, 0, 1.0, 1.0, -1.0, 0, 1.0, 1.0, 1.0, 0, 1.0, -1.0, 1.0, 0, 1.0 ) indices - c( 1, 2, 3, 4 ) open3d() wire3d( qmesh3d(vertices,indices) ) One would think that each

[R] tracking progress of loading large dataset into R for updating progress bar

2009-06-10 Thread Harsh
Hello UseRs, I am creating a GUI application in R using the RGtk2 library. I have incorporated a progress bar which I want to refresh periodically in keeping with the progress/completion of the read.csv function. I would like to show the progress bar in animation (pulsing of the bar) for as long

[R] by and by: using two indices in by() or tapply()

2009-06-10 Thread christiaan pauw
Hi everyone I want to apply a function by two indices. I have a number of surveyors submitting questionnaires. I want to check the time of the first submission for the day for each surveyor and also see a NA is no submission was done on a particular day. This generates a sample of the data:

Re: [R] by and by: using two indices in by() or tapply()

2009-06-10 Thread Henrique Dallazuanna
Try this: tapply(starttime,list(submitdate, surveyor),min) On Wed, Jun 10, 2009 at 4:20 PM, christiaan pauw cjp...@gmail.com wrote: Hi everyone I want to apply a function by two indices. I have a number of surveyors submitting questionnaires. I want to check the time of the first

Re: [R] Delta in time series

2009-06-10 Thread christiaan pauw
Or x=c(2009-03-09 12:00:00,2009-03-09 13:30:00) y=data.frame(x) attach(y) x=as.POSIXlt(x) x[1]-x[2] On Wed, Jun 10, 2009 at 5:04 AM, kojjens.k...@gmx.li wrote: I have time data in the following format: 2009-03-09 12:00:00 2009-03-09 13:30:00 [[alternative HTML

Re: [R] GeoXp package

2009-06-10 Thread Zeljko Vrba
On Wed, Jun 10, 2009 at 08:21:06AM +0200, Poizot Emmanuel wrote: Error in fun(...) : GDAL Error 1: libgrass_I.so: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type (sorry for the french :) ) It would have been far more useful had you translated the error

[R] gpc.poly datatype

2009-06-10 Thread Derek Lacoursiere
I have a list of polygons generated by the contourLines() command (each object of the list is a list in itself with two objects: a vector of x values, and a vector of y values for each vertex). I wish to convert that list into a gpc.poly object of multiple contours. How do I do this? gpclib

Re: [R] Predict GARCH

2009-06-10 Thread Liviu Andronic
Hello, On 6/10/09, Daniel Mail d20...@live.com.pt wrote: i was trying to predict values for a garch, so i did: predict(fitgarch,n.ahead = 20) but this doesn't work. Someone can tell me how to get the 20 values ahead of a garch model. You didn't specify what function you used to obtain

[R] nonparametric test for row of a matrix

2009-06-10 Thread Stefo Ratino
Hi, Are there any nonparametric test for ordinal categorical data for row of a matrix?   Thank you very much, Stefo [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] Difficulties with the simpest table

2009-06-10 Thread Dmitry Gospodaryov
I have the data arranged in table (in Excel, or Notepad): x y 0 100 2 100 4 80 6 40 8 0 I need to transfer these data in R file and then going to operate with x and y as with variables. I should note, that I

[R] How to extract from a matrix based on indices in a vector?

2009-06-10 Thread Logickle
Sorry, there may be some lingo for describing the extraction problem I have, but I don't know it. I have a matrix of 2 rows and N columns, and a vector of N 1s and 2s. Matrix M: 1 2 3 4 ... N 1A C D G ... 2B D F H ... Vector v:

[R] problem with PCA loading plot

2009-06-10 Thread Fireblast
Hi, I am a beginner with R. I would like to get a loading plot of PC 3 vs PC 1. For PC 1 vs PC 2 I use library(pls) loadingplot(pca.result, comps = 1:2, scatter = TRUE, labels=names) if I try loadingplot(pca.result, comps = 1:3, scatter = TRUE, labels=names) I get the loading plots of PC

[R] Vista + R = *!!?@

2009-06-10 Thread John Townsend-Mehler
Hello People of R, Is there any way that I can get R to function properly using Vista. I get very strange output using lmer, as in no p-values. Is there ANY way I can fix this. Thank you for your time, John Townsend-Mehler PhD Candidate Department of Zoology Michigan State University

Re: [R] Vista + R = *!!?@

2009-06-10 Thread Marc Schwartz
On Jun 10, 2009, at 1:57 PM, John Townsend-Mehler wrote: Hello People of R, Is there any way that I can get R to function properly using Vista. I get very strange output using lmer, as in no p-values. Is there ANY way I can fix this. That's not a Vista issue, it is a statistical

Re: [R] Difficulties with the simpest table

2009-06-10 Thread Liviu Andronic
Hello Dmitry, On 6/10/09, Dmitry Gospodaryov gospodar...@rambler.ru wrote: I have the data arranged in table (in Excel, or Notepad): x y 0 100 2 100 4 80 6 40 8 0 I need to transfer these data in R

[R] Preventing .Call from printing a blank line to the R console on Windows

2009-06-10 Thread Joel
Hello everyone, I am using the CVODES integrator in the Rsundials package. Every time I call the integrator, a blank line is printed in the console. Using debug, I was able to isolate the problem to this line in the function cvodes(...): solutions = .Call(cvodes, PACKAGE = Rsundials,

Re: [R] Difficulties with the simpest table

2009-06-10 Thread Marc Schwartz
On Jun 10, 2009, at 11:27 AM, Dmitry Gospodaryov wrote: I have the data arranged in table (in Excel, or Notepad): x y 0 100 2 100 4 80 6 40 8 0 I need to transfer these data in R file and then going to

[R] Performance Data Analysis Class using R

2009-06-10 Thread Red Roo
GUERRILLA DATA ANALYSIS TECHNIQUES (GDAT) http://www.perfdynamics.com/Classes/Outlines/gdata.html with an emphasis on R and PDQ-R modeling tools http://www.perfdynamics.com/Tools/PDQ-R.html

[R] Comparing R and SAs

2009-06-10 Thread jude.ryan
Satish, For a comparison of SAS and S, see the document An Introduction to S and the Hmisc and Design Libraries by Carlos Alzola and Frank E. Harrell. Frank Harrell is an expert in both SAS and R. You can download this document from http://www.r-project.org/, then click on manuals, and then

Re: [R] gpc.poly datatype

2009-06-10 Thread Duncan Murdoch
On 10/06/2009 1:53 PM, Derek Lacoursiere wrote: I have a list of polygons generated by the contourLines() command (each object of the list is a list in itself with two objects: a vector of x values, and a vector of y values for each vertex). I wish to convert that list into a gpc.poly object of

Re: [R] Preventing .Call from printing a blank line to the R console on Windows

2009-06-10 Thread Duncan Murdoch
On 10/06/2009 5:16 PM, Joel wrote: Hello everyone, I am using the CVODES integrator in the Rsundials package. Every time I call the integrator, a blank line is printed in the console. Using debug, I was able to isolate the problem to this line in the function cvodes(...): solutions =

Re: [R] How to extract from a matrix based on indices in a vector?

2009-06-10 Thread Marc Schwartz
On Jun 10, 2009, at 12:36 PM, Logickle wrote: Sorry, there may be some lingo for describing the extraction problem I have, but I don't know it. I have a matrix of 2 rows and N columns, and a vector of N 1s and 2s. Matrix M: 1 2 3 4 ... N 1A C D G

Re: [R] How to extract from a matrix based on indices in a vector?

2009-06-10 Thread Marc Schwartz
On Jun 10, 2009, at 6:26 PM, Marc Schwartz wrote: On Jun 10, 2009, at 12:36 PM, Logickle wrote: Sorry, there may be some lingo for describing the extraction problem I have, but I don't know it. I have a matrix of 2 rows and N columns, and a vector of N 1s and 2s. Matrix M: 1

[R] smooth.spline() fucntion

2009-06-10 Thread array chip
Hi, all, I found that the smooth.spline() function produces different results between R and S-Plus. I was trying to play different parameters of the function without any success. The script of the function contains Fortran code, so it seems impossible to port the code from S-Plus to R (or I

Re: [R] How to extract from a matrix based on indices in a vector?

2009-06-10 Thread William Dunlap
Subscripting by a 2-column matrix M[cbind(v, seq_len(ncol(M)))] uses much less space (hence time) than making the ncol(M) by ncol(M) intermediate matrix just to extract its diagonal. E.g. test - function(n, seed) { if (!missing(seed)) set.seed(seed) M - matrix(sample(LETTERS,

Re: [R] How to extract from a matrix based on indices in a vector?

2009-06-10 Thread Marc Schwartz
On Jun 10, 2009, at 7:05 PM, William Dunlap wrote: Subscripting by a 2-column matrix M[cbind(v, seq_len(ncol(M)))] uses much less space (hence time) than making the ncol(M) by ncol(M) intermediate matrix just to extract its diagonal. E.g. test - function(n, seed) { if (!missing(seed))

Re: [R] How to extract from a matrix based on indices in a vector?

2009-06-10 Thread David Winsemius
On Jun 10, 2009, at 1:36 PM, Logickle wrote: Sorry, there may be some lingo for describing the extraction problem I have, but I don't know it. I have a matrix of 2 rows and N columns, and a vector of N 1s and 2s. Matrix M: 1 2 3 4 ... N 1A C D G

[R] Help on drawing stars and radars in R

2009-06-10 Thread Caroline Gideon-Adeniyi
Hi I don't know if you can help. I am a 2nd year Bsc Cosmetic Science student and in R I need some help in drawing stars. The problem that I have is I want to recreate a radar diagram similar to the one in excel. I have put in these commands in a script window: stars(shampoo1[, 1:6],

  1   2   >