[R] data.frame: How to get the classes of all components and how to remove their factor structure?

2011-06-27 Thread Marius Hofert
Dear expeRts, I have two questions concerning data frames: (1) How can I apply the class function to each component in a data.frame? As you can see below, applying class to each column is not the right approach; applying it to each component seems bulky. (2) After transforming the data frame a b

Re: [R] create a new data frame after comparing two columns of the previous data frame

2011-06-27 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 28.06.2011 02:45:01: > > Right. You forgot the comma! If you want to resolve this rather cryptic advice see ?"[" Regards Petr > > -- > David. > > On Jun 27, 2011, at 7:10 PM, Nanami wrote: > > > it's a table; I read it from a file; I've tried to

Re: [R] About the covariant

2011-06-27 Thread Lao Meng
Thanks David for your reply. You said "a single slope and intercept are estimated for each variable".Actually I can only get one intercept no matter how many variables exist,but a slope for each variable. Since the regression is done via:lm(CD4 ~ time + gender + income) It seems that the explanat

Re: [R] gam confidence interval (package mgcv)

2011-06-27 Thread Remko Duursma
But that just gives me the prediction of Y for treatment A or B, not the ratio. As I stated: # I am interested in the relationship: # Y(treatment =="B") / Y(treatment=="A") as a function of X, with a confidence interval! I can get the SE for either of them using predict.gam without a problem, b

Re: [R] Error: cannot allocate vector of size

2011-06-27 Thread Jeff Newmiller
A) You haven't mentioned your OS which indicates you haven't followed the posting guide noted at the bottom of each email. B) You cannot load an "unknown" number of rows... although you may not specify the number, it is finite and its value can be determined for the purposes of debugging your i

Re: [R] gam confidence interval (package mgcv)

2011-06-27 Thread David Winsemius
On Jun 27, 2011, at 10:45 PM, Remko Duursma wrote: Dear R-helpers, I am trying to construct a confidence interval on a prediction of a gam fit. I have the Wood (2006) book, and section 5.2.7 seems relevant but I am not able to apply that to this, different, problem. Any help is appreciated!

Re: [R] Creating a Polar Plot with expanding points as radius increases

2011-06-27 Thread Patrick Jemison
Thank you, Baptiste! I think that this will work for me. Looking into the coord_polar function of ggplot2, I think that the racetrack plot at the bottom of the page (http://had.co.nz/ggplot2/coord_polar.html) will be exactly what I need. On Mon, Jun 27, 2011 at 8:09 PM, baptiste auguie wrote: >

[R] maximum likelihood using nlm to estimate 4 variables

2011-06-27 Thread Edward Bowora
Hi I need help I am new to R and am having problems estimating parameters out of 3stage constrained function. I have constructed a code as below and my data are two colomns of R_j and R_m(sample given below). R_j and R_m represents the dependent and independent variables respectively. The paramet

[R] maximum likelihood using nlm to estimate 4 variables

2011-06-27 Thread ED
Hi I need help I am new to R and am having problems estimating parameters out of 3stage constrained function. I have constructed a code as below and my data are two colomns of R_j and R_m(sample given below). R_j and R_m represents the dependent and independent variables respectively. The paramet

[R] Error: cannot allocate vector of size

2011-06-27 Thread xin123620
Dear R Users, I was using R to import five years traffic data, but the error always come up as shown below. The data frame contains 12 columns and unknown number of records. Would you have any ideas that how I should deal with this situation?  Many thanks for any hints. >wim<-sqlQuery(channel,qry

[R] gam confidence interval (package mgcv)

2011-06-27 Thread Remko Duursma
Dear R-helpers, I am trying to construct a confidence interval on a prediction of a gam fit. I have the Wood (2006) book, and section 5.2.7 seems relevant but I am not able to apply that to this, different, problem. Any help is appreciated! Basically I have a function Y = f(X) for two different

Re: [R] About the covariant

2011-06-27 Thread David Winsemius
On Jun 27, 2011, at 10:02 PM, Lao Meng wrote: Hi all,I have some questions about the covariants of regression. My target: To explore the trend of CD4 level through a period of time. Response variable: CD4 count Explanatory variable:time Also, the demology information is available,such as g

Re: [R] Neg Binomial In GEE

2011-06-27 Thread Ben Bolker
SamiC aberdeen.ac.uk> writes: > I have been using zuurs book but it only goes as far as poisson and binomial > GEE's. Initially I fitted a glm with poisson and this was over dispersed. > Then moved to binomial, but residual patterns are not great (ie variance). > Looks like some spatial correl

Re: [R] Executing the same function on consecutive files

2011-06-27 Thread Dennis Murphy
Hi: One approach: (1) Put your files into a separate directory. (2) Use list.files() to grab the individual file names. (3) Write a function that takes a data frame as an argument and does the necessary processing. (4) Use lapply() or ldply/llply from the plyr package to recursively run the funct

[R] About the covariant

2011-06-27 Thread Lao Meng
Hi all,I have some questions about the covariants of regression. My target: To explore the trend of CD4 level through a period of time. Response variable: CD4 count Explanatory variable:time Also, the demology information is available,such as gender,occupation,income level... Q1,Are these varia

Re: [R] BY GROUP IN GEV

2011-06-27 Thread Dennis Murphy
HI: Since you didn't provide a reproducible example (in particular, what does str(MA) return?), it's hard to verify what specifically causes the error, but a look at the gev() function's help page indicates that the first argument is supposed to be a (numeric) vector, apparently atomic. One probl

Re: [R] Creating a Polar Plot with expanding points as radius increases

2011-06-27 Thread baptiste auguie
Try this, library(ggplot2) d <- data.frame(theta = runif(10, 0, 360), r = runif(10, 0, 3)) ggplot(d, aes(x=theta, y=r, size=r)) + coord_polar(start=0)+ geom_point() + scale_x_continuous(breaks=seq(0, 360, by=30), expand=c(0,0), lim=c(0, 360))+ scale_area() HTH, baptiste On 28 June 2011

Re: [R] Creating a Polar Plot with expanding points as radius increases

2011-06-27 Thread Greg Snow
I would look at the ggplot2 package, I have seen examples using ggplot2 that look similar to what you describe. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Patrick Jemison Sent: Monday, June 27, 2011 4:36 PM To: r-h...@stat.mat

Re: [R] Question about R.oo package

2011-06-27 Thread Henrik Bengtsson
Hi W. Kaisers, sorry for the delay - I just spotted you question: On Thu, Jun 16, 2011 at 5:52 AM, wrote: > Dear R.oo package users, > > while testing some functionality of the R.oo, I found that during the first > construction of a object from a class, the constructor is twice called, but >

Re: [R] Help with histogram intervals

2011-06-27 Thread David Winsemius
On Jun 27, 2011, at 8:36 PM, Joshua Wiley wrote: Hi Ivo, It depends how you are making the histogram plot. If you are using the traditional graphics hist() function, And if you are using histogram() you should be looking at , ... surprise, surprise, ... the breaks argument. then look a

Re: [R] create a new data frame after comparing two columns of the previous data frame

2011-06-27 Thread David Winsemius
Right. You forgot the comma! -- David. On Jun 27, 2011, at 7:10 PM, Nanami wrote: it's a table; I read it from a file; I've tried to make it look prettier: head(intra) chr miRNA start end strand ACC hsa_ID region region_start region_end chr1 miRNA 1

Re: [R] Help with histogram intervals

2011-06-27 Thread Joshua Wiley
Hi Ivo, It depends how you are making the histogram plot. If you are using the traditional graphics hist() function, then look at the argument, "breaks" (type ?hist at the console to pull up the documentation explaining this). For example: hist(x = sample(1:20, 300, TRUE), breaks = seq(0, 20, b

[R] Help with histogram intervals

2011-06-27 Thread Gwanmesia
Dear Sir, How do I change the intervals on the x axis of a histogram plot; let us say for example the intervals were 0,5,10,15,and 20, and I wanted to change the intervals to 0,2,4,6,8,10,12,14,16,18,20. I look forward to receiving your words of wisdom. Ivo [[alternative HTML ver

Re: [R] create a new data frame after comparing two columns of the previous data frame

2011-06-27 Thread Nanami
it's a table; I read it from a file; I've tried to make it look prettier: > head(intra) chr miRNA start end strand ACC hsa_ID region region_start region_end chr1 miRNA 1102484 1102578 + ACC="MI342"; ID="hsa-mir-200b"; exon 1102

[R] Creating a Polar Plot with expanding points as radius increases

2011-06-27 Thread Patrick Jemison
I'd like to create a polar plot similar to those created by the polarFreq function in the openair package. However, this package seems to be specific to wind speed and direction, and requires a "ws" (wind speed) and a "wd" (wind direction) column. My data is unrelated to wind speed, but I'd like

Re: [R] VGAM constraints-related puzzle

2011-06-27 Thread Thomas Yee
Edward Wallace gmail.com> writes: > > Hello R users, > I have a puzzle with the VGAM package, on my first excursion into > generalized additive models, in that this very nice package seems to > want to do either more or less than what I want. > > Precisely, I have a 4-component outcome, y, and

Re: [R] Simple simulations

2011-06-27 Thread jim holtman
Here is another solution if you want to count a sequence like 0 as three overlapping runs of 3 zeros. > x <- sample(c(rep(0,20), rep(1,37)), 100, TRUE) # vector of 1M > z <- rle(x) # get the runs > indx <- which(z$values == 0 & z$lengths > 2) # find the runs > # now determine the number

[R] how to have R tell me which node is being used in a multi-node cluster

2011-06-27 Thread Matthew Keller
Hi all, I'm trying to use a parallel script on a 20 node cluster, 8 processors per node. Each node has a name, e.g., "vm", "vm0001", etc. Within a foreach loop, I would like R to tell me what node it is actually running on. How can this be accomplished? Thanks! require(doMPI) cl <- startMPIcl

[R] cld object did not plot

2011-06-27 Thread Richard Friedman
Dear R list., I am running a script to get a compact letter display. library(lme4) library(multcomp) library(gplots) ### Mixed Effects Model # data <- read.table("AJmix.txt",header=TRUE, sep="\t") attach(data) y<-cbind(positive,negative) treatment<-factor(treatment) mouse<-fac

Re: [R] create a new data frame after comparing two columns of the previous data frame

2011-06-27 Thread David Winsemius
On Jun 27, 2011, at 6:56 PM, jim holtman wrote: Use "&" instead of "&&" Yes, and don't forget the comma! -- David. On Mon, Jun 27, 2011 at 6:01 PM, Nanami 13 wrote: Hi everyone, I am trying to find a way to filter a table; If I am given for example the following table: head(intra)

Re: [R] Fastest way of finding if any members of vector x fall in the range of the rows of matrix y

2011-06-27 Thread jim holtman
try sqldf: > require(sqldf) > x x 1 1 2 2 3 6 4 5 > y s e 1 1 4 2 3 5 3 8 10 > sqldf(" + select x.x + from x, y + where x.x between y.s and y.e + ") x 1 1 2 2 3 5 > On Mon, Jun 27, 2011 at 5:33 AM, Salih Tuna wrote: > Thanks a lot. That solves the problem :) > best,

Re: [R] cumulative incidence plot vs survival plot

2011-06-27 Thread array chip
Thank you David. Didn't realized someone posted related topic this morning. John - Original Message From: David Winsemius To: array chip Cc: r-help@r-project.org Sent: Mon, June 27, 2011 3:38:36 PM Subject: Re: [R] cumulative incidence plot vs survival plot On Jun 27, 2011, at 5:04

Re: [R] create a new data frame after comparing two columns of the previous data frame

2011-06-27 Thread jim holtman
Use "&" instead of "&&" On Mon, Jun 27, 2011 at 6:01 PM, Nanami 13 wrote: > Hi everyone, > > I am trying to find a way to filter a table; If I am given for example the > following table: >> head(intra) >   chr miRNA   start     end strand              ACC             hsa_ID > region region_start

Re: [R] Executing the same function on consecutive files

2011-06-27 Thread John Kane
This looks something like what you want. http://r.789695.n4.nabble.com/Reading-in-a-series-of-files-using-a-for-loop-td906101.html --- On Mon, 6/27/11, Trying To learn again wrote: > From: Trying To learn again > Subject: [R] Executing the same function on consecutive files > To: r-help@r-proj

[R] TL diagram

2011-06-27 Thread osama hussien
the backage lmomco can plot the L-moments ratio diagram would it be possible to draw the TL moments diagram also? -- Osama Abdelaziz Hussien Department of Statistics Faculty of Commerce Alexandria University Egypt __ R-help@r-project.org mailing list h

Re: [R] cumulative incidence plot vs survival plot

2011-06-27 Thread David Winsemius
On Jun 27, 2011, at 5:04 PM, array chip wrote: Hi David, Thanks for responding, and plain text ...(didn't realized I was in rich text). The endpoint is disease recurrence, I was producing a regular KM plot of recurrence-free probability. Then someone recommend using cumulative incidenc

[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<-read.tab

[R] R-GUI shutdown

2011-06-27 Thread xin123620
Dear R Users, I was using R to import several years traffic data, but every time after data successfully imported (no error or warning) when I tried to save this workplace or tackle these data, R GUI would automatically shut down. Would you have any ideas that how I should deal with this situation

[R] new read.table() error message in R 2.13.0 reading UTF-8 input

2011-06-27 Thread Levy, Roger
Hi, Consistent with recent reports (http://tolstoy.newcastle.edu.au/R/e14/devel/11/06/0434.html) I have found what I believe is an error new to R 2.13.0 when reading a UTF-8 encoded file. Minimal example: === filename: test.txt = 1 2 3 Я 4 ===

Re: [R] BY GROUP IN GEV

2011-06-27 Thread Peter Maclean
Hi Dennis: I tried your suggestions and I am getting the following errors: Error in x$CP1 : $ operator is invalid for atomic vectors In addition: Warning message: In sqrt(diag(varcov)) : NaNs produced  Peter Maclean Department of Economics UDSM - Original Message From: Dennis Murphy

[R] create a new data frame after comparing two columns of the previous data frame

2011-06-27 Thread Nanami 13
Hi everyone, I am trying to find a way to filter a table; If I am given for example the following table: > head(intra) chr miRNA start end strand ACC hsa_ID region region_start region_end gene_id transcrip_id 1 chr1 miRNA 1102484 1102578 + ACC="MI342";

Re: [R] import text-records and set the fields in a table

2011-06-27 Thread Steven Kennedy
As long as all the fields in each entry are the same, then the following will work df<-data.frame(photo_id=NA,owner=NA,secret=NA,server=NA,farm=NA,title=NA, ispublic=NA,isfriend=NA,isfamily=NA,tags=NA) x<-'' y<-strsplit(x,split="=\"") tmp<-c() for (i in 2:length(y[[1]])){ tmp[i-1

[R] testInstalledPackages

2011-06-27 Thread Cody Hamilton
Dear group,   When running the installation test:   testInstalledPackages("both",outDir='c:/Test')   I got the following message: Running ‘testci.R’ comparing ‘testci.Rout’ to ‘testci.Rout.save’ ... files differ in number of lines: Please note the test does not result in 'OK' as do the other test

Re: [R] Simple simulations

2011-06-27 Thread Alexander Engelhardt
Here's a one-liner. Let's see their software do that! sum(replicate(100, sum(sample(c(rep(0, 20), seq(1:37)), 3, replace = FALSE)) == 0)) Am 27.06.2011 23:08, schrieb robcinm: I am taking a basic statistics course this summer, and while the majority of the class is using a statistical packa

Re: [R] New to R, trying to use agnes, but can't load my ditance matrix

2011-06-27 Thread Bill.Venables
The first problem is that you are using a character string as the first argument to agnes() The help information for agnes says that its first argument, x, is x: data matrix or data frame, or dissimilarity matrix, depending on the value of the 'diss' argument. Not a character

Re: [R] Simple simulations

2011-06-27 Thread Jorge Ivan Velez
Hi robcinm, You might also consider: # data x <- c(rep(0, 20), 1:37) # number of simulations B <- 1000 # result: TRUE/FALSE out <- replicate(B, { y <- sample(x, 3, replace = FALSE) all(y == 0) }) mean(out) HTH, Jorge On Mon, Jun 27, 2011 at 5:08 PM, robcinm <> wrote: > I

Re: [R] Simple simulations

2011-06-27 Thread Steven Kennedy
#sampling elements x<-c(rep(0, 20), seq(1:37)) #number of simulations to perform sims<-100 #vector to store results results<-c() #using for loop to perform simulations for(i in 1:sims){ #take your sample y<-sample(x,3,replace=FALSE) #check if all elements are zero

[R] Customizing a heatmap plot

2011-06-27 Thread Josh B
Dear R users, Please consider the following example: tmp <- matrix(rnorm(100),10,10) tmp[upper.tri(tmp, diag = TRUE)] <- NA heatmap(tmp, col = heat.colors(200), Rowv=NA, Colv=NA) I have three questions: (1) How would I change the axis labels from 1:10 to c("apples", "pears", "bananas", "kiwis"

[R] Simple simulations

2011-06-27 Thread robcinm
I am taking a basic statistics course this summer, and while the majority of the class is using a statistical package that came with the book, I am doing everything in R for practical reasons. Forgive me if there is documentation/instruction easily available on this topic, but Google and forums sea

Re: [R] cumulative incidence plot vs survival plot

2011-06-27 Thread array chip
Hi David, Thanks for responding, and plain text ...(didn't realized I was in rich text). The endpoint is disease recurrence, I was producing a regular KM plot of recurrence-free probability. Then someone recommend using cumulative incidence is preferred because death was censored in the dataset

Re: [R] Overlapping areas under normal distributions

2011-06-27 Thread Uwe Ligges
On 27.06.2011 20:28, scaramouch wrote: Thank you for the answer, If you thank me and ask me a follow up, please also send a message to me, not only to the list. Please also quote the original message, not all list members (and particularly not myself) can remember the original stuff in th

Re: [R] XLConnect Error

2011-06-27 Thread Uwe Ligges
On 27.06.2011 20:48, wwreith wrote: Any ideas of what is happening when I attempt to load XLConnect? I think I installed everything correctly. I posted what I get when I installed rJava as well as when I attempted to load rJava directly. Thanks in advance for any help you can give on this. lib

[R] missForest to impute missing values

2011-06-27 Thread saskay
Hi, I have a 1,785,421 rows x200 variables dataset with some missing values. Approximately 55% of 1,785,421x200 are missing cells. In this ftp://ftp.stat.berkeley.edu/pub/users/breiman/Using_random_forests_v4.0.pdf document , it is claimed that random forests can impute with great accuracy even wit

Re: [R] cumulative incidence plot vs survival plot

2011-06-27 Thread David Winsemius
On Jun 27, 2011, at 4:31 PM, array chip wrote: Hi, I am wondering if anyone can explain to me if cumulative incidence (CI) is just "1 minus kaplan-Meier survival"? First tell us what you think CI is defined as. I suspect it is not the same. The KM estimator is cumulative product of (alive

[R] cumulative incidence plot vs survival plot

2011-06-27 Thread array chip
Hi, I am wondering if anyone can explain to me if cumulative incidence (CI) is just "1 minus kaplan-Meier survival"? Under what circumstance, you should use cumulative incidence vs KM survival? If the relationship is just CI = 1-survival, then what difference it makes to use one vs. the other?

Re: [R] Upgrading R

2011-06-27 Thread Patrick Connolly
On Mon, 27-Jun-2011 at 01:22AM -0700, thomas.chesney wrote: |> Is there any easy way I can upgrade R without losing all of my |> packages, when I'm using a computer (Mac) on an organisation's |> network which blocks the package installer? Keep a separate library for the packages you specifically

[R] XLConnect Error

2011-06-27 Thread wwreith
Any ideas of what is happening when I attempt to load XLConnect? I think I installed everything correctly. I posted what I get when I installed rJava as well as when I attempted to load rJava directly. Thanks in advance for any help you can give on this. library(XLConnect) Loading required packag

Re: [R] Overlapping areas under normal distributions

2011-06-27 Thread scaramouch
Thank you for the answer, but how can i integrate the difference? There is always an error with integrate(). Kindly regards, Scaramouch -- View this message in context: http://r.789695.n4.nabble.com/Overlapping-areas-under-normal-distributions-tp3625807p3628473.html Sent from the R help mailing

Re: [R] Kernel Density Estimation at manually specified points

2011-06-27 Thread David Winsemius
On Jun 27, 2011, at 3:18 PM, Carsten Harlaß wrote: Hello, thanks for your response. Of course I already thought about this "simple" solution of the problem. But I think this is not a nice workaround. If I understand the manual correctly, density() already makes an approximation. But this

Re: [R] Neg Binomial In GEE

2011-06-27 Thread SamiC
Thanks, I have been using zuurs book but it only goes as far as poisson and binomial GEE's. Initially I fitted a glm with poisson and this was over dispersed. Then moved to binomial, but residual patterns are not great (ie variance). Looks like some spatial correlation. However, in the GEE with

Re: [R] Kernel Density Estimation at manually specified points

2011-06-27 Thread Carsten Harlaß
Hello, thanks for your response. Of course I already thought about this "simple" solution of the problem. But I think this is not a nice workaround. If I understand the manual correctly, density() already makes an approximation. But this approximation is just evaluated at the wrong points. See:

Re: [R] Neg Binomial In GEE

2011-06-27 Thread Ben Bolker
SamiC aberdeen.ac.uk> writes: > > Hi, I want to fit a GEE with a negative binomial distribution. I have uesd > already a poisson glm and then neg binommial to deal with alot of > dispersion. In my neg binomial residuals i have some patterns so i have > implemented a GEE, but only with a poisso

[R] Hardy Weinberg Simulation

2011-06-27 Thread Jim Silverton
Hello, I am trying to simulate 10 relicates of 100-tables. Each table is a 2 x 3 and 80% pf the tables are true nulls and 20% are non-nulls. The nulls follow the Hardy Weinberg distribution (ratio) 1:2:1. I have the code below but the p-values are not what I am expecting. I want to use the Cochran

Re: [R] Standards for delivery of GPL software in CRAN packages

2011-06-27 Thread Galkowski, Jan
Regarding the subject, I want to thank the many respondents for clarifying the nature of the relationship between R and the GPL, as well as giving help with the structure of R-delivered source. I want to emphasize I meant nothing at all harsh or accusatory in my email. I did say I had access to

Re: [R] Recoding several variables into one use the most recent data

2011-06-27 Thread David Winsemius
On Jun 27, 2011, at 12:56 PM, Christopher Desjardins wrote: Hi, I have the following data management issue. I am trying to combine multiple years of ethnicity data into one variable called ethnic. The data looks similar to the following idethnic07ethnic08 ethnic09ethnic10 1

[R] Recoding several variables into one use the most recent data

2011-06-27 Thread Christopher Desjardins
Hi, I have the following data management issue. I am trying to combine multiple years of ethnicity data into one variable called ethnic. The data looks similar to the following idethnic07ethnic08 ethnic09ethnic10 1 1 1 11 2 1

Re: [R] how to replace the following string

2011-06-27 Thread Changbin Du
Thanks, Jim! It is exactly what I want, appreciated! On Mon, Jun 27, 2011 at 10:22 AM, jim holtman wrote: > Is this what you want: > > > test > [1] "H.1.Y" "N.0.E" "G.1.N" "E.0.P" "W.2.G" "W.4.G" "W.3.W" "W.0.N" "D.1.H" > > sub("\\.([0-9]+)\\.", "{\\1}", test) > [1] "H{1}Y" "N{0}E" "G{1}N" "E

Re: [R] how to replace the following string

2011-06-27 Thread jim holtman
Is this what you want: > test [1] "H.1.Y" "N.0.E" "G.1.N" "E.0.P" "W.2.G" "W.4.G" "W.3.W" "W.0.N" "D.1.H" > sub("\\.([0-9]+)\\.", "{\\1}", test) [1] "H{1}Y" "N{0}E" "G{1}N" "E{0}P" "W{2}G" "W{4}G" "W{3}W" "W{0}N" "D{1}H" > On Mon, Jun 27, 2011 at 1:18 PM, Changbin Du wrote: > HI,  Dear R-commun

[R] how to replace the following string

2011-06-27 Thread Changbin Du
HI, Dear R-community, I have one vector of the following string, > test<-c("H.1.Y", "N.0.E", "G.1.N", "E.0.P", "W.2.G", "W.4.G", "W.3.W", "W.0.N", "D.1.H") > test [1] "H.1.Y" "N.0.E" "G.1.N" "E.0.P" "W.2.G" "W.4.G" "W.3.W" "W.0.N" "D.1.H" *I want to change them into* "H{1}Y" "N{0}E" "G{1}N" "

Re: [R] Kernel Density Estimation at manually specified points

2011-06-27 Thread David L Carlson
Look at ?approx. For your example (of course your random numbers give different results): > approx(f$x, f$y, c(-2, -1, 0, 1, 2)) $x [1] -2 -1 0 1 2 $y [1] 0.03757113 0.19007982 0.31941779 0.37066592 0.10227509 approx gives NA's if you try to interpolate outside the bounds of the data. ---

Re: [R] Model II regression

2011-06-27 Thread David L Carlson
Look at package smatr. It fits RMA (called here standardized major axis) regression, plots the line, and provides confidence limits. -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 -Orig

Re: [R] Standards for delivery of GPL software in CRAN packages

2011-06-27 Thread Berwin A Turlach
G'day Gavin, On Mon, 27 Jun 2011 16:36:57 +0100 Gavin Simpson wrote: [...] > I don't recall the GPL mentioning anything requiring that the source > code be "helpful". The authors have most certainly fulfilled their > requirements under GPL, as has CRAN in distributing the package > sources. > >

Re: [R] show colums x till end

2011-06-27 Thread Bert Gunter
Yes. Perhaps also worth mentioning in this context because they're generic are head() and tail() -- ?head Cheers, Bert On Mon, Jun 27, 2011 at 9:01 AM, Eik Vettorazzi wrote: > Hi, > mydata[1:3, -(1:4)] > > saves some typing. > > cheers > > Am 27.06.2011 16:51, schrieb Berry Boessenkool: >> >>

Re: [R] assign using =

2011-06-27 Thread Gabor Grothendieck
On Mon, Jun 27, 2011 at 10:34 AM, Berry Boessenkool wrote: > > > Hey all, > > I learned that using the equals sign "=" to assign objects is generally OK, > but will not work in some cases. > As I always use "<-" for assignments, I have not encoutered any problems. > > Could somebody provide an ex

Re: [R] Standards for delivery of GPL software in CRAN packages

2011-06-27 Thread Galkowski, Jan
No, you are correct. It meets the letter of GPL. Took me a while to find FunctionINIT.R though. As I wrote in the original, source is available, if only by keying in function names and seeing their value. Was hoping for greater clarity. I of course have the paper and the help. I was trying to u

Re: [R] show colums x till end

2011-06-27 Thread Eik Vettorazzi
Hi, mydata[1:3, -(1:4)] saves some typing. cheers Am 27.06.2011 16:51, schrieb Berry Boessenkool: > > > Hey again, > > I didn't wat questions to get mangled up, so here's my second email. > > In matlab, there is the simple possibility to access colums x till last of a > matrix using > mydat

Re: [R] assign using =

2011-06-27 Thread Kevin E. Thorpe
On 06/27/2011 10:34 AM, Berry Boessenkool wrote: Hey all, I learned that using the equals sign "=" to assign objects is generally OK, but will not work in some cases. As I always use "<-" for assignments, I have not encoutered any problems. Could somebody provide an example or explanation, w

Re: [R] Standards for delivery of GPL software in CRAN packages

2011-06-27 Thread Gavin Simpson
On Mon, 2011-06-27 at 11:14 -0400, Galkowski, Jan wrote: > Fine. Attached. It's "waved". > > All it has is *.Rd files. Apparently the functions are collected in > "functionINIT.R". But "00Index" and "DESCRIPTION" are not helpful. > > - j The Rd files are the help or manual "pages" for the func

Re: [R] Standards for delivery of GPL software in CRAN packages

2011-06-27 Thread Sarah Goslee
On Mon, Jun 27, 2011 at 11:14 AM, Galkowski, Jan wrote: > Fine.  Attached. It's "waved". > > All it has is *.Rd files. Apparently the functions are collected in > "functionINIT.R". But "00Index" and "DESCRIPTION" are not helpful. All the R code is in functionINIT.R. Are you objecting because the

Re: [R] Standards for delivery of GPL software in CRAN packages

2011-06-27 Thread Uwe Ligges
On 27.06.2011 17:14, Galkowski, Jan wrote: Fine. Attached. It's "waved". All it has is *.Rd files. Apparently the functions are collected in "functionINIT.R". But "00Index" and "DESCRIPTION" are not helpful. Are you joking or just pulling us? All these files are interpreted by R and essent

Re: [R] Add use of dput() to the instructions at bottom of post?

2011-06-27 Thread John Kane
Apologies David, Every once in a while I hit the wrong reply button. The post was meant to be a Reply All. I'll post this one to the list. --- On Mon, 6/27/11, David Winsemius wrote: > From: David Winsemius > Subject: Re: [R] Add use of dput() to the instructions at bottom of post? > To: "Jo

Re: [R] Standards for delivery of GPL software in CRAN packages

2011-06-27 Thread Galkowski, Jan
Fine. Attached. It's "waved". All it has is *.Rd files. Apparently the functions are collected in "functionINIT.R". But "00Index" and "DESCRIPTION" are not helpful. - j -Original Message- From: b.rowling...@googlemail.com [mailto:b.rowling...@googlemail.com] On Behalf Of Barry Rowlin

[R] Neg Binomial In GEE

2011-06-27 Thread SamiC
Hi, I want to fit a GEE with a negative binomial distribution. I have uesd already a poisson glm and then neg binommial to deal with alot of dispersion. In my neg binomial residuals i have some patterns so i have implemented a GEE, but only with a poisson family as i couldnt with neg binomial. H

[R] show colums x till end

2011-06-27 Thread Berry Boessenkool
Hey again, I didn't wat questions to get mangled up, so here's my second email. In matlab, there is the simple possibility to access colums x till last of a matrix using mydata(1:3, 5:end). In R, I so far use mydata[1:3, 5:ncol(mydata)] Is there a faster way? (in terms of typing) Thanks ahe

Re: [R] assign using =

2011-06-27 Thread David Stevens
I'm not an expert but some third party libraries won't recognize = as an assignment for some objects (I learned this empirically) when the assignment is made within a function. Using <- protects you from these unknows, as you have discovered on your own. Regards David On 6/27/2011 8:34 AM, Be

[R] assign using =

2011-06-27 Thread Berry Boessenkool
Hey all, I learned that using the equals sign "=" to assign objects is generally OK, but will not work in some cases. As I always use "<-" for assignments, I have not encoutered any problems. Could somebody provide an example or explanation, why getting used to "=" is not a good idea? Or is i

Re: [R] Estimate zero inflated mixed model parameter

2011-06-27 Thread Ben Bolker
yahoo.com> writes: > > Hi, I can not estimate the zero inflated mixed model parameters successfully. If it is possible, would you > please help me write the code? In my case, I consider the location as a random effect. My data are: > > location y x1 x2 x3 > 1 > 1 > 1 > 2 > 2 > 2 > 3 > 3 >

[R] Using 'foreach' for parallel computing

2011-06-27 Thread Stacey Wood
Hi all, I'm currently working on updating an R package to run for loops in parallel to speed up computation time. I'm using the 'foreach' package with a foreach loop. When I run my code inside the loop, I get an error message that a number of the functions aren't recognized (even though the func

Re: [R] Standards for delivery of GPL software in CRAN packages

2011-06-27 Thread Barry Rowlingson
On Mon, Jun 27, 2011 at 1:24 PM, Galkowski, Jan wrote: > I wondered if there were standard practices in CRAN for delivery of R source > implementing functions in R packages. I has encountered a couple of packages > where the gzipped version of source contains very little, primarily the Help > f

Re: [R] group interaction in a varying coeff. model (mgcv)

2011-06-27 Thread Simon Wood
After your code below you could add... x1g <- X*(1-Group) x2g <- X*Group ## different moderator effects in the different groups... mgu <- gam(Y~s(M,by=x1g)+s(M,by=x2g)) ## same moderator effects, but different intercepts in the groups... mgc <- gam(Y~s(M,by=X)+Group) ## Alternative way of spec

Re: [R] Add use of dput() to the instructions at bottom of post?

2011-06-27 Thread David Winsemius
On Jun 27, 2011, at 9:44 AM, Ivan Calandra wrote: I actually thought it was in the posting guide, but I could not find it with a text search. Did I overlook it? The Posting Guide has an equivalent method it suggests. It has the trivial advantantage of being truly cut-and-pastable but the

Re: [R] New to R, trying to use agnes, but can't load my ditance matrix

2011-06-27 Thread Sarah Goslee
On Mon, Jun 27, 2011 at 3:43 AM, Karen R. Khar wrote: > Hi, > > I'm mighty new to R. I'm using it on Windows. I'm trying to cluster using a > distance matrix I created from the data on my own and called it D10.dist. I > loaded the cluster package. Then tried the following command... > >> agnes("E:

Re: [R] Add use of dput() to the instructions at bottom of post?

2011-06-27 Thread Ivan Calandra
I actually thought it was in the posting guide, but I could not find it with a text search. Did I overlook it? I'm not sure that adding the dput() function at the bottom of every e-mail will help, since you don't see it when you write an e-mail, just when you receive one. Though it cannot hurt

Re: [R] New to R, trying to use agnes, but can't load my ditance matrix

2011-06-27 Thread Karen R. Khar
I also tried... D1 D2 D3 D4 D5 D6 D7 D8 D9 D2 0.608392 D3 0.4974510.537662 D4 0.6345480.3933430.537426 D5 0.5587850.5433990.6322210.726633 D6 0.6594830.7017780.7414

[R] group interaction in a varying coeff. model (mgcv)

2011-06-27 Thread Denes Toth
Dear UseRs, I built varying coefficient models (in mgcv) for two groups separately, with one explanatory and one moderator variable (see the example below). # --- #  Example: # -- # generate moderator variable (can the same for both groups) modvar <- c(1:1000) # generate group1 value

Re: [R] R PLS package data format

2011-06-27 Thread Peter Ehlers
On 2011-06-27 03:02, 新鼎-智慧製造事業處-鄭紹文 wrote: Dear sir, If I have a vector as: y<- c(1:4) and a matrix as: x<- matrix (5:12, nrow=4, ncol=2) Then I create a data frame as: t<- data.frame(y, x) R will generate a data frame of 3 columns names(t) "y" "X1" "X2" is.vector(t$X1) returns TRUE is

Re: [R] R PLS package data format

2011-06-27 Thread Patrizio Frederic
hi, because of my ignorance I can't figure out why would you need such a structure. However the following trick works: > a <- matrix(1:6,3) > b <- data.frame(1:3) > b$a <- a > b X1.3 a.1 a.2 11 1 4 22 2 5 33 3 6 > names(b) [1] "X1.3" "a" > class(b$a) [1] "matrix" > is.mat

[R] Add use of dput() to the instructions at bottom of post?

2011-06-27 Thread John Kane
It's often difficult to figure out what a problem data set looks like when someone pastes a mess of output from R into an e-mail. The dput command, used judiciously—I would hope no one would send a 1 M data set—can make life much easier. I wonder if it would be useful to add a hint in the inst

Re: [R] Standards for delivery of GPL software in CRAN packages

2011-06-27 Thread Marc Schwartz
On Jun 27, 2011, at 7:24 AM, Galkowski, Jan wrote: > I wondered if there were standard practices in CRAN for delivery of R source > implementing functions in R packages. I has encountered a couple of packages > where the gzipped version of source contains very little, primarily the Help > file

Re: [R] Standards for delivery of GPL software in CRAN packages

2011-06-27 Thread Trevor Jenkins
On Mon, Jun 27, 2011 at 1:24 PM, Galkowski, Jan wrote: > I wondered if there were standard practices in CRAN for delivery of R > source implementing functions in R packages. I has encountered a couple of > packages where the gzipped version of source contains very little, primarily > the Help fil

  1   2   >