Re: [R] The correct way to set an element in a list to NULL? (FAQ is not clear)

2009-12-11 Thread Steve Lianoglou
On Dec 11, 2009, at 1:20 PM, Peng Yu wrote: On Fri, Dec 11, 2009 at 11:51 AM, Steve Lianoglou mailinglist.honey...@gmail.com wrote: On Dec 11, 2009, at 12:36 PM, Peng Yu wrote: [snip] What seems confusing to me is: even 'x[i]-list(NULL)' and 'x[[i]]-list(NULL)' are different, why

Re: [R] cluster size

2009-12-11 Thread Tal Galili
Hello Karuna, Christian answer was great and very detailed. One more approach you might want to try is using the K-medoids algorithm instead of the K-means. That can be used through the pam command (from the cluster package) See more here:

[R] How to calculte the power of a matrix

2009-12-11 Thread Moohwan Kim
Dear R family I have a following question. Suppose I have a matrix as follows, for instance: tau= 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 I want to calculate (-m) power of tau, for example, m=893. When I run tau^2, the outcome is just tau. Any help would be appreciated.

Re: [R] Literature analysis

2009-12-11 Thread Liviu Andronic
Hello On 12/11/09, Schwan s.s.hosse...@utwente.nl wrote: However, I dont know how to tell R that it just should look for e.g. author,keywords and year and how to plot these for example on x axis the author and y axis the keywords and on z axis the year? I suggest that you try to get going

Re: [R] How to calculte the power of a matrix

2009-12-11 Thread Steve Lianoglou
Hi, On Dec 11, 2009, at 2:01 PM, Moohwan Kim wrote: Dear R family I have a following question. Suppose I have a matrix as follows, for instance: tau= 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 I want to calculate (-m) power of tau, for example, m=893. When I run tau^2,

Re: [R] How to calculte the power of a matrix

2009-12-11 Thread William Dunlap
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Moohwan Kim Sent: Friday, December 11, 2009 11:01 AM To: r-help@r-project.org Subject: [R] How to calculte the power of a matrix Dear R family I have a following question. Suppose I have a matrix

Re: [R] Why a list of NULL's are reduced to NULL?

2009-12-11 Thread Charlie Sharpsteen
On Fri, Dec 11, 2009 at 10:24 AM, Peng Yu pengyu...@gmail.com wrote: How do you figure out all the possibilities? Well, the Value section of the third party function's help page should outline the return types it produces. If it doesn't cover all cases, write a letter to the package

Re: [R] Why a list of NULL's are reduced to NULL?

2009-12-11 Thread Don MacQueen
I would study the third party function and learn all the types it can return. After all if you don't know what type it's going to return, how can you possibly make *any* confident use of its output? Do you actually have this situation? A third part function that is so poorly documented that

Re: [R] how can generate from trunceted gamma distribution in R ?

2009-12-11 Thread Greg Snow
One approach is to sample from a non-truncated inverse gamma, then if the observation is in the part you want truncated, throw it away and generate a new value. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original

[R] how to simulate brown, white and pink noise time series

2009-12-11 Thread Enrico R. Crema
Dear List, Is it possible to simulate a time-series in R based on 1/f noise? Many Thanks Enrico Crema --- Enrico R. Crema PhD Candidate Institute of Archaeology, UCL AHRC Centre for the Evolution of Cultural Diversity, UCL Centre for Advanced Spatial Analysis,

[R] Regularized gamma function/ incomplete gamma function

2009-12-11 Thread A.Noufaily
Dear all, I would be very grateful if you could help me with: Given the regularized gamma function Reg=int_0^r (x^(k-1)e^(-x))dx/int_0^Inf (x^(k-1)e^(-x))dx ; 0rInf (which is eventually the ratio of the Incomplete gamma function by the gamma function), does anyone know of a package in R that

[R] Problems with Rcmd install package

2009-12-11 Thread Keshk, Omar
Dear all I have tried several times to make and install an R package that i created. However, whenever i get to the last step and try to install the package i get the following error: C:\Rtools\binrcmd install C:\program files\R\R-2.9.2\bin\Test_1.0.tar.gz Can't open perl script

Re: [R] Labeling plot points

2009-12-11 Thread Doug Hill
Hi, again. False alarm, I thought I'd call lattice.demo() as a quick check of my install, but that was a bad idea and the errors were a red herring. Looked at you HWidentify() directly and now I get it - thanks! Doug Greg Snow-2 wrote: There are 2 functions in the development version of the

Re: [R] Labeling plot points

2009-12-11 Thread Doug Hill
Greg, I tried installing v2.5 using the instructions on R-forge but ran into errors: install.packages(TeachingDemos, repos=http://R-Forge.R-project.org;) Warning: unable to access index for repository http://R-Forge.R-project.org/bin/windows/contrib/2.10 Warning message: In

[R] Calculation of slope for Poisson regression

2009-12-11 Thread borealis_north
Hello, I am analyzing time-series data for multiple songbird species in northern Canada where data were collected at 3 point count stations within a stand (~150 stations) visited twice a year and with multiple observers. I am using a linear mixed effects model (lme4) that includes year as a

Re: [R] Problem with calibrate function

2009-12-11 Thread Rodrigo
Frank E Harrell Jr wrote: Rodrigo wrote: Hi, I´m trying to use the calibrate function from rms package (made by prof. Harrell) after fitting a model using cph. But it returns the following error message: calibrate(modelo1,B=200,bw=F,u=13) Using Cox survival estimates at 13 Days

[R] Correcting for missing data combinations

2009-12-11 Thread GL
I can think of many brute-force ways to do this outside of R, but was wondering if there was a simple/elegant solution within R instead. I have a table that looks something like the following: Factor1 Factor2 Value A 11/11/2009 5 A 11/12/2009 4 B 11/11/2009

Re: [R] library(survival)-- cluster

2009-12-11 Thread Terry Therneau
The query was why survreg() with a cluster() statement fails. The answer: a bug. A call to resid() preceded setting the class of the result to 'survreg'. I am currently adding another case to the test suite so that this does not happen again, and to formally validate that the numeric

Re: [R] Problem with calibrate function

2009-12-11 Thread Frank E Harrell Jr
Rodrigo wrote: Frank E Harrell Jr wrote: Rodrigo wrote: Hi, I´m trying to use the calibrate function from rms package (made by prof. Harrell) after fitting a model using cph. But it returns the following error message: calibrate(modelo1,B=200,bw=F,u=13) Using Cox survival estimates at

Re: [R] Please help with a basic function

2009-12-11 Thread Don MacQueen
At 8:19 AM -0600 12/11/09, Mark Na wrote: Hello, I am learning how to use functions, but I'm running into a roadblock. I would like my function to do two things: 1) convert an object to a dataframe, 2) and then subset the dataframe. Both of these commands work fine outside the function, but I

Re: [R] Correcting for missing data combinations

2009-12-11 Thread Charles C. Berry
On Fri, 11 Dec 2009, GL wrote: I can think of many brute-force ways to do this outside of R, but was wondering if there was a simple/elegant solution within R instead. I have a table that looks something like the following: Factor1 Factor2 Value A 11/11/2009 5 A

[R] Data

2009-12-11 Thread Jose Narillos de Santos
Hi all, Imagine I have a matrix and the first colum is a list that repeats the same names, I want to sum the second column on each unique name on first column. Imagine this: Pepe 2 Pepe 3 Pepe 4 Jose 2 Jose 5 Manuel 4 Manuel 2 I want to make a new matrix that calculates and recognizes that

Re: [R] Why a list of NULL's are reduced to NULL?

2009-12-11 Thread Peng Yu
On Fri, Dec 11, 2009 at 2:50 PM, Don MacQueen m...@llnl.gov wrote: I would study the third party function and learn all the types it can return. After all if you don't know what type it's going to return, how can you possibly make *any* confident use of its output? Do you actually have this

Re: [R] Why a list of NULL's are reduced to NULL?

2009-12-11 Thread Peng Yu
On Fri, Dec 11, 2009 at 2:37 PM, Charlie Sharpsteen ch...@sharpsteen.net wrote: On Fri, Dec 11, 2009 at 10:24 AM, Peng Yu pengyu...@gmail.com wrote: How do you figure out all the possibilities? Well, the Value section of the third party function's help page should outline the return types it

Re: [R] Correcting for missing data combinations

2009-12-11 Thread Greg Hirson
One approach would be to use expand.grid to generate all combinations and then match against what you have. A short example: #generate data - two factors - 4 levels in factor1, 26 levels in factor2 df - data.frame(factor1 = sample(LETTERS[1:4], 100, replace=T), factor2 = sample(letters,

Re: [R] Why a list of NULL's are reduced to NULL?

2009-12-11 Thread Steve Lianoglou
On Dec 11, 2009, at 4:45 PM, Peng Yu wrote: On Fri, Dec 11, 2009 at 2:37 PM, Charlie Sharpsteen ch...@sharpsteen.net wrote: On Fri, Dec 11, 2009 at 10:24 AM, Peng Yu pengyu...@gmail.com wrote: How do you figure out all the possibilities? Well, the Value section of the third party

Re: [R] Why a list of NULL's are reduced to NULL?

2009-12-11 Thread Peng Yu
On Fri, Dec 11, 2009 at 3:49 PM, Steve Lianoglou mailinglist.honey...@gmail.com wrote: On Dec 11, 2009, at 4:45 PM, Peng Yu wrote: On Fri, Dec 11, 2009 at 2:37 PM, Charlie Sharpsteen ch...@sharpsteen.net wrote: On Fri, Dec 11, 2009 at 10:24 AM, Peng Yu pengyu...@gmail.com wrote: How do you

[R] R download

2009-12-11 Thread Jose Narillos de Santos
Hi all I want to make a copy about R in a external disk. How many bytes will occupe if I could dowload all disposable libraries? Is it possible? How should I proceed? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Data

2009-12-11 Thread David Winsemius
On Dec 11, 2009, at 4:38 PM, Jose Narillos de Santos wrote: Hi all, Imagine I have a matrix and the first colum is a list that repeats the same names, I want to sum the second column on each unique name on first column. Imagine this: Pepe 2 Pepe 3 Pepe 4 Jose 2 Jose 5 Manuel 4 Manuel 2

Re: [R] Data

2009-12-11 Thread Jorge Ivan Velez
Hi Jose, Here is a suggestion using tapply(): R x - read.table(textConnection(Pepe 2 + Pepe 3 + Pepe 4 + Jose 2 + Jose 5 + Manuel 4 + Manuel 2), header = FALSE) R closeAllConnections() R x V1 V2 1 Pepe 2 2 Pepe 3 3 Pepe 4 4 Jose 2 5 Jose 5 6 Manuel 4 7 Manuel 2 R R R

Re: [R] Why a list of NULL's are reduced to NULL?

2009-12-11 Thread David Winsemius
On Dec 11, 2009, at 4:56 PM, Peng Yu wrote: On Fri, Dec 11, 2009 at 3:49 PM, Steve Lianoglou mailinglist.honey...@gmail.com wrote: On Dec 11, 2009, at 4:45 PM, Peng Yu wrote: On Fri, Dec 11, 2009 at 2:37 PM, Charlie Sharpsteen ch...@sharpsteen.net wrote: On Fri, Dec 11, 2009 at 10:24 AM,

Re: [R] Why a list of NULL's are reduced to NULL?

2009-12-11 Thread Steve Lianoglou
On Dec 11, 2009, at 4:56 PM, Peng Yu wrote: On Fri, Dec 11, 2009 at 3:49 PM, Steve Lianoglou mailinglist.honey...@gmail.com wrote: On Dec 11, 2009, at 4:45 PM, Peng Yu wrote: On Fri, Dec 11, 2009 at 2:37 PM, Charlie Sharpsteen ch...@sharpsteen.net wrote: On Fri, Dec 11, 2009 at 10:24

Re: [R] how to simulate brown, white and pink noise time series

2009-12-11 Thread Ben Bolker
Enrico R. Crema enrico.crema at gmail.com writes: Dear List, Is it possible to simulate a time-series in R based on 1/f noise? http://people.biology.ufl.edu/bolker/landsc.html gives some information on simulating fractal landscapes. I think you could treat a 1-D landscape as a time

[R] extracting vectors from lists of lists

2009-12-11 Thread Jennifer Young
Good evening I often have as output from simulations a list of various values, vectors and matrices. Supposing that I then run said simulation several times, I often want to extract a particular result from each simulation for plotting and, ideally, put it in a matrix. A simple example v1 - 1:5

Re: [R] Notification of false convergence with lmer()

2009-12-11 Thread Ben Bolker
jjh jjharden at gmail.com writes: I am running the lmer() command in a for loop and occasionally a particular iteration is producing the false convergence warning. I would like to be able to mark these iterations with a dummy variable, but I can't find any other notification besides the

Re: [R] R download

2009-12-11 Thread Jose Narillos de Santos
Sorry about the last question I ´m reading the solution. Sorry again. 2009/12/11 Jose Narillos de Santos narillosdesan...@gmail.com Hi all I want to make a copy about R in a external disk. How many bytes will occupe if I could dowload all disposable libraries? Is it possible? How should I

Re: [R] extracting vectors from lists of lists

2009-12-11 Thread Phil Spector
Jennifer - Does this do what you want? v1 = sapply(output,'[[','vec') v2 = sapply(output,'[[','other') v1 [,1] [,2] [1,]16 [2,]27 [3,]38 [4,]49 [5,]5 10 v2 [1] stuff stuff (in more readable form: v1 = sapply(output,function(x)x$vec) v2 =

Re: [R] extracting vectors from lists of lists

2009-12-11 Thread Benilton Carvalho
oh.. and i just saw the bonus part... just replace lapply() by sapply(). b On Dec 11, 2009, at 8:33 PM, Jennifer Young wrote: Good evening I often have as output from simulations a list of various values, vectors and matrices. Supposing that I then run said simulation several times, I

Re: [R] extracting vectors from lists of lists

2009-12-11 Thread David Winsemius
On Dec 11, 2009, at 5:33 PM, Jennifer Young wrote: Good evening I often have as output from simulations a list of various values, vectors and matrices. Supposing that I then run said simulation several times, I often want to extract a particular result from each simulation for plotting

Re: [R] Regularized gamma function/ incomplete gamma function

2009-12-11 Thread Stefan Evert
I would be very grateful if you could help me with: Given the regularized gamma function Reg=int_0^r (x^(k-1)e^(-x))dx/ int_0^Inf (x^(k-1)e^(-x))dx ; 0rInf (which is eventually the ratio of the Incomplete gamma function by the gamma function), does anyone know of a package in R that would

[R] random effects in mixed model not that 'random'

2009-12-11 Thread Thomas Mang
Hi, I have the following conceptual / interpretative question regarding random effects: A mixed effects model was fit on biological data, with observations coming from different species. There is a clear overall effect of certain predictors (entering the model as fixed effect), but as

[R] Export R output to Word/RTF?

2009-12-11 Thread Wenjie Lee
Hi R Experts, I'm aware of pdf(), jpeg(),... functions. But, 1. Is it also possible to export graphs directly to word or RTF? I use to copy and paste graphs but resolutions are not so great. 2. Also, is it possible to export your out to word file? I use sink() function to export it text files.

Re: [R] Correcting for missing data combinations

2009-12-11 Thread Gray Calhoun
This is nice; the matching could be shortened by using merge: ### quoted from the previous message #generate data - two factors - 4 levels in factor1, 26 levels in factor2 df - data.frame(factor1 = sample(LETTERS[1:4], 100, replace=T), factor2 = sample(letters, 100, replace=T), value =

Re: [R] Export R output to Word/RTF?

2009-12-11 Thread Wenjie Lee
Please read this: On Fri, Dec 11, 2009 at 6:28 PM, Wenjie Lee wenjieleemaill...@gmail.comwrote: Hi R Experts, I'm aware of pdf(), jpeg(),... functions. But, 1. Is it also possible to export graphs directly to word or RTF? I use to copy and paste graphs but resolutions are not so great.

Re: [R] Regularized gamma function/ incomplete gamma function

2009-12-11 Thread Ravi Varadhan
You can do this using the package numDeriv. require(zipfR) require(numDeriv) fn - function(x, y) Rgamma.inv(x, y) gRgamma.inv - function(y, k) sapply(y, function(y) grad(x=k, func=fn, y=y)) plot(gRgamma.inv(y=seq(0,1, length=200), k=1), type=l, xlab=x, ylab=Derivative of Rgamma.inv w.r.t.

[R] Frequency tables.

2009-12-11 Thread Kim Jung Hwa
Hi All, I'm a SAS user but I'm very much interested in learning R. I use ODS system in SAS to make nice frequency tables. Is it possible to export the output of table() [in TABULAR FORM]? So, that I can use those directly for publications? Thank you. # R Code: library(datasets) Orange

Re: [R] Have you used RGoogleDocs and RGoogleData?

2009-12-11 Thread Duncan Temple Lang
Hi Farrel I have taken a look at the problems using RGoogleDocs to read spreadsheets and was able to reproduce the problem I believe you were having. A few minor, but important, changes and I can read spreadsheets again and apparently still other types of documents. I have put an updated

Re: [R] how can generate from trunceted gamma distribution in R ?

2009-12-11 Thread Duncan Murdoch
On 11/12/2009 7:12 AM, khaz...@ceremade.dauphine.fr wrote: Hi, all How can generate a sample from truncated inverse gamma distribution in R? Using the inverse CDF method or rejection sampling are possible, depending on what your truncation is like. If your truncation forces the

Re: [R] get the enclosing function name

2009-12-11 Thread Duncan Murdoch
On 11/12/2009 8:50 AM, Hao Cen wrote: Hi, Is there a way to get the enclosing function name within a function? You confused me at first with enclosing function, but I think you can do what you want using something like f - function() { print(sys.call()[[1]]) } f() Duncan Murdoch For

Re: [R] subset or condition as argument to a function

2009-12-11 Thread Santosh
Thanks so much for the tips, I was able to use both parse() and eval()... I found eval(), quote(), bquote() easier and more flexible to use and to pass as arguments to a function. I can't say enough that you really made my day! :) Thanks, Santosh On Tue, Dec 1, 2009 at 9:36 AM, baptiste auguie

Re: [R] Problems with Rcmd install package

2009-12-11 Thread Duncan Murdoch
On 11/12/2009 1:34 PM, Keshk, Omar wrote: Dear all I have tried several times to make and install an R package that i created. However, whenever i get to the last step and try to install the package i get the following error: C:\Rtools\binrcmd install C:\program

Re: [R] Export R output to Word/RTF?

2009-12-11 Thread Don MacQueen
At 6:28 PM -0500 12/11/09, Wenjie Lee wrote: Hi R Experts, I'm aware of pdf(), jpeg(),... functions. But, 1. Is it also possible to export graphs directly to word or RTF? I use to copy and paste graphs but resolutions are not so great. I save graphs as png files, then use Word's Insert

Re: [R] Frequency tables.

2009-12-11 Thread David Winsemius
On Dec 11, 2009, at 6:55 PM, Kim Jung Hwa wrote: library(datasets) Orange summary(Orange) library(xtable) xtable(summary(Orange)) % latex table generated in R 2.10.1 by xtable 1.5-6 package % Fri Dec 11 21:39:50 2009 \begin{table}[ht] \begin{center} \begin{tabular}{rlll} \hline Tree

Re: [R] Frequency tables.

2009-12-11 Thread Ista Zahn
There are a variety of packages that help format output using either LaTeX or html. I've grown to prefer the latex() function in the Hmisc packages, but you might also be interested in xtable (can output either to LaTeX or html), R2html, or prettyR. -Ista On Fri, Dec 11, 2009 at 6:55 PM, Kim

Re: [R] some problems with ram usage and warnings

2009-12-11 Thread David Winsemius
On Dec 11, 2009, at 11:08 AM, Tom Knockinger wrote: Hi, i am new to the R-project but until now i have found solutions for every problem in toturials, R Wikis and this mailing list, but now i have some problems which I can't solve with this knowledge. I have some data like this: #

Re: [R] Frequency tables.

2009-12-11 Thread Kim Jung Hwa
Thank you David and Ista for your suggestions. I got the latex part. But, this may be stupid, I got the html code using following command, how can I make use of it? Thanks anyways. temp-xtable(summary(Orange)) print(temp, type=html) !-- html table generated in R 2.9.2 by xtable 1.5-6 package --

Re: [R] Frequency tables.

2009-12-11 Thread David Winsemius
On Dec 11, 2009, at 10:48 PM, Kim Jung Hwa wrote: Thank you David and Ista for your suggestions. I got the latex part. But, this may be stupid, I got the html code using following command, how can I make use of it? Thanks anyways. On my computer just copying that to a text editor and

Re: [R] Have you used RGoogleDocs and RGoogleData?

2009-12-11 Thread Farrel Buchinsky
It Works! Thanks a lot! Its great. What were your few minor, but important, changes - in a nutshell. I will not understand unless you describe it as high level issues. Farrel Buchinsky Google Voice Tel: (412) 567-7870 On Fri, Dec 11, 2009 at 19:07, Duncan Temple Lang

[R] How to get the right ASH using ash package

2009-12-11 Thread Saji Ren
hi,everybody: I want to get the average shifted histogram or ASH for my own data. I choose to use the package ash to compute the ASH . But there is NA values in my data, and when using the command bin1 for computing the bin counts, I was told that the command can't handle NA/NaN/Inf data. How

[R] help with graphing -- Points in my graph are not apparent, always displayed in steps

2009-12-11 Thread philip robinson
I am trying to graphically represent a large set of data who's result is not strictly uniform. http://n4.nabble.com/file/n961629/egraph_rules_list_2.png The scatter plot to the left has all of the data rising in steps however I know that there are cases within my data that do not fit the dotted

[R] About zero-inflation poisson model

2009-12-11 Thread Xiongqing Zhang
Hello all, I am Xiongqing Zhang, come from Beijing of China. I know you from the web site: http://finzi.psych.upenn.edu/Rhelp08/2008-February/154627.html. I am not very clear about the R-project software. But I want to estimate the parameters and errors of zero-inflation poisson model. Can you

<    1   2