Re: [R] Doubt on using lattice

2010-10-19 Thread Dennis Murphy
Hi: On Mon, Oct 18, 2010 at 11:32 PM, Cristina Ramalho < cristina.rama...@grs.uwa.edu.au> wrote: > Hi all, > > I suppose this is a very simple question, but as I've lost already a bit of > time with it, without being able to get what I wanted, I'm addressing the > question to the group in the hop

Re: [R] For-loop dummy variables?

2010-10-19 Thread Phil Spector
I always find R useful to solve problems like this: dummy = as.numeric(cleary$D1 %in% c(4,6,7)) If, for some reason you want to use a loop, try dummy <- matrix(NA, nrow=nrow(cleary), ncol=1) for (i in 1:length(cleary$D1)){ if (cleary$D1[i] %in% c(4,6,7)){dummy[i] = 1} else {dummy[

Re: [R] Extracting elements from a nested list

2010-10-19 Thread Erich Neuwirth
mapply(function(x1,x2)x1[[x2]],all.predicted.values,max.growth,SIMPLIFY=FALSE) gives a list of factors. On 10/18/2010 8:40 PM, Gregory Ryslik wrote: > Hi Everyone, > > This is closer to what I need but this returns me a matrix where each > element is a factor. Instead I would want a list of lis

Re: [R] For-loop dummy variables?

2010-10-19 Thread Adrian Dusa
gravityflyer yahoo.com> writes: > > Hi everyone, > > I've got a dataset with 12,000 observations. One of the variables > (cleary$D1) is for an individual's country, coded 1 - 15. I'd like to create > a dummy variable for the Baltic states which are coded 4,6, and 7. In other > words, as a dummy

[R] Milliseconds and Time object

2010-10-19 Thread statquant2
Hello all, my question for today is the following : I have 1. a date (in a string but straightforward to convert to any format) 2. the time as the number of milliseconds elapsed since hour 00:00:00.000 of this date. My question is : 1. Is there a in built function that can give me the date+time

[R] package vars doesn´t working

2010-10-19 Thread 敷田治誠 クラウジオ
Hello, I was using R (v.2.11.1, 32 bits) and I did the upgrade to R (v.2.12.0, 64 bits). I followed the instructions in R´s FAQ (What´s the best way to upgrade, question 2.8) and updated my packages. However, now, I can´t use the library "vars". When I call it, there is an error message concerning

Re: [R] package vars doesn´t working

2010-10-19 Thread Pfaff, Bernhard Dr.
Dear Claudio, hard to tell without further information, but I reckon that you: 1) have a secondary library in use 2) have installed the packages 'vars' **and** 'MASS' installed into this secondary library If so, remove the package 'MASS' from this secondary library (it's shipped in the standar

Re: [R] calculate power of test

2010-10-19 Thread Dennis Murphy
Hi: One answer comes from the pwr.r.test() function in package pwr (read its code to see how it calculates power): pwr.r.test(n = 100, r = 0.2, sig.level = 0.05, alternative = 'two.sided') approximate correlation power calculation (arctangh transformation) n = 100

[R] Implementing R's recycling rule

2010-10-19 Thread Rainer M Krug
Hi I want to use R's recycling rule. At the moment I am using the following: x <- c(1, 2, 3) n <- 10 ## so using the recycling rules, I would like to get from FUN(x, n)==1 ## I am doing: xRecycled <- rep(x, length.out=n)[n] This works, but it seems to me that I am missing something really basic

Re: [R] package vars doesn´t working

2010-10-19 Thread 敷田治誠 クラウジオ
Dear prof. Pfaff, Your answer just solved my problem. I removed the MASS package and just reinstalled urca package. Now everything is ok. Thank you so much for your time and attention. Claudio On Tue, Oct 19, 2010 at 5:27 AM, Pfaff, Bernhard Dr. < bernhard_pf...@fra.invesco.com> wrote: > Dear

Re: [R] Implementing R's recycling rule

2010-10-19 Thread Richard . Cotton
> x <- c(1, 2, 3) > n <- 10 > ## so using the recycling rules, I would like to get from FUN(x, n)==1 > ## I am doing: > xRecycled <- rep(x, length.out=n)[n] > > This works, but it seems to me that I am missing something really basic here > - is there more straightforward way of doing this? x[n

[R] Ideas for World Statistics Day

2010-10-19 Thread Patrick Burns
World Statistics Day is October 20. This seems like a good excuse to advertise statistics (and a bit of R) to a world that could surely use more thoughtfulness. Here is a blog post with some ideas: http://www.portfolioprobe.com/2010/10/19/ideas-for-world-statistics-day/ Additional ideas are cert

[R] nls & optimize

2010-10-19 Thread Muhammad Rahiz
Hi all, I'm plotting to get the intersection value of three curves. Defining the x-axis as dsm, the following code works; dsm = c(800,600,NA,525,NA,450,400,NA,NA,NA,0) s3 = seq(0.05,1.05,0.1) plot(dsm,s3,col="blue",las=1,ylab="fraction",xlab="distance (km)") fc <- function(x,a,b){a*exp(-b*x)

Re: [R] Implementing R's recycling rule

2010-10-19 Thread Rainer M Krug
On Tue, Oct 19, 2010 at 11:30 AM, wrote: > > x <- c(1, 2, 3) > > n <- 10 > > ## so using the recycling rules, I would like to get from FUN(x, n)==1 > > ## I am doing: > > xRecycled <- rep(x, length.out=n)[n] > > > > This works, but it seems to me that I am missing something really basic > here >

Re: [R] Implementing R's recycling rule

2010-10-19 Thread Erich Neuwirth
On 10/19/2010 11:47 AM, Rainer M Krug wrote: >> x[n %% length(x)] gives you the same answer as rep(x, length.out=n)[n], >> without having to create the longer vector. >> n %% length(x) may return 0 and in that case, x[n %% length(x)] will not give the result you expect. x[((n - 1) %% length(x

Re: [R] Milliseconds and Time object

2010-10-19 Thread jim holtman
Is this what you are after: > date <- '2010-10-19' > as.POSIXct(date) [1] "2010-10-19 EDT" > milli <- 360 # one hour in milliseconds > as.POSIXct(date) + milli / 1000 [1] "2010-10-19 01:00:00 EDT" > On Tue, Oct 19, 2010 at 3:24 AM, statquant2 wrote: > > Hello all, > my question for today i

[R] ancova help

2010-10-19 Thread Jacob Kasper
I am trying to run an ancova and am having trouble setting it up properly. I have nearly 10,000 measurements of fish length, girth and stage of sexual development. I am suspicious that the stage of development is affecting the length (as they get full of eggs they get more round and are more diffic

[R] Question on ar() in stats

2010-10-19 Thread K Wheel
Hi, I have a question about the ar function in the stats package, it is a method to use autoregressive models for time series. Now I have a time series, which I performed a spectral analysis on. This gives a spectrum with a quite impressive peak at a certain frequency. The AR1 function I wa

[R] points(x,y), mean and standard deviation

2010-10-19 Thread ashz
Hi, I have a data set with 3 rows (X=date, Y1=arithmetic mean and Y2=standard deviation). How can I create a graph(e.g., points) which will show the +-stdev as well (similar to excel). Thanks -- View this message in context: http://r.789695.n4.nabble.com/points-x-y-mean-and-standard-deviatio

Re: [R] For-loop dummy variables?

2010-10-19 Thread Adrian Dusa
On Tuesday 19 October 2010, Phil Spector wrote: > I always find R useful to solve problems like this: > >dummy = as.numeric(cleary$D1 %in% c(4,6,7)) Indeed, and this works too: dummy <- 1*(cleary$D1 %in% c(4,6,7)) Adrian -- Adrian Dusa Romanian Social Data Archive 1, Schitu Magureanu Bd.

[R] Sample in R

2010-10-19 Thread emj83
Hi, Please can someone tell me if using sample() in R is actually a quick way of doing the Inverse Transform Sampling Method? Many thanks Emma -- View this message in context: http://r.789695.n4.nabble.com/Sample-in-R-tp3001818p3001818.html Sent from the R help mailing list archive at Nabble.

[R] ANOVA stuffs_How to save each result from FOR command?

2010-10-19 Thread BumSeok Jeong
Dear R experts, I'm new in R and a beginner in terms of statistics. It should be simple question, but definitely difficult to solve it by myself. I'd like to see main effect of group(gender: sample size is different(M:F=23:18) and one of condition(cond) and the interaction at each subset from 90

Re: [R] R 2.12.0 - malware detect by antivirus software

2010-10-19 Thread Paulo Barata
Dr. Murdoch and Dr. Ligges, After my contacts with Avira, it seems that the issue caused by their antivirus software (a false positive alarm) has been solved. Now I have been able to install R 2.12.0 flawlessly. Thank you. Paulo Barata -

Re: [R] ANOVA stuffs_How to save each result from FOR command?

2010-10-19 Thread jim holtman
Here is how you can get the results back in a list that you can then analyze: results_ezANOVA <- list() for(i in 1:90) { results_ezANOVA[[i]] <- ezANOVA(data=subset(ast.ast_coef, ast.ast_coef$coef_thr==i), dv=.(ast.values), between=.(gender), wid=.(subj), within=.(cond

[R] ancova help

2010-10-19 Thread Jacob Kasper
I am trying to run an ancova and am having trouble setting it up properly. I have nearly 10,000 measurements of fish length, girth and stage of sexual development. I am suspicious that the stage of development is affecting the length (as they get full of eggs they get more round and are more diffic

[R] How to read only ten rows from a SAS dataset (read.ssd)?

2010-10-19 Thread johannes rara
I'm trying to read SAS datasets on Windows: sashome <- "C:/Program Files/SAS/SAS 9.1" fold <- "C:/temp" g <- read.ssd(fold, "sasfile", sascmd = file.path(sashome, "sas.exe")) How to get only e.g first ten rows into R? -J __ R-help@r-project.org mailin

Re: [R] R 2.12.0 - malware detect by antivirus software

2010-10-19 Thread Duncan Murdoch
Paulo Barata wrote: Dr. Murdoch and Dr. Ligges, After my contacts with Avira, it seems that the issue caused by their antivirus software (a false positive alarm) has been solved. Now I have been able to install R 2.12.0 flawlessly. Thanks for following up on this. Duncan Murdoch Thank you

[R] [R 2.12] install.packages() with no lib argument does not work

2010-10-19 Thread vincent chouraki
Dear R users, I have just upgraded R from 2.11 to 2.12 on Ubuntu 9.04 (see more informations at the end) from the cran apt-get repository. One of the new things concerning the install.packages() function is stated here : install.packages() and remove.packages() with lib unspecified and

[R] readLines: how to make a data.frame?

2010-10-19 Thread johannes rara
I have a text file containing data: Som text :: asdf @ 1 ds $ 5. /*Edmp */ @ 8 asu $ 3. /*daf*/ @ 8 asdala $ 2. /*asdfa*/ @ 13 astun $ 11. /*daf */ @ 26 dft $ 3. /*asdf */ @ 31 dsfp $ 2. /*asdf */ asjk asdfö My intention is to create a dataframe from this data (only rows

Re: [R] Milliseconds and Time object

2010-10-19 Thread peter dalgaard
On Oct 19, 2010, at 12:12 , jim holtman wrote: > Is this what you are after: > >> date <- '2010-10-19' >> as.POSIXct(date) > [1] "2010-10-19 EDT" >> milli <- 360 # one hour in milliseconds >> as.POSIXct(date) + milli / 1000 > [1] "2010-10-19 01:00:00 EDT" >> > Beware timezone and DST iss

Re: [R] [R 2.12] install.packages() with no lib argument does not work

2010-10-19 Thread Prof Brian Ripley
Looks like this may be a problem in the French translations. Please try with LANGUAGE=en. On Tue, 19 Oct 2010, vincent chouraki wrote: Dear R users, I have just upgraded R from 2.11 to 2.12 on Ubuntu 9.04 (see more informations at the end) from the cran apt-get repository. One of the new thi

Re: [R] points(x,y), mean and standard deviation

2010-10-19 Thread Jim Lemon
On 10/19/2010 07:41 PM, ashz wrote: Hi, I have a data set with 3 rows (X=date, Y1=arithmetic mean and Y2=standard deviation). How can I create a graph(e.g., points) which will show the +-stdev as well (similar to excel). Hi ashz, See FAQ 7.38. Jim ___

Re: [R] Lattice: type="p" stopped working in panel.average

2010-10-19 Thread Deepayan Sarkar
On Tue, Oct 19, 2010 at 4:18 PM, Alexandr Malusek wrote: > Hi, > > The behavior of panel.average has changed.  In March 2010, I plotted > the attached r_plotViolinOfAnnualE_old.eps. (I don't know the version > of R). Today, I plotted the attached r_plotViolinOfAnnualE_new.eps > using R version 2.1

Re: [R] ANOVA stuffs_How to save each result from FOR command?

2010-10-19 Thread Liviu Andronic
Hello On Tue, Oct 19, 2010 at 12:16 PM, BumSeok Jeong wrote: > Dear R experts, > > I'm new in R and a beginner in terms of statistics. > It should be simple question, but definitely difficult to solve it by > myself. > > I'd like to see main effect of group(gender: sample size is > different(M:F=

[R] Tif image to 8bit colour matrix.

2010-10-19 Thread Roger Gill
Dear listers, I have a collection of tif images that I would like to convert, in R, to a matrix containing the values of the 8bit colour. Ideally, I would like a matrix for each of the colour channels (red, blue and green). I have 'googled' and searched the help list but have yet to find a solu

[R] Part time equity tick data high frequency trading research

2010-10-19 Thread aquatrade
Hi, There seems to be no subsection for work related postings, so please excuse me if this is in the wrong place. I am looking for an English speaking person with very strong R Language, statistics and some financial math knowledge to do statistical research into USA stock tick data. You are p

Re: [R] Question of "Quantile Regression for Longitudinal Data"

2010-10-19 Thread ywh123
Thanks for your help RKoenker I want to deal with the problem through bootstrap.so I can get p-value and T-statistics. Do you think so? -- View this message in context: http://r.789695.n4.nabble.com/Question-of-Quantile-Regression-for-Longitudinal-Data-tp883458p3001875.html Sent from the R he

[R] Problems with a specific calculate.

2010-10-19 Thread Toni López Mayol
Hello friends of R, My name is Toni, i'm 25 and I'm working on the Meteorological Investigation team from Balearic Islands. I had contact to you because I have a problem: I done a file for every day since 1912 about precipitation. That file has the following structure: > str(Ast) Loading req

[R] points( .... pch=2) substitue pch with image

2010-10-19 Thread Knut Krueger
Hi to all, is there any function where I can substitute the characters with an (jpg) image ? Kind regards Knut __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.or

[R] Re : [R 2.12] install.packages() with no lib argument does not work

2010-10-19 Thread vincent chouraki
It seems indeed that it is a locale issue : > Sys.getlocale() [1] "LC_CTYPE=fr_FR.UTF-8;LC_NUMERIC=C;LC_TIME=fr_FR.UTF-8;LC_COLLATE=fr_FR.UTF-8;LC_MONETARY=C;LC_MESSAGES=fr_FR.UTF-8;LC_PAPER=fr_FR.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=fr_FR.UTF-8;LC_IDENTIFICATION=C" > inst

Re: [R] Tif image to 8bit colour matrix.

2010-10-19 Thread Michael Sumner
This requires the rgdal and sp packages to be installed, and assumes a 3-bandfile called image.tif ## (untested) library(rgdal) x <- readGDAL("image.tif") ## first band red <- as.image.SpatialGridDataFrame(x[1])$z ## second green <- as.image.SpatialGridDataFrame(x[2])$z ## third blue <- as.image

Re: [R] nls & optimize

2010-10-19 Thread Ravi Varadhan
You can do this. dsm = c(800,600,NA,525,NA,450,400,NA,NA,NA,0) s3 = seq(0.05,1.05,0.1) plot(s3,dsm,col="blue",las=1,xlab="fraction",ylab="distance (km)") fc <- function(x,a,b){a*exp(-b*x)} fm <- nls(dsm~fc(s3,a,b),start=c(a=800,b=0)) co <- coef(fm) curve(fc(x,a=co[1],b=co[2]),add=TRUE,col="bla

Re: [R] How to read only ten rows from a SAS dataset (read.ssd)?

2010-10-19 Thread David Winsemius
On Oct 19, 2010, at 6:47 AM, johannes rara wrote: I'm trying to read SAS datasets on Windows: sashome <- "C:/Program Files/SAS/SAS 9.1" fold <- "C:/temp" g <- read.ssd(fold, "sasfile", sascmd = file.path(sashome, "sas.exe")) And this was successful? How to get only e.g first ten rows into

Re: [R] readLines: how to make a data.frame?

2010-10-19 Thread David Winsemius
On Oct 19, 2010, at 7:27 AM, johannes rara wrote: I have a text file containing data: Som text :: asdf @ 1 ds $ 5. /*Edmp */ @ 8 asu $ 3. /*daf*/ @ 8 asdala $ 2. /*asdfa*/ @ 13 astun $ 11. /*daf */ @ 26 dft $ 3. /*asdf */ @ 31 dsfp $ 2. /*asdf */ asjk asdfö My intent

[R] Error: object 'short' not found

2010-10-19 Thread Viki S
Hi guys, Can anyone tell me what is the meaning of following command ? paste(execDir,paste(short,"myfile",sep="_"),sep="\") R gives me an error : Error: object 'short' not found I tried to find help about 'short' in R, but could not find any such function/ object. Viki

[R] Part time equity tick data high frequency trading research

2010-10-19 Thread aquatrade
Hi, There seems to be no subsection for work related postings, so please excuse me if this is in the wrong place. I am looking for an English speaking person with very strong R Language, statistics and some financial math knowledge to do statistical research into USA stock tick data. You proba

Re: [R] Error: object 'short' not found

2010-10-19 Thread David Winsemius
On Oct 19, 2010, at 10:03 AM, Viki S wrote: Hi guys, Can anyone tell me what is the meaning of following command ? paste(execDir,paste(short,"myfile",sep="_"),sep="\") R gives me an error : Error: object 'short' not found I tried to find help about 'short' in R, but could not find any such

Re: [R] Error: object 'short' not found

2010-10-19 Thread Ista Zahn
Hi Viki, On Tue, Oct 19, 2010 at 10:03 AM, Viki S wrote: > > Hi guys, > Can anyone tell me what is the meaning of following command ? > > paste(execDir,paste(short,"myfile",sep="_"),sep="\") The command means paste together the values in the variable execDir with the pasted-together values in sh

Re: [R] Error: object 'short' not found

2010-10-19 Thread Ivan Calandra
Hi, R tells you that you don't have any object called "short" in your workspace. From your question, I would guess that you don't plan to have it. What do you want the output of paste(...) to look like? Which parts are supposed to be called through objects (that contain characters), which o

Re: [R] Part time equity tick data high frequency trading research

2010-10-19 Thread Ista Zahn
Hi Chris, There is a jobs mailing list: https://stat.ethz.ch/mailman/listinfo/r-sig-jobs -Ista On Tue, Oct 19, 2010 at 10:10 AM, aquatrade wrote: > > Hi, > > There seems to be no subsection for work related postings, so please excuse > me if this is in the wrong place. > > I am looking for an En

Re: [R] Lattice: type="p" stopped working in panel.average

2010-10-19 Thread Alexandr Malusek
Dear Deepayan, I had to swap "x" and "y" (see below), but otherwise it worked perfectly. Thank you for your help. mypanel.average <- function(x, y, FUN = mean, ...) { aa <- aggregate(x ~ as.numeric(y), data = environment(), FUN = FUN) panel.points(aa[[2]], aa[[1]], ...) } plot <- bwplot(year

Re: [R] points(x,y), mean and standard deviation

2010-10-19 Thread ashz
Hi, Thanks for the tip. I run this script: means.cl <- c(82, 79, 110, 136,103) stderr.cl <- c(8.1,9.2,7.4,1.6,7.6) plotCI(x = means.cl , uiw = stderr.cl, pch=24) But how can I connect the mean triangles with a line? Thanks -- View this message in context: http://r.789695.n4.nabble.com/poin

Re: [R] points(x,y), mean and standard deviation

2010-10-19 Thread Joshua Wiley
Hi, Here is an example using ggplot2. For future reference, it would be convenient if you provided sample data. This is actually pretty easy to do: dput(yourdata) or if your data is very large: dput(head(yourdata)). At any rate, here is an example with the means plotted as points and connected

Re: [R] points(x,y), mean and standard deviation

2010-10-19 Thread Dennis Murphy
lines(1:5, means.cl) HTH, Dennis On Tue, Oct 19, 2010 at 7:13 AM, ashz wrote: > > Hi, > > Thanks for the tip. > > I run this script: > means.cl <- c(82, 79, 110, 136,103) > stderr.cl <- c(8.1,9.2,7.4,1.6,7.6) > plotCI(x = means.cl , uiw = stderr.cl, pch=24) > > But how can I connect the mean t

Re: [R] using optimize with two unknowns, e.g. to parameterize a distribution with given confidence interval

2010-10-19 Thread Ravi Varadhan
You cannot use `optimize' when there are two or more parameters to be optimized. I don’t know if other have suggested any solution to this, but here are 2 approaches: # Estimating LCL and UCL separately using `optimize'. prior.lcl <- function(x, alpha, mean, var) { a <- abs(plnorm(x, mean, var

[R] Chron object in time series plot

2010-10-19 Thread Manta
Dear R users, I have the following script to create bins of specified time intervals bin_end=60/bin_size bin_size=bin_size*100 h=seq(07,18,by=1) breaks=c() for (i in h) { for (j in 0:(bin_end-1)) { value=i+(bin_size)*j b

Re: [R] Incorrect positioning of raster images on Windows

2010-10-19 Thread Sharpie
Paul Murrell-2 wrote: > > Hi > > This is a rounding (truncation) problem. > Working on a fix. > > Paul > > Sharpie wrote: >> >> Michael Sumner-2 wrote: >>> I think there's something about the "discrete cell" versus "centre >>> value" >>> interpretation here, and you are pushing the "pixels"

Re: [R] Chron object in time series plot

2010-10-19 Thread David Winsemius
On Oct 19, 2010, at 11:25 AM, Manta wrote: Dear R users, I have the following script to create bins of specified time intervals bin_end=60/bin_size bin_size=bin_size*100 h=seq(07,18,by=1) breaks=c() for (i in h) { for (j in 0:(bin_end-1)) {

Re: [R] Chron object in time series plot

2010-10-19 Thread Manta
David Winsemius wrote: > > > You seen to be under the mistaken impression that the internal > representation of DateTime classes of 08:00 would be 8. Since the > internal representation of time is in seconds, the even number hours > would be at integer multiples of 60*60. In addition

[R] superpose.polygon, panel.polygon and their colors

2010-10-19 Thread ottorino
Dear R-helpers, the problem I'm facing today is to convince lattice to paint some areas in gray. The areas I would like to have in gray, are confidence bands I've googled around in the mailing list archives and eventually find some clues. This link is my starting point http://tolstoy.newcastle.ed

[R] head.matrix() unintelligent

2010-10-19 Thread brbell01
Hi Just a simple question really. I´ve got these large 2d matrices that I´d like to inspect, but not from start to finish. The head() command is convenient when columns are few. For large nxn matrices, however, head() and head.matrix() are still cumbersome. Is there a simple way of viewing both

[R] De: information

2010-10-19 Thread saidi helmi
Dear all, My name is Saidi Helmi and I'm a PhD student at Sassari University (Italy). I want to ask if there is any package for the estimation of the parameters of "Two Component Extreme Value"(TCEV) distribution. Thank you, best regards, Saidi Helmi [[alternative HTML version deleted]

Re: [R] head.matrix() unintelligent

2010-10-19 Thread Duncan Murdoch
On 19/10/2010 12:10 PM, brbell01 wrote: Hi Just a simple question really. I´ve got these large 2d matrices that I´d like to inspect, but not from start to finish. The head() command is convenient when columns are few. For large nxn matrices, however, head() and head.matrix() are still cumbersom

Re: [R] Chron object in time series plot

2010-10-19 Thread David Winsemius
On Oct 19, 2010, at 12:19 PM, Manta wrote: David Winsemius wrote: You seen to be under the mistaken impression that the internal representation of DateTime classes of 08:00 would be 8. Since the internal representation of time is in seconds, the even number hours would be at integer mu

[R] separate elements of a character vector

2010-10-19 Thread Simon Kiss
Dear colleagues, this seems like an easy problem, and I found some suggestions which I've incorporated in the help list, but I can't quite get it right. I want to add a series of years to a second x-axis category label. I generate them with test and test_2 below, format them with some spacing (

Re: [R] nls & optimize

2010-10-19 Thread Thomas Stewart
Let f be your estimated function. Suppose we have a root function, say root(). You are looking for b = root(f-a) where a is some constant. Now suppose we consider the inverse of f, call it f.inv. Then the following holds: a = root(f.inv-b). In your code, you find b = root(f-a) and c = ro

Re: [R] separate elements of a character vector

2010-10-19 Thread Joshua Wiley
Dear Simon, I think the main issue is that mtext() is designed to work with a single character string, not a character vector. Here is one approach collapsing using paste with some space: x1<-rnorm(500) plot(x1) test<-seq(1987, 2002, by=1) test_2<-seq(2003, 2006, by=1) mtext(paste(c(test, test_2

Re: [R] separate elements of a character vector

2010-10-19 Thread Thomas Stewart
You may want to try something like this: x1<-rnorm(500) plot(x1) test<-seq(1987, 2002, by=1) test_2<-seq(2003, 2006, by=1) test<-format(c(test, test_2), width=5) xxx<-seq(1,500,length=length(test)) axis(1,at=xxx,labels=test,line=1,col=0) You'll need to specify where you want the labels (in this c

Re: [R] head.matrix() unintelligent

2010-10-19 Thread Patrick Burns
You want the 'corner' function. It isn't (yet) in an R package but you can find it to 'source' it in near the bottom of the 'Public Domain Code' page of www.burns-stat.com Your case is precisely the reason that 'corner' came into being. On 19/10/2010 17:10, brbell01 wrote: Hi Just a simple qu

Re: [R] Chron object in time series plot

2010-10-19 Thread Manta
I do not think that importing the time as character will help me, as I need to perform several operation with them. Again, maybe I am not able to express clearly enough. Let's just focus on this series: > breaks [1] 7 71500 73000 74500 8 81500 83000 84500 9 91500 93000 94

Re: [R] Chron object in time series plot

2010-10-19 Thread Phil Spector
The following will create a POSIXlt object using the current date: strptime(sprintf('%06d',breaks),'%H%M%S') [1] "2010-10-19 07:00:00" "2010-10-19 07:15:00" "2010-10-19 07:30:00" [4] "2010-10-19 07:45:00" "2010-10-19 08:00:00" "2010-10-19 08:15:00" [7] "2010-10-19 08:30:00" "2010-10-19 08:45

Re: [R] How to read only ten rows from a SAS dataset (read.ssd)?

2010-10-19 Thread johannes rara
Thanks David, Yes, my code really works (using the foreign package), but when handling a SAS file which contains > 500 000 rows and > 100 cols it is not really fun anymore. My intention was do some preliminary research from the data and the whole dataset was not needed. After all, I could not fin

Re: [R] Sample in R

2010-10-19 Thread Darin A. England
No. > ?sample to see what sample() does. On Tue, Oct 19, 2010 at 02:59:05AM -0700, emj83 wrote: > > Hi, > > Please can someone tell me if using sample() in R is actually a quick way of > doing the Inverse Transform Sampling Method? > > Many thanks Emma > -- > View this message in context

Re: [R] How to read only ten rows from a SAS dataset (read.ssd)?

2010-10-19 Thread David Winsemius
On Oct 19, 2010, at 1:31 PM, johannes rara wrote: Thanks David, Yes, my code really works (using the foreign package), but when handling a SAS file which contains > 500 000 rows and > 100 cols it is not really fun anymore. My intention was do some preliminary research from the data and the who

Re: [R] could not find function "hmatplot"

2010-10-19 Thread Dieter Menne
Grzesiek wrote: > > I need a picture like this: > http://rwiki.sciviews.org/doku.php?id=graph_gallery:graph38 > http://rwiki.sciviews.org/doku.php?id=graph_gallery:graph38 > > .. follows code from the web site > > I get an error: > Error: could not find function "hmatplot" > > What is wron

Re: [R] How to read only ten rows from a SAS dataset (read.ssd)?

2010-10-19 Thread johannes rara
I have previously tried to use Hmisc's sas.get function, but I have had problems with it. I think I go with your last suggestion. -J 2010/10/19 David Winsemius : > > On Oct 19, 2010, at 1:31 PM, johannes rara wrote: > >> Thanks David, >> >> Yes, my code really works (using the foreign package), b

Re: [R] How to read only ten rows from a SAS dataset (read.ssd)?

2010-10-19 Thread Phil Spector
I've verified that David's solution will work, but a) since if is a reserved word, you must use the full name of the argument, namely ifs b) the argument passed through ifs= should be a full subsetting if statement. So adding ifs='if _n_ <= 10' to your sas.get call will retur

Re: [R] Chron object in time series plot

2010-10-19 Thread David Winsemius
On Oct 19, 2010, at 1:30 PM, Phil Spector wrote: The following will create a POSIXlt object using the current date: strptime(sprintf('%06d',breaks),'%H%M%S') [1] "2010-10-19 07:00:00" "2010-10-19 07:15:00" "2010-10-19 07:30:00" [4] "2010-10-19 07:45:00" "2010-10-19 08:00:00" "2010-10-19 08:1

[R] R script help needed for RFC 2104 HMAC algorithm

2010-10-19 Thread Larry D'Agostino
I'm trying to create an R script that will execute the HMAC algorithm for key-hashing messages. My hope is to use this script for some web authentication via R. The algorithm is found at http://www.ietf.org/rfc/rfc2104.txt Here is some example code that I have done that does not work for HMAC-MD

Re: [R] superpose.polygon, panel.polygon and their colors

2010-10-19 Thread Dieter Menne
Ottorino-Luca Pantani wrote: > > The areas I would like to have in gray, are confidence bands > > This link is my starting point > http://tolstoy.newcastle.edu.au/R/e2/help/07/04/15595.html > > Thanks for the code example and for all the work you already put into it! I think this is an over

[R] Clustering with ordinal data

2010-10-19 Thread Steve_Friedman
Hello I've been asked to help evaluate a vegetation data set, specifically to examine it for community similarity. The initial problem I see is that the data is ordinal. At best this only captures a relative ranking of abundance and ordinal ranks are assigned after data collection.I've been

Re: [R] Clustering with ordinal data

2010-10-19 Thread Phil Spector
Steve - Take a look at daisy() in the cluster package. - Phil Spector Statistical Computing Facility Department of Statistics UC Be

Re: [R] Problems with a specific calculate.

2010-10-19 Thread David Winsemius
On Oct 19, 2010, at 6:38 AM, Toni López Mayol wrote: Hello friends of R, My name is Toni, i'm 25 and I'm working on the Meteorological Investigation team from Balearic Islands. I had contact to you because I have a problem: I done a file for every day since 1912 about precipitation. That

Re: [R] Chron object in time series plot

2010-10-19 Thread Manta
Thanks Phil, it is exactly what I was looking for. David, I took into account how to make valid math operations, so I understand your concern about it. I will definitely change all my scripts and functions to considered the time as character, but as I need a clear output soon (deadline is close)

Re: [R] Clustering with ordinal data

2010-10-19 Thread Steve_Friedman
Thanks Phil, I'll do so now. Much appreciated. Steve Steve Friedman Ph. D. Spatial Statistical Analyst Everglades and Dry Tortugas National Park 950 N Krome Ave (3rd Floor) Homestead, Florida 33034 steve_fried...@nps.gov Office (305) 224 - 4282 Fax (305) 224 - 4147

[R] could not find function "hmatplot"

2010-10-19 Thread Grzesiek
I need a picture like this: http://rwiki.sciviews.org/doku.php?id=graph_gallery:graph38 http://rwiki.sciviews.org/doku.php?id=graph_gallery:graph38 but when I try compile it require("hexbin") data(NHANES)# pretty large data set! good <- !(is.na(NHANES$Albumin) | is.na(NHANES$Transferin)) NH.var

[R] How to write to sqlite files

2010-10-19 Thread lord12
In R, I know how to write ti csv files. However, how do I write to database files? -- View this message in context: http://r.789695.n4.nabble.com/How-to-write-to-sqlite-files-tp3002586p3002586.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] How to read only ten rows from a SAS dataset (read.ssd)?

2010-10-19 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Phil Spector > Sent: Tuesday, October 19, 2010 10:49 AM > To: David Winsemius > Cc: r-help@r-project.org; johannes rara > Subject: Re: [R] How to read only ten rows from a SAS data

[R] R 2.12.0 and JGR

2010-10-19 Thread Rob Baer
Since upgrading to 2.12.0, I'm having trouble getting the JGR to start under Windows 7, but I'm not quite sure what's happening. When I try to run the JGR.exe stub, the dialog says can't find Java R interface jri.dll. As nearly as I can tell from a Google search this is to be a part of the r

Re: [R] R 2.12.0 and JGR

2010-10-19 Thread Prof Brian Ripley
JRI/rJava/JGR have their own mailing lists, and it would be better to ask there. But there was a rJava update this morning, and it is consequently little tested. (I know for example that 64-bit JRI will need furtehr work.) It may be that other things also need an update (like the JGR stub).

Re: [R] points( .... pch=2) substitue pch with image

2010-10-19 Thread Greg Snow
Look at my.symbols and ms.image in the TeachingDemos package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of

Re: [R] Tif image to 8bit colour matrix.

2010-10-19 Thread Greg Snow
Look at the EBImage package from bioconductor. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Roger Gill > S

Re: [R] How to write to sqlite files

2010-10-19 Thread Steven McKinney
You will need to install the RSQLite package, see e.g. http://cran.r-project.org/web/packages/RSQLite/index.html Review the installation instructions there for the setup appropriate for your situation. Review the pdf manual there for examples of command sequences involved with connecting to the

[R] scatter.smooth() fitted by loess

2010-10-19 Thread phoebe kong
Hi there, I would like to draw a scatter plot and fit a smooth line by loess. Below is the data. However, the curve line started from 0, which my "resid" list doesn't consist of 0 value. It returned some warnings which I don't know if this is the reason affecting such problem. Here I also attached

[R] Gini Coefficient

2010-10-19 Thread Peter Francis
Dear List, I am unsure if this is specifically a R question or a stats question? I thought i would ask here and if i get no replies it will answer that! I am trying to calculate Gini coefficients in R, based on a slight modification of the typical equation that i have seen in a paper. Past

Re: [R] scatter.smooth() fitted by loess

2010-10-19 Thread Ista Zahn
The fundamental problem is that you only have five distinct x values. lowess cannot work in this situation. Try side-by-side boxplots: boxplot(resid.value ~ YMRS_Sum) -Ista On Tue, Oct 19, 2010 at 5:43 PM, phoebe kong wrote: > Hi there, > > I would like to draw a scatter plot and fit a smooth l

Re: [R] scatter.smooth() fitted by loess

2010-10-19 Thread David Winsemius
On Oct 19, 2010, at 5:43 PM, phoebe kong wrote: Hi there, I would like to draw a scatter plot and fit a smooth line by loess. Below is the data. However, the curve line started from 0, which my "resid" list doesn't consist of 0 value. It returned some warnings which I don't know if this is the

[R] comparing two data files

2010-10-19 Thread Nicole Brandt
I have 2 large data files that I need to compare and find the differences between data file x and data file y in order to correct data entry error. Theoretically both data files should be identical. I am trying to figure out a way to do this in R. Any help would be great! ___

Re: [R] comparing two data files

2010-10-19 Thread Henrique Dallazuanna
Here is some ways: all.equal(readLines(file1), readLines(file2)) You could try compare md5sum of the files: library(tools) identical(md5sum(file1), md5sum(file2)) On Tue, Oct 19, 2010 at 8:23 PM, Nicole Brandt wrote: > I have 2 large data files that I need to compare and find the differences

Re: [R] Gini Coefficient

2010-10-19 Thread David Winsemius
On Oct 19, 2010, at 4:24 PM, Peter Francis wrote: Dear List, I am unsure if this is specifically a R question or a stats question? I thought i would ask here and if i get no replies it will answer that! I am trying to calculate Gini coefficients in R, based on a slight modification of

  1   2   >