Re: [R] Indistinguishable balls into distinguishable boxes

2012-02-04 Thread Petr Savicky
On Sat, Feb 04, 2012 at 08:45:20AM +0100, Marc Girondot wrote: Hi the list ! I would like to create a dataframe that answer to : all the combinations of the different way to distribute n indistinguishable balls into k distinguishable boxes. Let take an example: 2 balls in 3 boxes: Box1

[R] 'deparse(substitute'))' then 'assign' in a S4 methods

2012-02-04 Thread cgenolin
Hi the list, I am writing a function in which I need to affect a variable on a higher level. My fnction could be: ++ fooBis - function(x){ nameObject - deparse(substitute(x)) print(nameObject) assign(nameObject,4,envir=parent.frame()) } fooBis(e) [1] e e [1] 4

[R] r-help, survival

2012-02-04 Thread Grace Kambey
Hi, i have used the code below to come out with censored data with real values but if i want to generate data from q-rweibull(25,2,4) that involves percent eg 5% or 10% censored i do not know how to do it. Can somebody show me how to do it. Thank you in advance d -

Re: [R] sapply help

2012-02-04 Thread Milan Bouchet-Valat
Le vendredi 03 février 2012 à 18:51 +, William Dunlap a écrit : Instead of colSums(t(aMatrix)), why not the more direct rowSums(aMatrix)? Because I felt it was more didactic. The question was about counting occurrences per column, so using rowSums() could be a little confusing without an

Re: [R] Checking for invalid dates: Code works but needs improvement

2012-02-04 Thread Paul Miller
Hi David and Rui, Sorry to be so slow in replying. Thank you both for pointing out that the problem with my code was that I was using comparison operators on mixed data types. This is something I'll have to be more careful about in the future. In an earlier email, David talked about how R can

Re: [R] effect function (effects package)

2012-02-04 Thread John Fox
Dear Eileen, You apparently misunderstand what the effect() function does; it computes fitted values and their standard errors under the model (by default in a GLM on the scale of the response) at specific combinations of values of the predictors (e.g., letting two interacting predictors range

[R] Fisher Imformation

2012-02-04 Thread Christopher Kelvin
Hello, i have used the code below to estimate the parameters of weibull distribution and i want to obtain the fisher information by providing the the next code but i receive errors anytime i try to, what do i do? by the way is my replication correct and is it placed at the right position for

Re: [R] Simulating from matrix variate normal distribution

2012-02-04 Thread Ranjan Maitra
I think this should be easy to write a function doing this. Assume that Y is matrix normal with mean matrix mu and row and column dispersion matrices Sigma and Gamma, respectively. Isn't Y = AZB + mu, where Z is a matrix of independent N(0, 1)'s, A is the square root matrix of Sigma (the

[R] want to drop levels of table vector join two vector(appending)

2012-02-04 Thread sagarnikam123
is have vector from table stored in s variable s [1] R P Y A C P V E S C D R R F S R S A D L T R H I R I Levels: A C D E F G H I K L M N P Q R S T V Y -- View this message in context:

[R] eliminate rows with all NA values in matrix of special class

2012-02-04 Thread Omphalodes Verna
Dear list! I have a problem with eliminate rows with all NA values in matrix of special class (my.class). Belowe is a example: #class definition setClass(my.class, representation(ID=character,  years=integer,  my.mat=matrix)) data.1 - new(my.class, ID = c(tA, tB, tC), years =

Re: [R] want to drop levels of table vector join two vector(appending)

2012-02-04 Thread Petr Savicky
On Sat, Feb 04, 2012 at 06:07:01AM -0800, sagarnikam123 wrote: is have vector from table stored in s variable s [1] R P Y A C P V E S C D R R F S R S A D L T R H I R I Levels: A C D E F G H I K L M N P Q R S T V Y Hi. Is as.character(), what you are looking for? as.character(s) [1]

[R] Making a point-sampling matrix

2012-02-04 Thread Alaios
Dear all, I would like to create a k,n matrix which that will include - k random elements with value 1 -all rest zeros -one single 1 in each row - each column will have maximum one 1 so far I have a so stupid function that with nested while tries to fit k numbers randomly in a row by row

Re: [R] Making a point-sampling matrix

2012-02-04 Thread andrija djurovic
Hi. If I understood you correctly here is one approach to your solution: k - 5 mat - diag(1,nrow=k,ncol=k) set.seed(10) samp - mat[sample(1:k,3,rep=FALSE),] samp [,1] [,2] [,3] [,4] [,5] [1,]00100 [2,]01000 [3,]00010 #check

Re: [R] creating R package

2012-02-04 Thread Uwe Ligges
You do not have the path to the R binary set in your operating systems (obviously Windows, although unstated) PATH environment variable. This is explained in so many places, including the R Installation and Administration manual ... Uwe Ligges On 03.02.2012 18:25, ql16717 wrote: Hi, I

Re: [R] combining data structures

2012-02-04 Thread David Stevens
Thanks for the reply. Two things - I must have something missing because copying and pasting your example gave me an error ... your definitions of nn Output = do.call(as.data.frame(rbind),nn) Error in as.data.frame.default(rbind) : cannot coerce class 'function' into a data.frame The

Re: [R] creating R package

2012-02-04 Thread Gabor Grothendieck
On Fri, Feb 3, 2012 at 12:25 PM, ql16717 ql16...@gmail.com wrote: Hi, I never acutally made a package before. I have a folder, say called john that has everything it needs to be in a R package. Some instruction says I need Rtools from R mirror site. I installed the Rtools, but under DOS, the

[R] glm()

2012-02-04 Thread Sherlene Enriquez-Savery
I want to run the glm () function for my data but instead of using the family distributions in R, I need the 4P Burr distribution. Can some please explain how can I go about doing that. Or please provide me with an example. I‘m new to R. Eg. Model1 - glm(Postwt ~ Prewt + Treat +

Re: [R] Fisher Imformation

2012-02-04 Thread Uwe Ligges
On 04.02.2012 15:36, Christopher Kelvin wrote: Hello, i have used the code below to estimate the parameters of weibull distribution and i want to obtain the fisher information by providing the the next code but i receive errors anytime i try to, what do i do? by the way is my replication

Re: [R] newly install old and present R versions

2012-02-04 Thread Uwe Ligges
On 03.02.2012 13:34, Thomas Mang wrote: Hi, Moving to a new computer (Windows 7) but for reasons of reproduceability I would seriously like to also install my present R 2.8.1 along with all extension packages on that machine as well (that is besides R 2.14.1). What's the best way of doing

[R] GGPLOT2: Distance of discrete values of from each end of x-axis

2012-02-04 Thread Thomas Schmitt
Hi Group, I have been working with the code below. Everything seems to work okay, except that the discrete values on the x-axis are far from each end of the graph. I've tried several things including changing the discrete values and playing with the limits, but can't get it to work. I tested this

[R] [R-pkgs] Major update: paramlink version 0.6-1

2012-02-04 Thread Magnus Dehli Vigeland
Dear all, I'd like to introduce the paramlink package, offering parametric linkage analysis in R, as well as other likelihood-based pedigree analyses. While a rudimentary version of the package has existed for a while, it was never properly introduced to this forum. The present version is a

[R] ode() tries to allocate an absurd amount of memory

2012-02-04 Thread Karline Soetaert
Thomas, It is a limitation of the function you are using. The method vode is an implicit method, meaning that it has to create and invert a matrix of the size = number of variables ^2. In your case, this is a full matrix of 33000 rows and columns. If your ODE is easy to solve, you might try to

[R] unlink: parameter force not available in R windows version

2012-02-04 Thread mails
Hello, I use the R command unlink(file, recursive = TRUE, force = TRUE) to delete folders, subfolders and files on Mac OS X. When I was running my script on a Windows computer I realised that for unlink there is no option/parameter force. I do not know why but without that force option R

Re: [R] 'deparse(substitute'))' then 'assign' in a S4 methods

2012-02-04 Thread William Dunlap
Using substitute() and assign(..., envir=parent.frame()) in fooBis will lead you into a lot of trouble. It is nicer to use a 'replacement function', whose name ends with '-', whose last argument is named 'value', and which returns the modified first argument. They are usually paired with

[R] 2011 Journal of Statistical Software

2012-02-04 Thread Jan de Leeuw
The Journal of Statistical Software published eight volumes in 2011, five of them as special volumes. V38: Special Volume: Competing Risks and Multi-State Models V39: Regular Volume V40: Regular Volume V41: Special Volume: Statistical Software for State Space Methods V42: Special Volume:

Re: [R] unlink: parameter force not available in R windows version

2012-02-04 Thread Uwe Ligges
On 04.02.2012 18:13, mails wrote: Hello, I use the R command unlink(file, recursive = TRUE, force = TRUE) to delete folders, subfolders and files on Mac OS X. When I was running my script on a Windows computer I realised that for unlink there is no option/parameter force. I do not know

[R] How to Compare the median to the mean?

2012-02-04 Thread Ajata Paul
Okay, so I have a homework projecr for R, and we had to input the following link as some sort of data: nb10 - read.table(http://www.adjoint-functors.net/su/web/314/R/NB10;). Afterwards, we have to use fivenum(nb10) to find max, min, quantiles, and sd, but I'm okay with this. The next question

Re: [R] How to Compare the median to the mean?

2012-02-04 Thread chuck.01
I found something a little different: median(nb10[,1]) [1] 404 mean(nb10[,1]) [1] 404.59 compare them They are different. Your sample is not perfectly symmetrical (50% above, 50% below) about the mean (ie. the third standardized moment (skewness) is not zero). This is really not a

[R] least squares solution to linear system

2012-02-04 Thread Alaios
Dear all I am having a linear system of the form A*X=B and I want to find the X by using least squares. For example my A is of dimension [205,3] and my B is of dimension[205,1]  I am looking for the X matrix which is of the size [3,1]. In the matlab I was doing that by the function  X =

Re: [R] want to drop levels of table vector join two vector(appending)

2012-02-04 Thread David Winsemius
On Feb 4, 2012, at 9:07 AM, sagarnikam123 wrote: is have vector from table stored in s variable s [1] R P Y A C P V E S C D R R F S R S A D L T R H I R I Levels: A C D E F G H I K L M N P Q R S T V Y If you want to join two factor vectors you need first coerce to character vectors, use

Re: [R] least squares solution to linear system

2012-02-04 Thread Berend Hasselman
On 04-02-2012, at 19:14, Alaios wrote: Dear all I am having a linear system of the form A*X=B and I want to find the X by using least squares. For example my A is of dimension [205,3] and my B is of dimension[205,1] I am looking for the X matrix which is of the size [3,1]. In the matlab

Re: [R] Problem with xtable- rescaling a table

2012-02-04 Thread Aurélien PHILIPPOT
Hi Charles, Thanks for your answer! I am still struggling with two problems with respect to the example I gave in my message. I have 2 approaches, but each of them has its limitations, and there are things I cannot do so far with each of them 1.If I use the following stable command:

Re: [R] sqldf for Very Large Tab Delimited Files

2012-02-04 Thread Steve Lianoglou
Hi, On Fri, Feb 3, 2012 at 1:12 PM, HC hca...@yahoo.co.in wrote: Thank you. The readLines command is working fine and I am able to read 10^6 lines in one go and write them using the write.table command. Does this readLines command using a block concept to optimize or goes line by line?

Re: [R] Problem with xtable- rescaling a table

2012-02-04 Thread Ista Zahn
Hi Aurelien, You just need to put the \caption outside the scalebox command, like this: \documentclass[11pt]{report} \usepackage{rotating} %\usepackage[counterclockwise]{rotating} \usepackage{graphics} \usepackage{float} \pagestyle{empty} \begin{document} \begin{sidewaystable}[ht]

Re: [R] GGPLOT2: Distance of discrete values of from each end of x-axis

2012-02-04 Thread Thomas Schmitt
Sorry group didn't realize this got cross-posted on R-help . . . thought it didn't make it through. Thanks to Justin Haynes for the solution below and wanted to pass it along. With a factor you can add: scale_x_discrete(expand=c(0, 0)) to plot all the way to the edges: df -

Re: [R] Optimisation

2012-02-04 Thread Robbie Morrison
Partha Sinha pnsinh...@gmail.com Wed Feb 1 07:31:08 CET 2012 Can optimisation (simplex etc) be done through R? The GLPK mixed-integer library has R language bindings. I am not sure how up-to-date it is though. Information is available here: http://en.wikibooks.org/wiki/GLPK/R best

Re: [R] unlink: parameter force not available in R windows version

2012-02-04 Thread mails
Hello, I am not exactly sure but I think the version which is installed on that windows computer is 2.13.x So it looks like that the people who developed that function recently updated it. I need to check that on Monday. Thanks for you answer. -- View this message in context:

Re: [R] How to Compare the median to the mean?

2012-02-04 Thread John Kane
This is reallly not a list for homework help. However I'd guess that you are supposed to discuss the mean and median, not assault them with R :) I probably shouldn't do this. :( Plot the data and then discuss the mean median John Kane Kingston ON Canada -Original Message- From:

Re: [R] sqldf for Very Large Tab Delimited Files

2012-02-04 Thread HC
Thank you Jim for your reply. I could figure out that readLines works fine until 35,841,335 lines (records). When the next line is read to be read, a window with R for Windows GUI front-end has stopped working message comes, with an option to close program or checking online for a solution.

[R] problem with windows metafile

2012-02-04 Thread R.newbie
Hi there! I have following problem: I created some graphics with win.metafile, which I wanted to use in a Powerpoint presentation, but when I paste them into Powerpoint the graphics are missing the axes. It looks like the axes are cut off and I was wondering, if somebody know this problem and how

Re: [R] Having trouble controlling plot() output (e.g., color)

2012-02-04 Thread John Kane
I get the same result. I suspect it has something to do with the fact that month is is a factor. You would probably be okay if you converted month to a date format but I don't have time, at the moment, to test it as I always muck up date conversions and take forever to get them right. I did

Re: [R] strftime - Dates from Excel files

2012-02-04 Thread John Kane
I think you are using the wrong function. See ?strftime Try dataset=c(1/2/1978) strptime(dataset,%d/%m/%Y) John Kane Kingston ON Canada -Original Message- From: rrast...@gmail.com Sent: Fri, 3 Feb 2012 14:34:09 +0100 To: r-help@r-project.org Subject: [R] strftime - Dates from

Re: [R] problem with windows metafile

2012-02-04 Thread David Winsemius
On Feb 4, 2012, at 5:18 PM, R.newbie wrote: Hi there! I have following problem: I created some graphics with win.metafile, which I wanted to use in a Powerpoint presentation, but when I paste them into Powerpoint the graphics are missing the axes. It looks like the axes are cut off and

Re: [R] Troubles with stemming (tm + Snowball packages) under MacOS

2012-02-04 Thread Julien Velcin
THANK YOU ! Actually, the key is to disable AWT before loading the R packages. At last, it works with just a few warnings. Julien On Feb 2, 2012, at 4:36 PM, Zhou Zhou wrote: The Sys.setenv(NOAWT=TRUE) code indeed solved my problem which was excatly what Julien described. The key is

Re: [R] combining data structures

2012-02-04 Thread Pete Brecknock
David 1. The last line of the code should have been ... Output = as.data.frame(do.call(rbind,nn)) # Output Node Connect.up Connect.down 11 NULL 2, 3 22 1 4, 5 33 NULL 2, 3 44 1 4, 5 Apologies for any confusion 2.

Re: [R] unlink: parameter force not available in R windows version

2012-02-04 Thread Prof Brian Ripley
On 04/02/2012 18:52, mails wrote: Hello, I am not exactly sure but I think the version which is installed on that windows computer is 2.13.x So it looks like that the people who developed that function recently updated it. Not 'recently': it was a new feature in 2.14.0, released last October

[R] R - Array data loop selection

2012-02-04 Thread dengyu19901102
i want to select June, July and August data from the 3D array (`ssta_sst`, 360*180*362). the loop works but the output of ssta_winter has the identical values for `ssta_winter[,,i]`.seen below. I have set it up as an array of (360,180,29). I think the problem is the variable `temp`, i want to

[R] fractional cointegration

2012-02-04 Thread mamush bukana
Dear folk, I am stempting to estimate a vector error correction model using a seemingly fractionally integrated multivariate time series. The *fracdiff *package provides tools to estimate degree of fractional integration. But *fracdiff *can't help me to: 1. test equality of two degrees of

[R] Lattice: correct use of ltransform3dto3d to plot a surface under a cloud ?

2012-02-04 Thread ilai
Hello list! I am trying to project the fitted surface to a 3d plot of the data, similar to figures 13.7 or 6.5 in Deepayan Sarkar's Lattice, Multivariate Data Visualization with R, but replace the contour/map lines with levelplot. Problem is I can't get the color regions to line up after the