Re: [R] R running as a server on windows?

2009-02-11 Thread Antje
I might have formulated my question a bit misleading. If you are asking about ways to run R as a server on a windows machine, Yes, that's exactly what I was asking for. So, I'll check out this nws package as well as the RServe. Of course, I might ask Knime people as well but my question not

Re: [R] Loop on characters

2009-02-11 Thread Phil Spector
megh - The best way to organize similar objects in R is to put them into a list. If you keep this in mind when you're first organizing your data, it's no harder than giving each object a separate name. For example l = list(l1,l2,l3) The reason that this is a good idea in R is that

[R] How to comment in R

2009-02-11 Thread Mihai.Mirauta
Hi everybody, I use for the moment # at the begining of each line for comments. Is there any possibility to comment more than one line, like something which shows the beggingng and the end of the comment? Or is there a possibility to comment only a part of a line? Thanks, Mihai

[R] how to derive 5 level nested anova results table

2009-02-11 Thread Mao Jianfeng
Hello. I am new to R. And, I want to perform a multiple nested anova on a large datasets (with 9448 observations). Under the helps from R-Sig-ecology mailing list, I have gained many progresses. But I still have some confusions. I want to ask for some helps here. my dataset(SeedL.txt) was not

Re: [R] How to split a character vector into 3 vectors

2009-02-11 Thread Simon Pickett
someone has probably answered this already but use substr() new variable-substr(old.variable,1,1) Simon. - Original Message - From: kayj kjaj...@yahoo.com To: r-help@r-project.org Sent: Tuesday, February 10, 2009 6:50 PM Subject: [R] How to split a character vector into 3 vectors

Re: [R] Generating Numbers With Certain Distribution in R

2009-02-11 Thread Bernardo Rangel Tura
On Wed, 2009-02-11 at 04:07 +, Ben Bolker wrote: Gundala Viswanath gundalav at gmail.com writes: Dear all, Is there a way to generate K numbers of integer (K = 10^6). The maximum value of the integer is 200,000 and minimum is 1. And the occurrences of this integer follows

Re: [R] general inverse solver?

2009-02-11 Thread baptiste auguie
In a different perspective the sage project might also be an option, it seems to interface to Maxima and R among other things. I haven't tested it myself though. http://www.sagemath.org/index.html Best wishes, baptiste PS: sagemath.org is a well-thought website, perhaps a good

Re: [R] How to comment in R

2009-02-11 Thread Søren Højsgaard
You CAN NOT use /* and */ for begin/end comment in R. But if you choose Options - Main - Application in Tinn-R you can specify whether you want a comment to start with # or ## or ### or ... S Fra: mihai.mira...@bafin.de [mailto:mihai.mira...@bafin.de] Sendt:

Re: [R] How to comment in R

2009-02-11 Thread Mihai.Mirauta
Well, I don't care so much if it is */ or something else, I just want to find some way to end my comment. Still, no matter what signs I use (as Thierry suggested) doesn't seem to work. Gruß, Mihai -Ursprüngliche Nachricht- Von: Søren Højsgaard [mailto:soren.hojsga...@agrsci.dk]

Re: [R] How to comment in R

2009-02-11 Thread Stephan Kolassa
Hi Mihai, one (very bad style) way would be if (FALSE) { comment comment comment } But putting a # in front of every line is easier to spot in the code. HTH, Stephan mihai.mira...@bafin.de schrieb: Hi everybody, I use for the moment # at the begining of each line for comments. Is

[R] Problem with GDB: Cannot find new threads

2009-02-11 Thread Thomas Hurtut
Hello I tried to run GDB with R to debug one my program. After running R (R --debugger=gdb) and my program, GDB crashes saying: [Thread debugging using libthread_db enabled] Error while reading shared library symbols: Cannot find new threads: generic error Cannot find new threads: generic error

Re: [R] OT: A test with dependent samples.

2009-02-11 Thread Meyners, Michael, LAUSANNE, AppliedMathematics
Rolf, as you explicitly asked for a comment on your proposal: It is generally equivalent to McNemar's test and maybe even more appropriate because of the asymptotics involved in the chi-squared distribution, which might not be too good with n=12. In some more detail: McNemar's test basically

Re: [R] forestplot

2009-02-11 Thread Thomas Lumley
On Tue, 10 Feb 2009, Marino, Mark wrote: Dear R users, Is there any way to control the size of the box around the mean when creating a Forest plot using the forestplot function? No. If you want to customize further, you are probably better off starting with less general code. The basic

[R] generalized mixed model + mcmcsamp

2009-02-11 Thread Thomas Mang
Hi, I have fitted a generalized linear mixed effects model using lmer (library lme4), and the family = quasibinomial. I have tried to obtain a MCMC sample, but on calling mcmcsamp(model1, 1000) I get the following error which I don't understand at all: Error in .local(object, n, verbose,

Re: [R] How to comment in R

2009-02-11 Thread Mihai.Mirauta
Still doesn't work. I did Format -- Block -- Comment and chose /* for begin comment, */ for end comment but R doesn't recognize the signs as such. Maybe I should work on the configuration of TINN R? Thanks, Mihai -Ursprüngliche Nachricht- Von: ONKELINX, Thierry

[R] How to handle large numbers?

2009-02-11 Thread Feng Li
Dear R, I have two questions: 1, Why both R and Matlab give 0*Inf==NaN? To my knowledge, it should be zero mathematically. Am I right? 2, I need to calculate e.g. exp(a)/(exp(b)+c), where both a and b are very large numbers (1000, e.g a=1000, b=1007, and c=5). R gives me NaN when I use the

[R] gee with auto-regressive correlation structure (AR-M)

2009-02-11 Thread Antonio.Gasparrini
Dear all, I need to fit a gee model with an auto-regressive correlation structure and I faced some problems. I attach a simple example: ### library(gee) library(geepack) # I SIMULATE DATA FROM POISSON DISTRIBUTION, 10 OBS FOR EACH OF 50

[R] OPGELET PHISINGRE: How to comment in R

2009-02-11 Thread ONKELINX, Thierry
You need to configure TINN-R so it knows that # is the comment character. Then using alt+C on a selection of lines, TINN-R will place a # in front of every line. There is no 'begin comment' and 'end comment' character combination in R. HTH, Thierry PS Note that you can uncomment an entire

Re: [R] How to comment in R

2009-02-11 Thread Waclaw . Marcin . Kusnierczyk
Hi Mihai, one (very bad style) way would be if (FALSE) { comment comment comment } this works only if the enclosed text is syntactically valid r code. that is, you can't have multiline free text comments done this way, neither can you temporarily comment out unfinished and

Re: [R] How to comment in R

2009-02-11 Thread Waclaw . Marcin . Kusnierczyk
Hi Mihai, one (very bad style) way would be if (FALSE) { comment comment comment } this works only if the enclosed text is syntactically valid r code. that is, you can't have multiline free text comments done this way, neither can you temporarily comment out unfinished and

Re: [R] How to comment in R

2009-02-11 Thread Gábor Csárdi
There is no begin/end style of comment is R, AFAIK. You can only use '#' for comments. Or the 'if (FALSE) { }' trick. G. On Wed, Feb 11, 2009 at 11:17 AM, mihai.mira...@bafin.de wrote: Well, I don't care so much if it is */ or something else, I just want to find some way to end my comment.

Re: [R] How to comment in R

2009-02-11 Thread bartjoosen
If you don't want to use the # before each comment line, you could try something like defining a function which returns nothing and then type some text after calling the function: comm - function(x) {invisible()} comm(This is just a test, trying to comment without typing the hashes ) But I

[R] Question about apply()

2009-02-11 Thread Sergey Goriatchev
Hello, everyone! Assume you have this data: data - structure(c(66.609375, 67.09375, 66.40625, 66.734375, 67.109375, 66.875, 66.09375, 65.921875, 66.546875, 66.140625, 66.140625, 65.65625, 65.875, 65.59375, 65.515625, 66.09375, 66.015625, 66.140625, 66.109375, 66.421875, 1702.7, 1647.7, 1649.4,

Re: [R] How to comment in R

2009-02-11 Thread Wacek Kusnierczyk
(Ted Harding) wrote: If a comment extends over several lines, each one needs a #. However, as has been suggested, various text editors make it easier to do that. For example, in 'vim': 1: Type in the several lines of comment (without #). Press 'Esc'. 2. With the cursor in the first line,

Re: [R] Generating Correlation matrix

2009-02-11 Thread Sarah Goslee
Assuming you want ordinary correlations - Pearson or Spearman - and not some financial thing I've never heard of, searching the help for correlation would have gotten you to cor(), and probably also to other more elaborate constructions. If your problem is more complex than that, we need a better

Re: [R] Problem about SARMA model forcasting

2009-02-11 Thread saji
Somebody said that ARIMA models like discussed above are easy to implement on a spreadsheet. The prediction formula is simply a linear equation that refers to past values of original time series and past values of the errors. Thus, setting up an spreadsheet by stroing the data in one column, the

Re: [R] How to comment in R

2009-02-11 Thread Barry Rowlingson
2009/2/11 mihai.mira...@bafin.de: Hi everybody, I use for the moment # at the begining of each line for comments. Is there any possibility to comment more than one line, like something which shows the beggingng and the end of the comment? Or is there a possibility to comment only a part

Re: [R] How to comment in R

2009-02-11 Thread Gabor Grothendieck
I think you need to revisit the suggestion of how to use Tinn-R to ensure you are doing it properly. If its R code then if(FALSE) has already been mentioned as an alternative and another possibility is just enclose it in double quotes (or if there are double quotes in the passage then in single

Re: [R] Question about apply()

2009-02-11 Thread Gabor Grothendieck
See ?diff.zoo dif - diff(data, arithmetic = FALSE) - 1 cbind(data, dif) On Wed, Feb 11, 2009 at 6:21 AM, Sergey Goriatchev serg...@gmail.com wrote: Hello, everyone! Assume you have this data: data - structure(c(66.609375, 67.09375, 66.40625, 66.734375, 67.109375, 66.875, 66.09375,

Re: [R] How to handle large numbers?

2009-02-11 Thread Stefan Evert
2, I need to calculate e.g. exp(a)/(exp(b)+c), where both a and b are very large numbers (1000, e.g a=1000, b=1007, and c=5). R gives me NaN when I use the following command: exp(1000)/(exp(1007)+5) [1] NaN I am pretty sure this should be close to zero. No. It should be close to 1. Try

Re: [R] sorting a matrix by the column

2009-02-11 Thread Gabor Grothendieck
This is what I get: temp2 - matrix(rnorm(10),nc=1,nrow=5) rownames(temp2) - c(a,b,c,d,e,f,g,h,i) Error in dimnames(x) - dn : length of 'dimnames' [1] not equal to array extent R.version.string [1] R version 2.8.1 Patched (2008-12-26 r47350) On Wed, Feb 11, 2009 at 1:18 AM,

Re: [R] Question about apply()

2009-02-11 Thread Peter Dalgaard
Sergey Goriatchev wrote: Hello, everyone! Assume you have this data: data - structure(c(66.609375, 67.09375, 66.40625, 66.734375, 67.109375, 66.875, 66.09375, 65.921875, 66.546875, 66.140625, 66.140625, 65.65625, 65.875, 65.59375, 65.515625, 66.09375, 66.015625, 66.140625, 66.109375,

[R] Filter a big matrix

2009-02-11 Thread cruz
Hi, I have a big matrix X with M rows and N columns that I want to filter it into smaller ones with m (M) rows and N columns. The filter rule is based on the values of each columns, i.e. X looks like this: column name: a, b, c, d, ... etc a b c d ... 1 2 3 4 ... 5 6 7 8

Re: [R] Generating Correlation matrix

2009-02-11 Thread Maithili Shiva
Dear Ms Sarah, Thanks for your reply. Actually I am new to this R language and besides coping with the demending office commitments, whenever possible, I am trying to learn the R language on my own. Had it been Excel, I could have done in fraction of seconds however I need to use R language

[R] Beginner question about an Error message when loading SWinTypeLibs package

2009-02-11 Thread eugen pircalabelu
Hi List, I am trying to learn something about the exchange facilities between R and Windows Application with the RDCOMClient package from (http://www.omegahat.org/RDCOMClient/) and I have faced 2 problems: 1. I could not follow the link for the binary version of SWinTypeLibs package on the

Re: [R] Question about apply()

2009-02-11 Thread Sergey Goriatchev
Dear Gabor, Thank you as always. I will follow your suggestion. But, I still want to know what I do wrong in the above code (with embed(), apply(), and merge() functions). Why do I get that error message and how can I rewrite the code to make it run. Best Regards, Sergey On Wed, Feb 11, 2009 at

Re: [R] Question about apply()

2009-02-11 Thread Sergey Goriatchev
Dear Peter, I tried with the comma already, it did not work. rets TY1.lev SP1.lev GC1.lev CL1.lev 2000-01-03 66.60938 1702.7 453.7 18.34 2000-01-04 67.09375 1647.7 447.8 18.29 2000-01-05 66.40625 1649.4 446.2 17.65 2000-01-06 66.73438 1639.9 446.5 17.52 2000-01-07

Re: [R] sorting a matrix by the column

2009-02-11 Thread jim holtman
Use 'drop=FALSE' temp2 - matrix(rnorm(10),nc=1) rownames(temp2) - c(a,b,c,d,e,f,g,h,i,'j') print(temp2) [,1] a -0.5686687 b -0.1351786 c 1.1780870 d -1.5235668 e 0.5939462 f 0.3329504 g 1.0630998 h -0.3041839 i 0.3700188 j 0.2670988 temp2 - temp2[order(temp2[,1]),,drop=FALSE]

Re: [R] Label bars in a faceted bar plot in ggplot2

2009-02-11 Thread Harsh
Worked like a charm. Thanks a ton Thierry. Harsh Singhal Decision Systems Mu Sigma Inc. Chicago, IL On Wed, Feb 11, 2009 at 6:33 PM, ONKELINX, Thierry thierry.onkel...@inbo.be wrote: Dear Harsh, Have a look at geom_text() ggplot(df, aes(x = Models, y = Values)) + geom_bar() +

Re: [R] How to comment in R

2009-02-11 Thread baptiste auguie
A somewhat twisted approach that has not been mentioned is to consider everything a comment unless it is enclosed in special tags, as done in the brew package, for example, brew(textConnection( You won't see this R output, but it will run. % foo - 'bar' % Now foo is %=foo% and today is

Re: [R] Generating Numbers With Certain Distribution in R

2009-02-11 Thread Ben Bolker
Bernardo Rangel Tura wrote: I think your routine need a little fix x - rlnorm(1e6,meanlog=1,sdlog=1) ## pick any parameters you like y - round((x-min(x)/diff(range(x)))*19+1) What you think? Yes. __ R-help@r-project.org mailing list

Re: [R] generalized mixed model + mcmcsamp

2009-02-11 Thread Ben Bolker
Thomas Mang Thomas.Mang at fiwi.at writes: Hi, I have fitted a generalized linear mixed effects model using lmer (library lme4), and the family = quasibinomial. I have tried to obtain a MCMC sample, but on calling mcmcsamp(model1, 1000) I get the following error which I don't

Re: [R] How to handle large numbers?

2009-02-11 Thread Feng Li
Hi Robin, This works! Also your introduction to using S4 methods is very good! Thanks! Feng On Wed, Feb 11, 2009 at 12:20 PM, Robin Hankin rk...@cam.ac.uk wrote: Feng checkout the Brobdingnag package: library(Brobdingnag) exp(1000)/(exp(1007)+5) [1] NaN

Re: [R] Generating Numbers With Certain Distribution in R

2009-02-11 Thread Gustaf Rydevik
On Wed, Feb 11, 2009 at 2:15 PM, Ben Bolker bol...@ufl.edu wrote: Bernardo Rangel Tura wrote: I think your routine need a little fix x - rlnorm(1e6,meanlog=1,sdlog=1) ## pick any parameters you like y - round((x-min(x)/diff(range(x)))*19+1) What you think? Yes. No. Bernardo

Re: [R] How to handle large numbers?

2009-02-11 Thread Feng Li
Thanks for your explanation. Now I am quite clear about that. On Wed, Feb 11, 2009 at 12:05 PM, Thomas Lumley tlum...@u.washington.eduwrote: On Wed, 11 Feb 2009, Feng Li wrote: 1, Why both R and Matlab give 0*Inf==NaN? To my knowledge, it should be zero mathematically. Am I right? No.

Re: [R] Question about apply()

2009-02-11 Thread Peter Dalgaard
Sergey Goriatchev wrote: Dear Peter, I tried with the comma already, it did not work. Ah, yes, sorry. The real issue is that you are trying to index twice, both by apply(.,2,.) and by z=TY1.lev (the former loops over columns and the latter selects one of them). So what func() sees is an

Re: [R] Question about apply()

2009-02-11 Thread Gabor Grothendieck
There is no zoo method for embed. embed is implicit in rollapplly so its not normally needed in zoo and rollapply, lag or diff would normally be used instead. If you did want to use embed then unzoo data first but that will lose the time index so add it back in later: e -

Re: [R] Filter a big matrix

2009-02-11 Thread jim holtman
Try something like this. This setups the condition and then uses 'xor' to flip it to = assuming that you are using the same values # test data n - 5 # number of columns m - 100 # number of rows x - matrix(sample(1:10, n * m, TRUE), ncol=n, nrow=m) # create tests assuming you want to know if

Re: [R] Filter a big matrix

2009-02-11 Thread Douglas Bates
On Wed, Feb 11, 2009 at 6:32 AM, cruz crua...@gmail.com wrote: Hi, I have a big matrix X with M rows and N columns that I want to filter it into smaller ones with m (M) rows and N columns. The filter rule is based on the values of each columns, i.e. X looks like this: column name: a, b, c,

Re: [R] How to comment in R

2009-02-11 Thread Gustaf Rydevik
On Wed, Feb 11, 2009 at 2:15 PM, baptiste auguie ba...@exeter.ac.uk wrote: A somewhat twisted approach that has not been mentioned is to consider everything a comment unless it is enclosed in special tags, as done in the brew package, for example, brew(textConnection( You won't see this

Re: [R] Question about apply()

2009-02-11 Thread Sergey Goriatchev
Understood. Peter, Gabor, thank you for your time and help. Regards, Sergey On Wed, Feb 11, 2009 at 14:24, Gabor Grothendieck ggrothendi...@gmail.com wrote: There is no zoo method for embed. embed is implicit in rollapplly so its not normally needed in zoo and rollapply, lag or diff would

[R] Problem with R using pgi compiler on x86_64

2009-02-11 Thread Dr.Peer-Joachim Koch
Hi, we have installed R-2.8.1 using the current pgi compiler (8.0.2) for AMD64 on a SLES9 system. When I try to install Matrix everything is fine until the last step. make[1]: Leaving directory `/tmp/R.INSTALL.TW3399/Matrix/src/AMD' pgCC -L/usr/lib64 -L/usr/X11R6/lib64 -pgf90libs -o

[R] How to handle large numbers?

2009-02-11 Thread david.jessop
Hi In answer to your first question is that it can be anything. If we look at 0 * a = 0 and let a tend to infinity, and b * Inf = Inf and let b tend to zero then you can get both zero and infinity as an answer. If you say consider c * 1/c = 1 and let c tend to infinity then it can be one too

Re: [R] Generating Numbers With Certain Distribution in R

2009-02-11 Thread Ben Bolker
Gustaf Rydevik wrote: On Wed, Feb 11, 2009 at 2:15 PM, Ben Bolker bol...@ufl.edu wrote: Bernardo Rangel Tura wrote: I think your routine need a little fix x - rlnorm(1e6,meanlog=1,sdlog=1) ## pick any parameters you like y - round((x-min(x)/diff(range(x)))*19+1) What you think? Yes.

Re: [R] How to handle large numbers?

2009-02-11 Thread Gabor Grothendieck
Try Ryacas. N means numerically evaluate in yacas (as we don't want it evaluated on the R side where we already know we get NaN). library(Ryacas) Eval(yacas(N(Exp(1000)/(Exp(1007)+5))) [1] 0.000911882 You can explore it somewhat in R via: curve(exp(x)/(exp(x+7)+5), 1, 500) On Wed, Feb 11,

[R] Beginner-how to down size a large sample

2009-02-11 Thread pramil cheriyath
I have this large data set with an outcome variable 0 and 1, I want to randomly pick 100 from each group and create another data set. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] How to comment in R

2009-02-11 Thread baptiste auguie
On 11 Feb 2009, at 13:41, Gustaf Rydevik wrote: On Wed, Feb 11, 2009 at 2:15 PM, baptiste auguie ba...@exeter.ac.uk wrote: A somewhat twisted approach that has not been mentioned is to consider everything a comment unless it is enclosed in special tags, as done in the brew package, for

[R] problem with 'which' and strings

2009-02-11 Thread Chrischizinski
I have written a function that goes through a database and calculates various metric scores and allocates them to a data set. For 400 of the 500 sites that I calculate these metrics for works fine and allocates the scores into the appropriate column. For some reason, some sites I run into the

Re: [R] Problem with R using pgi compiler on x86_64

2009-02-11 Thread Brian D Ripley
I don't see anything in there that asks for a shared library to be built. Please check R_HOME/etc/Makeconf: I believe you need SHLIB_CXXLDFLAGS = -shared (and I checked, and I do see that in the PGI section of the R-admin manual: so plese check your other settings too). (BTW, googling shows

Re: [R] Beginner-how to down size a large sample

2009-02-11 Thread Gustaf Rydevik
On Wed, Feb 11, 2009 at 3:15 PM, pramil cheriyath drpra...@gmail.com wrote: I have this large data set with an outcome variable 0 and 1, I want to randomly pick 100 from each group and create another data set. __ R-help@r-project.org mailing list

[R] Error in storage when attempting to run GLM

2009-02-11 Thread R User R User
Hello, I'd be very grateful for help with the following. I attempt to run a basic GLM as follows: basic_model=glm(factor(A$b) ~ factor(A$c) ) variables b and c are text values and their class is factor. they have no missing values. I get the error: Error: NA/NaN/Inf in foreign function call

Re: [R] problem with 'which' and strings

2009-02-11 Thread David Winsemius
Looks like you might be using vector addressing on a non-existent object. You have identified a column number, 14, to use. If you wanted to put the XXX.table$Metric.name vector into a column of orig.metric.scores (and it already existed with 10 rows), then you would would use matrix

Re: [R] Error in storage when attempting to run GLM

2009-02-11 Thread Uwe Ligges
R User R User wrote: Hello, I'd be very grateful for help with the following. I attempt to run a basic GLM as follows: basic_model=glm(factor(A$b) ~ factor(A$c) ) variables b and c are text values and their class is factor. they have no missing values. I get the error: Error: NA/NaN/Inf

Re: [R] Generating Correlation matrix

2009-02-11 Thread David Winsemius
We still have nothing at all specific about what these files even look like. Perhaps the problem is that you have not even read basic introductory material an don't yet know how to import files? If so, then look at: ?read.table#which also has material on read.csv Perhaps:

Re: [R] height of y-axis (in inches or cm)

2009-02-11 Thread Uwe Ligges
Jörg Groß wrote: Hi, Is there a way to define the height of an y-axis not only by defining the tick-marks but by defining a height in inches or cm? So that the absolute axis height is the same over different plots... Although this is not possible for base graphics (it is for grid

Re: [R] Problem with R using pgi compiler on x86_64

2009-02-11 Thread Dr.Peer-Joachim Koch
Hi, thanks. I didn't saw the answer from pgi. But when I change the settings in R_HOME/etc/Makeconf the system is still using the old settings. How can I force R to use the new settings and check it ? Bye, Peer Brian D Ripley wrote: I don't see anything in there that asks for a shared

Re: [R] problem with 'which' and strings

2009-02-11 Thread Chrischizinski
That would allocate, the vector down the column, correct? I should have specified this clearer. I want to put each metric value into the appropriate column (as designated by the metric name ) in a single row. My data set SCORES.combined has the column headings for all potential metrics that

Re: [R] installing R on Ubuntu

2009-02-11 Thread Vincent Goulet
Thanks, Paul, for the instructions. However, as it has been pointed out by Dirk a couple of times, most of these instructions (those related to R installation and the location of package files at least) can already be found in the Ubuntu README:

[R] Hollander's test of bivariate symmetry

2009-02-11 Thread joseph . g . boyer
Does anyone know if any R package has a function that will conduct Hollander's test of bivariate symmetry? (Hollander, Biometrika, 1971) Either the exact test or an asymptotic version would be sufficient for my purposes. Thanks. Joe Boyer Statistical Sciences Renaissance Bldg 510,

[R] How to count number of year per firm in panel data?

2009-02-11 Thread Johannes Habel
Hello, I have an unbalanced panel dataset and would like to exclude all objects that don't appear at least x times. Therefore, I would like to include a column indicating for every line how many periods are available, e.g. id, year, number 1, 2000, 3 1, 2001, 3 1, 2002, 3 2, 2001, 1 3, ...,

[R] Reading Binary Files

2009-02-11 Thread Steve_Friedman
Hello I'm encountering some difficulty correctly reading binary files. The binary files store data as short rather than double , int, or any of the other modes of the vector being read. The data represents a regular grid of size 419 rows by 264 columns, to make it more interesting, the data

Re: [R] problem with 'which' and strings

2009-02-11 Thread jim holtman
You probably want to use either '%in%' or 'match'. The result of 14 that you are getting is due to recycling of the shorter vector and matching at the 14th position (Insect-Tolerant). On Wed, Feb 11, 2009 at 9:20 AM, Chrischizinski chris.chizin...@gmail.com wrote: I have written a function

[R] Variables captured in closures get copied?

2009-02-11 Thread Titus von der Malsburg
Hi list! I have a data frame called fix and a list of index vectors called rois: head(rois, 3) [[1]] [1] 2 1 [[2]] [1] 3 [[3]] [1] 6 7 28 26 27 24 25 The part that's causing the issue is the following line: lapply(rois, function(roi) fix$x[roi] - 100) So for every index

[R] changing settings on a barchart (lattice)

2009-02-11 Thread Dimitri Liakhovitski
Hello! I apologize - I never used lattice before, so my question is probably very basic - but I just can't find the answer in the archive nor in the documentation: I have a named numeric vector p of 6 numbers (of the type 6 numbers with people's names to whom those numbers belong). I want a

Re: [R] Looping over a matrix passed to .C

2009-02-11 Thread jim holtman
Why don't you generate all the possible combinations using 'combn' and then use that matrix to address your data: m - matrix(1:25,5) indx - combn(5, 3) indx [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,]111111222 3 [2,]2223

Re: [R] problem with 'which' and strings

2009-02-11 Thread Chrischizinski
All it took was using 'match' instead of 'which'. Thanks for all your help! -- View this message in context: http://www.nabble.com/problem-with-%27which%27-and-strings-tp21955970p21958266.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Variables captured in closures get copied?

2009-02-11 Thread Peter Dalgaard
Titus von der Malsburg wrote: Hi list! I have a data frame called fix and a list of index vectors called rois: head(rois, 3) [[1]] [1] 2 1 [[2]] [1] 3 [[3]] [1] 6 7 28 26 27 24 25 The part that's causing the issue is the following line: lapply(rois, function(roi)

Re: [R] Reading Binary Files

2009-02-11 Thread Henrik Bengtsson
Argument 'size' is what you are looking for, cf. help(readBin). Whenever reading binary files this way, I strongly recommend that you are explicit about all arguments of readBin(), e.g. readBin(con, what=integer(), size=2, signed=TRUE, endian=little, n=n); For instance, you probably do not want

Re: [R] How to comment in R

2009-02-11 Thread Greg Snow
If it is fairly trivial to implement then go ahead and implement it, patches are always welcome. But make sure that it does all that is intended and does it properly, I don't think this is as trivial as it first appears. The =pod and =cut of Perl is simple (but was not originally intended as

Re: [R] How to count number of year per firm in panel data?

2009-02-11 Thread Marc Schwartz
on 02/11/2009 10:43 AM Johannes Habel wrote: Hello, I have an unbalanced panel dataset and would like to exclude all objects that don't appear at least x times. Therefore, I would like to include a column indicating for every line how many periods are available, e.g. id, year, number

Re: [R] changing settings on a barchart (lattice)

2009-02-11 Thread Dieter Menne
Dimitri Liakhovitski ld7631 at gmail.com writes: I apologize - I never used lattice before, so my question is probably very basic - but I just can't find the answer in the archive nor in the documentation: I have a named numeric vector p of 6 numbers (of the type 6 numbers with people's

Re: [R] How to count number of year per firm in panel data?

2009-02-11 Thread Gabor Grothendieck
ave is also handy here: DF$number - ave(DF$year, DF$id, FUN = length) On Wed, Feb 11, 2009 at 12:38 PM, Marc Schwartz marc_schwa...@comcast.net wrote: on 02/11/2009 10:43 AM Johannes Habel wrote: Hello, I have an unbalanced panel dataset and would like to exclude all objects that don't

Re: [R] summary statistics

2009-02-11 Thread phoebe kong
Thanks a bunch! They all are helpful :) On 2/10/09, Jim Lemon j...@bitwrit.com.au wrote: William Revelle wrote: At 6:41 PM -0500 2/9/09, David Winsemius wrote: describe() in Hmisc provides much of the rest of what you asked for: describe(pref900$TCHDL) pref900$TCHDL n missing

[R] bar plot/ histogram

2009-02-11 Thread phoebe kong
Hi all, I would like to construct plot of the distribution of N, where N range from 1 to 10. I couldn't just use the hist(), as I want the categories for the bars are: 1, 2, 3, 4, =5. So this will be a bar plot with 5 bars, and the height of the bar will be the frequency of N. (eg bar#1 will be

Re: [R] How to comment in R

2009-02-11 Thread Stavros Macrakis
On Wed, Feb 11, 2009 at 12:32 PM, Greg Snow greg.s...@imail.org wrote: ...The c-style of /* */ allows both types and you can comment out part of a line, but it is not simple to match and has its own restrictions. Friedl in his regular expressions book takes 10 pages to develop a pattern to

Re: [R] bar plot/ histogram

2009-02-11 Thread Marc Schwartz
on 02/11/2009 12:10 PM phoebe kong wrote: Hi all, I would like to construct plot of the distribution of N, where N range from 1 to 10. I couldn't just use the hist(), as I want the categories for the bars are: 1, 2, 3, 4, =5. So this will be a bar plot with 5 bars, and the height of the bar

Re: [R] How to handle large numbers?

2009-02-11 Thread Stavros Macrakis
On Wed, Feb 11, 2009 at 6:20 AM, Robin Hankin rk...@cam.ac.uk wrote: library(Brobdingnag) exp(1000)/(exp(1007)+5) [1] NaN as.numeric(exp(as.brob(1000))/(exp(as.brob(1007))+5)) [1] 0.000911882 Though brob is certainly useful in many cases, it can't substitute for thinking about numeric

[R] How to apply table() on subdata and stack outputs

2009-02-11 Thread Sean Zhang
Dear R helpers: I am a R novice and have a question about using table() to extract frequences over many sub-datasets. A small example input dataframe and wanted output dataframe are provided below. The real data is very large so a for loop is what I try to avoid. Can someone englithen me how to

Re: [R] How to comment in R

2009-02-11 Thread Duncan Murdoch
On 2/11/2009 1:21 PM, Stavros Macrakis wrote: On Wed, Feb 11, 2009 at 12:32 PM, Greg Snow greg.s...@imail.org wrote: ...The c-style of /* */ allows both types and you can comment out part of a line, but it is not simple to match and has its own restrictions. Friedl in his regular expressions

Re: [R] OT: A test with dependent samples.

2009-02-11 Thread Rolf Turner
Thank you ***VERY*** much. That clarifies a lot of things which were vaguely knocking around in my mind but about which I could not get my thoughts properly organized. Thanks again. cheers, Rolf Turner On 11/02/2009, at 11:27 PM,

Re: [R] forestplot

2009-02-11 Thread Marino, Mark
Thanks, I was able to get what I wanted done by modifying the code, but I will consider writing my own based upon your suggestion. Mark Mark T. Marino, MD VP, Early Clinical Development Mannkind Corp. 61 S. Paramus Road Paramus, NJ 07652 201-983-5238 Office 203-512-4008 Cell

Re: [R] How to comment in R

2009-02-11 Thread Greg Snow
Stavros, Thanks for the clarification and going further back in the credit for /* */. I don't think that the regex argument is a complete red herring (possibly a pink herring or burnt umber herring?). The post I was responding to said that implementing it would be trivial, I think that the

Re: [R] Problem about SARMA model forcasting

2009-02-11 Thread Saji Ren
Somebody said that ARIMA models like discussed above are easy to implement on a spreadsheet. The prediction formula is simply a linear equation that refers to past values of original time series and past values of the errors. Thus, setting up an spreadsheet by stroing the data in one column, the

[R] extract trend data from stl

2009-02-11 Thread doloop
I am using the stl function to decompose a time series. I want to access the trend data hopefully by placing it into a separate vector. How do I do that? Thanks. -- View this message in context: http://www.nabble.com/extract-trend-data-from-stl-tp21954844p21954844.html Sent from the R help

Re: [R] Variables captured in closures get copied?

2009-02-11 Thread Wacek Kusnierczyk
Peter Dalgaard wrote: Titus von der Malsburg wrote: Hi list! I have a data frame called fix and a list of index vectors called rois: head(rois, 3) [[1]] [1] 2 1 [[2]] [1] 3 [[3]] [1] 6 7 28 26 27 24 25 The part that's causing the issue is the following line:

Re: [R] plots and text to the same output file

2009-02-11 Thread Greg Snow
odfWeave works just fine for me on windows and the XML package shows up in my list of packages. You may be overthinking the problem, for most of my odfWeave projects I don't need odfInsertPlot, just use fig=TRUE in the code chunk and only include the code for that 1 plot in that code chunk (a

Re: [R] Strange behaviour of ISOdatetime

2009-02-11 Thread pbarros
Sorry for missing this part of the posting guide. It was indeed a problem with the locales. I have fixed it now. Pedro David Winsemius wrote: My guess is that your two machines have different setting for locale. What does this produce on each of them: sessionInfo()$locale (Note: It

[R] Eror message: not a valid package -- installed 2.0.0

2009-02-11 Thread Powers, Randall - BLS
Hello R-help, We are running R version 2.6.0 (2007-10-03). I believe that I got it from www.sunfreeware.com. A number of the packages that we attempt to download from http://www.r-project.org/ give us the error message below when we attempt to run them. Can anyone tell me what I

Re: [R] How to apply table() on subdata and stack outputs

2009-02-11 Thread Uwe Ligges
Sean Zhang wrote: Dear R helpers: I am a R novice and have a question about using table() to extract frequences over many sub-datasets. A small example input dataframe and wanted output dataframe are provided below. The real data is very large so a for loop is what I try to avoid. Can

Re: [R] extract trend data from stl

2009-02-11 Thread Roy Mendelssohn
?stl -Roy On Feb 11, 2009, at 5:39 AM, doloop wrote: I am using the stl function to decompose a time series. I want to access the trend data hopefully by placing it into a separate vector. How do I do that? Thanks. -- View this message in context:

  1   2   >