[R] read.ssd() from foreign package

2011-03-06 Thread array chip
Hi, I am encountering a confusing problem when I tried to use read.ssd to read SAS datasets. For one SAS dataset a.sas7bdat, it did not work; while for another SAS dataset b.sas7bdat it worked: tmp-read.ssd(C:\\SASdata, a,sascmd=C:/Program Files/SAS/SASFoundation/9.2/sas.exe) SAS failed. SAS

Re: [R] cv.glmnet errors

2011-03-06 Thread Loren Collingwood
I came across the same thing, doing multinomial cross validation with cv.glmnet but also doing it with a for loop with subsets on the X matrix and y response categories. I've tested it out various ways and I think the problem occurs because in one of the folds there are no codes for at least

Re: [R] read.ssd() from foreign package

2011-03-06 Thread peter dalgaard
On Mar 6, 2011, at 09:34 , array chip wrote: Hi, I am encountering a confusing problem when I tried to use read.ssd to read SAS datasets. For one SAS dataset a.sas7bdat, it did not work; while for another SAS dataset b.sas7bdat it worked: tmp-read.ssd(C:\\SASdata, a,sascmd=C:/Program

Re: [R] Can body() return a function's body intact, in order, and as characters ready for editing?

2011-03-06 Thread Duncan Murdoch
On 11-03-05 8:20 PM, Kingsley G. Morse Jr. wrote: Is my understanding correct that the body() function currently can't return a function's body intact, in order, and as characters ready for editing? Yes, that's not what body() returns. You can get what you want by printing the result of

Re: [R] Ordering several histograms

2011-03-06 Thread Uwe Ligges
On 05.03.2011 18:40, djbirdnerd wrote: not yet, but i have only just started programming in r... I don't know if i will able to... Without quoting the former thread and without replying to a particular person (rather than the mailing list only): Do you expect anybody on the mailing list

[R] Plot and curve inside C++

2011-03-06 Thread Paul Smith
Dear All, I would like to use - plot, - curve inside a C++ program. What R package do you recommend? Rcpp? Thanks in advance, Paul __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] please help ! label selected data points in huge number of data points potentially as high as 50, 000 !

2011-03-06 Thread Sarah Goslee
I think you've made your problem too complicated. Given your example below (and THANK YOU for including a workable example), is this not what you need? sigdata - dataf[dataf$p 0.01,] plot(dataf$xvar, dataf$p) text(sigdata$xvar, sigdata$p, sigdata$name) text() will take vectors of arguments.

Re: [R] Coefficient of Determination for nonlinear function

2011-03-06 Thread Mike Marchywka
From: uwe.wolf...@uni-ulm.de To: andy_l...@merck.com Date: Sat, 5 Mar 2011 17:14:12 +0100 CC: r-help@r-project.org; gunter.ber...@gene.com Subject: Re: [R] Coefficient of Determination for nonlinear function Dear Bert, dear Andy, thanks for

[R] Writing Rd files

2011-03-06 Thread Nipesh Bajaj
Hi all, I have created a package and now into writing it's help files. However I am having problem on, how to put a 'new line' in any statement of the help file? For example please consider following: \title{ This is a new function and this function will calculate the mean. } However I want to

[R] Seeking guidance in package creation when it contains s4 class

2011-03-06 Thread Nipesh Bajaj
Dear all, I am having problem to create a package when this package is supposed to have some newly created s4 class. Here is my workout: #rm(list = ls()) setClass(aClass, sealed=T, representation(slot1 = vector, slot2 = character)) [1] aClass fn1 - function(x, y, z) { + x - x[1] + y - y[1]

[R] read.table mystery

2011-03-06 Thread Johannes Graumann
Hello, Please have a look at the code below, which I use to read in the attached file. As line 18 of the file reads 1065:sp|Q9V3T9|ADRO_DROME NADPH:adrenodoxin oxidoreductase, mitochondrial OS=Drosophila melanogaster GN=dare PE=2 SV=1, I expect the code below to produce a 3 column data frame

Re: [R] Rapache ( was Developing a web crawler )

2011-03-06 Thread Mike Marchywka
Date: Thu, 3 Mar 2011 13:04:11 -0600 From: matt.shotw...@vanderbilt.edu To: r-help@r-project.org Subject: Re: [R] Developing a web crawler / R webkit or something similar? [off topic] On 03/03/2011 08:07 AM, Mike Marchywka wrote:

[R] Data lebals xylattice plot: RE: displaying label meeting condition (i.e. significant, i..e p value less than 005) in plot function

2011-03-06 Thread Umesh Rosyara
Dear Jorge, Dennis, Sarah and R-experts. Thank for helping me. As you mentioned it is difficult apply in lattice in this situation. Unless, there is a possibility, I would try to use lattice. The major reason toward this is- my ultimate solution might be better of in lattice as I have a

Re: [R] Plot and curve inside C++

2011-03-06 Thread Dirk Eddelbuettel
On 6 March 2011 at 12:37, Paul Smith wrote: | Dear All, | | I would like to use | | - plot, | - curve | | inside a C++ program. What R package do you recommend? Rcpp? You can use base R, embedding R is explained in the 'Writing R Extensions' manual. That said, the material is a little on the

Re: [R] read.table mystery

2011-03-06 Thread Sarah Goslee
Not so much a mystery. read.table() only looks at the first 5 lines when decided how many columns your file has (as described in the Details section of the help). The easiest solution is to add a col.names argument to read.table() with the correct number of names. You may want to also include

Re: [R] Data lebals xylattice plot: RE: displaying label meeting condition (i.e. significant, i..e p value less than 005) in plot function

2011-03-06 Thread Bert Gunter
This is easy to do by specifying xyplot's panel function. Assuming only one panel -- otherwise you need to pass the subscripts arguments to choose the values belonging to the panel -- somethings like: xyplot(y~x, pvals = pvals,..., ## pvals is your vector of small p values with e.g. NA's

Re: [R] retrieve x y coordinates of points in current plot

2011-03-06 Thread Carl Witthoft
If you want to identify the coordinates of points within a region, you might want to look at the ImageJ application. http://rsbweb.nih.gov/ij/ IIRC it has some macros to find and classify spots. __ R-help@r-project.org mailing list

Re: [R] read.table mystery

2011-03-06 Thread David Winsemius
On Mar 6, 2011, at 10:19 AM, Sarah Goslee wrote: Not so much a mystery. read.table() only looks at the first 5 lines when decided how many columns your file has (as described in the Details section of the help). The easiest solution is to add a col.names argument to read.table() with the

[R] Procedural prgramming

2011-03-06 Thread tsvi sabo
Hi!,i would really appreciate any help on that matter.I am currently programming a procedure on RI have few functions,1. Choose Excel file function2. Choose Excel sheet function.3.Choose columns for variables function4.Few plots functions and analisys5.Main function that runs these functions

Re: [R] Writing Rd files

2011-03-06 Thread Francisco Gochez
Hi Nipesh, Try \cr. See section 2.2 of the Writing R Extensions document for more information. HTH, - Francisco On Sun, Mar 6, 2011 at 2:03 PM, Nipesh Bajaj bajaj141...@gmail.com wrote: Hi all, I have created a package and now into writing it's help files. However I am having problem on,

Re: [R] read.table mystery

2011-03-06 Thread Johannes Graumann
Thank you for pointing this out. This is really inconvenient as I do not know a priori how many and where those darn cases containing an additional (or more) : might be ... The seems to work, but will fail if there's a 1:sdfjhlfkh:2:adlkjf somewhere (1 2 both integerable).

Re: [R] read.table mystery

2011-03-06 Thread Sarah Goslee
You could pre-process your data into a more sensible format. Or you could use scan to read each line of the file, count the number of colons, then use read.table with ncolons + 1 columns. Or you could use read.table with many more columns than are ever going to be in the data, then delete the

Re: [R] Procedural prgramming

2011-03-06 Thread David Winsemius
On Mar 6, 2011, at 9:50 AM, tsvi sabo wrote: Hi!,i would really appreciate any help on that matter.I am currently programming a procedure on RI have few functions,1. Choose Excel file function2. Choose Excel sheet function.3.Choose columns for variables function4.Few plots functions and

Re: [R] please help ! label selected data points in huge number of data points potentially as high as 50, 000 !

2011-03-06 Thread csrabak
Em 5/3/2011 21:29, Umesh Rosyara escreveu: Dear All I am reposting because I my problem is real issue and I have been working on this. I know this might be simple to those who know it ! Anyway I need help ! Let me clear my point. I have huge number of datapoints plotted using either base plot

Re: [R] read.table mystery

2011-03-06 Thread Johannes Graumann
Opted for a solution with 100 column names, which is unlikely to be met ... Thanks for your guidance. Joh On Sunday 06 March 2011 20:57:11 Sarah Goslee wrote: You could pre-process your data into a more sensible format. Or you could use scan to read each line of the file, count the number of

Re: [R] read.table mystery

2011-03-06 Thread David Winsemius
On Mar 6, 2011, at 12:47 PM, Johannes Graumann wrote: Thank you for pointing this out. This is really inconvenient as I do not know a priori how many and where those darn cases containing an additional (or more) : might be ... There is a count.fields function that might assist with this

Re: [R] Rapache ( was Developing a web crawler )

2011-03-06 Thread Matt Shotwell
On Sun, 2011-03-06 at 08:06 -0500, Mike Marchywka wrote: Date: Thu, 3 Mar 2011 13:04:11 -0600 From: matt.shotw...@vanderbilt.edu To: r-help@r-project.org Subject: Re: [R] Developing a web crawler / R webkit or something similar? [off

[R] bootstrap

2011-03-06 Thread Ashish Kumar
In the boot package,consider a scalar function to boot. estimator - function(x, d) { + mean(x[d]) + } data - city$u b - boot(data, estimator, R=1000) b$t0 [1] 64 ci - boot.ci(b, type=c(bca), conf=.95) ci$bca conf [1,] 0.95 49.44 991.39 36.78807 110.0254 Now if I want estimators to

Re: [R] bootstrap

2011-03-06 Thread David Winsemius
On Mar 6, 2011, at 1:52 PM, Ashish Kumar wrote: In the boot package,consider a scalar function to boot. estimator - function(x, d) { + mean(x[d]) + } data - city$u b - boot(data, estimator, R=1000) b$t0 [1] 64 ci - boot.ci(b, type=c(bca), conf=.95) ci$bca conf [1,] 0.95 49.44

[R] sorting subsetting a data.frame

2011-03-06 Thread Liviu Andronic
Dear all This may be obvious, but I cannot get it working. I'm trying to subset sort a data frame in one go. x - iris x$Species1 - as.character(x$Species) ##subsetting alone works fine with(x, x[Sepal.Length==6.7,]) ##sorting alone works fine with(x, x[order(Sepal.Length, rev(sort(Species1))),])

Re: [R] sorting subsetting a data.frame

2011-03-06 Thread Liviu Andronic
On Sun, Mar 6, 2011 at 11:49 PM, Liviu Andronic landronim...@gmail.com wrote: Dear all This may be obvious, but I cannot get it working. I'm trying to subset sort a data frame in one go. x - iris x$Species1 - as.character(x$Species) ##subsetting alone works fine with(x,

Re: [R] sorting subsetting a data.frame

2011-03-06 Thread Liviu Andronic
On Sun, Mar 6, 2011 at 11:53 PM, Liviu Andronic landronim...@gmail.com wrote: On Sun, Mar 6, 2011 at 11:49 PM, Liviu Andronic landronim...@gmail.com wrote: Dear all This may be obvious, but I cannot get it working. I'm trying to subset sort a data frame in one go. x - iris x$Species1 -

Re: [R] sorting subsetting a data.frame

2011-03-06 Thread David Winsemius
On Mar 6, 2011, at 5:49 PM, Liviu Andronic wrote: Dear all This may be obvious, but I cannot get it working. I'm trying to subset sort a data frame in one go. x - iris x$Species1 - as.character(x$Species) ##subsetting alone works fine with(x, x[Sepal.Length==6.7,]) ##sorting alone works fine

Re: [R] sorting subsetting a data.frame

2011-03-06 Thread Dennis Murphy
Hi: One approach is through the data.table package: library(data.table) df - as.data.frame(data.table(iris, key = 'Species')[Sepal.Length == 6.7]) str(df) Using Species as a key variable automatically sorts by Species; the bracketing allows you to subset on Sepal.Length == 6.7. ddply() in the

[R] WG: Reference classes: error with missing arguments in method calls

2011-03-06 Thread Janko Thyson
Dear list, a while ago I posted this at r-devel but got no answers. Hope it’s okay to give it a shot again by cross-posting it here. TIA for any comments, Janko Von: Janko Thyson [mailto:janko.thyson.rst...@googlemail.com] Gesendet: Montag, 21. Februar 2011 00:58 An: r-devel@r-project. org

[R] Monte carlo help

2011-03-06 Thread mathsohard
Hello, I am currently doing my project and I need some help. I am trying to schedule tutors for a study room where students come in and out for helps. My goal is to schedule the tutors to maximally accomodate to the flow of students that need help with math so that each tutor is given an

Re: [R] xts POSIXct index format

2011-03-06 Thread Joshua Ulrich
Hi David, On Sat, Mar 5, 2011 at 11:00 PM, David Winsemius dwinsem...@comcast.net wrote: On Mar 5, 2011, at 11:28 AM, Joshua Ulrich wrote: Hi Chris, Perhaps something like this? require(xts) ds - options(digits.secs=6) # so we can see sub-seconds x - xts(1:10, as.POSIXct(2011-01-21) +

Re: [R] WG: Reference classes: error with missing arguments in method calls

2011-03-06 Thread Martin Morgan
On 03/06/2011 04:34 PM, Janko Thyson wrote: Dear list, a while ago I posted this at r-devel but got no answers. Hope it’s okay to give it a shot again by cross-posting it here. Hi Janko -- TIA for any comments, Janko Von: Janko Thyson [mailto:janko.thyson.rst...@googlemail.com]

Re: [R] Units and dimensions in grid object

2011-03-06 Thread Paul Murrell
Hi On 5/03/2011 9:37 a.m., Sébastien Bihorel wrote: Dear R-users, As far as I understand, when one defines the width of a rectGrob call using a 'npc' unit, the width of the object is proportional to the width of the current viewport. Is there a way to refer to the height (or width) of the

[R] lavaan diagram

2011-03-06 Thread Sebastián Daza
Hi everyone, I get the following message when I try to get a diagram of a CFA: Error in lavaan.diagram(fit) : no slot of name GLIST for this object of class Fit Does anyone know what the problem is? Regards. -- Sebastián Daza sebastian.d...@gmail.com

Re: [R] lavaan diagram

2011-03-06 Thread William Revelle
Dear Sebastian, Yes. The problem is that the most recent version of psych 1-.0-94 was released before the most recent version of lavaan (0.4-7) I have updated the lavaan.diagram function in psych and will release it soon. In the meantime, you can get the update by sourcing it at

[R] help needed with histogram plotting

2011-03-06 Thread cassie jones
Dear all, I am trying to plot 3 histograms on the same graph using the following command. hist(x,xlim=c(0,100)) hist(y,add=TRUE) hist(z,add=TRUE) The xlim of y is c(20,21) and that of z is c(99,99.5) , whereas the variable x has xlim at c(0.5,2). Apparently, the graph end of displaying a line

Re: [R] sorting subsetting a data.frame

2011-03-06 Thread David Winsemius
On Mar 6, 2011, at 6:05 PM, Liviu Andronic wrote: On Sun, Mar 6, 2011 at 11:53 PM, Liviu Andronic landronim...@gmail.com wrote: On Sun, Mar 6, 2011 at 11:49 PM, Liviu Andronic landronim...@gmail.com wrote: Dear all This may be obvious, but I cannot get it working. I'm trying to subset

[R] Lattice experts: RE: Data lebals xylattice plot: RE: displaying label meeting condition (i.e. significant, i..e p value less than 005) in plot function

2011-03-06 Thread Umesh Rosyara
Hi Bert and Lattice experts Thank you for suggestion and I am still reading your suggestions (Deepayan's book) and help guide. So far no silverlining in horizon. Here is my outline, that keep changing: require(lattice) pvals - which (dataf$p 0.05) xyplot(p ~ xvar|chr, data=dataf, pvals =

Re: [R] Monte carlo help

2011-03-06 Thread Mike Marchywka
Date: Sun, 6 Mar 2011 15:42:11 -0800 From: ksa...@gmail.com To: r-help@r-project.org Subject: [R] Monte carlo help Hello, I am currently doing my project and I need some help. I am trying to schedule tutors for a study room where students

[R] Parsing question, partly comma separated partly underscore separated string

2011-03-06 Thread Eric Fail
Dear R-list, I have a partly comma separated partly underscore separated string that I am trying to parse into R. Furthermore I have a bunch of them, and they are quite long. I have now spent most of my Sunday trying to figure this out and thought I would try the list to see if someone here

Re: [R] Parsing question, partly comma separated partly underscore separated string

2011-03-06 Thread Don McKenzie
On 6-Mar-11, at 7:13 PM, Eric Fail wrote: Dear R-list, I have a partly comma separated partly underscore separated string that I am trying to parse into R. Furthermore I have a bunch of them, and they are quite long. I have now spent most of my Sunday trying to figure this out and

Re: [R] read.table mystery

2011-03-06 Thread Johannes Graumann
count.fields is a very nice hint for a clean solution - thank you! Joh On Sunday 06 March 2011 21:48:32 David Winsemius wrote: On Mar 6, 2011, at 12:47 PM, Johannes Graumann wrote: Thank you for pointing this out. This is really inconvenient as I do not know a priori how many and where

[R] attr question

2011-03-06 Thread Erin Hodgess
Dear R People: When I want to produce a small sample confidence interval using t.test, I get the following: t.test(buzz$var1, conf.level=.98)$conf.int [1] 2.239337 4.260663 attr(,conf.level) [1] 0.98 How do I keep the attr statement from printing, please? I'm sure it's something really

Re: [R] attr question

2011-03-06 Thread Simon Blomberg
Try t.test(buzz$var1, conf.level=.98)$conf.int[1:2] Cheers, Simon. From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of Erin Hodgess [erinm.hodg...@gmail.com] Sent: Monday, March 07, 2011 3:11 PM To: R help Subject: [R] attr

Re: [R] help needed with histogram plotting

2011-03-06 Thread Scott Chamberlain
Does this seems like a good stand in for now: require(ggplot2) x - runif(100,1,2) y - runif(100,50,60) z - runif(100,99,100) xyz - melt(data.frame(x,y,z)) ggplot(xyz, aes(value)) + geom_histogram() + facet_grid(~ variable, scale=free) On Sunday, March 6, 2011 at 9:25 PM, cassie jones wrote:

Re: [R] Parsing question, partly comma separated partly underscore separated string

2011-03-06 Thread Dennis Murphy
Hi: This should get you most of the way there; I'll let you figure out how to assign the BLOCK and RUN numbers. tx - Subject ID,ExperimentName,2010-04-23,32:34:23,Version 0.4, 640 by 960 pixels, On Device M, M, 3.2.4, zz_373_462_488_...@9z.svg,592,820,3.35,zz_032_288_436_...@9z.svg

[R] Error in colnames: target of assignment expands to non-language object

2011-03-06 Thread Jinsong Zhao
Hi there, I cannot find a detailed explanation to the following error message: colnames(matrix(1:10, ncol = 2)) - c(X, Y) Error in colnames(matrix(1:10, ncol = 2)) - c(X, Y) : target of assignment expands to non-language object However, when I do the following things, the error message