On Fri, 1 Aug 2008, Gundala Viswanath wrote:
How can I remove the even number from the following vector
x
[1] 4 5 6 8 17 20 21 22 23 25 26 31 35 36 38 40 41 42
43
[20] 44 50 74 75 82 84 89 90 91 95 96 97 100 101 102 118 119 121
122
[39] 123 135 136
Hi,
I have this string, in which I want to extract some of it's element:
x - Best-K Gene 11340 211952_at RANBP5 Noc= 3 - 2 LL= -963.669 -965.35
yielding this array
[1] 211952_at RANBP5 2
In Perl we would do it this way:
__BEGIN__
my @needed =();
my $str = Best-K Gene 11340 211952_at
On Thu, 31 Jul 2008, calundergrad wrote:
i have a vector with values similar to the below text
[1] 001-010-001-0
I want to get rid of all leading zeroes.
for example i want to change the values of the vector
so that [1] 001-010-001-0 becomes [1] 1-010-001-0.
Another example
x[!(x %% 2 == 0)]
On Thu, Jul 31, 2008 at 10:01 PM, Gundala Viswanath [EMAIL PROTECTED]wrote:
Dear all,
How can I remove the even number from the following vector
x
[1] 4 5 6 8 17 20 21 22 23 25 26 31 35 36 38 40 41 42
43
[20] 44 50 74 75 82 84 89 90 91
How about:
unlist(strsplit(x, split= ))[c(4:5,10)]
That perl script looks like a good reason to avoid perl.
Simon.
On Fri, 2008-08-01 at 15:13 +0900, Edward Wijaya wrote:
Hi,
I have this string, in which I want to extract some of it's element:
x - Best-K Gene 11340 211952_at RANBP5
Hi all,
I've been doing some investigation to see if it is possible to implement an
hclust/dendrogram related requirement that I've been given. So far ?hclust and
a lot of googling haven't provided the information I'm looking for (I've been
using R sporadically for a year).
The requirement I
Dear Alessandro,
For the vgm-helpfile:
Anisotropy parameters define which direction this is (the main axis), and how
much shorter the range is in (the) direction(s) perpendicular to this main
axis.
Notice that the directions should be perpendicular. 90° and 45° are not
perpendicular.
Please
Hi all,
Is there a way to do it?
For example:
x
foo bar bar2 qux
is there a function to return TRUE/FALSE
given a test variable
func(foo)
TRUE
func(GUNDALA)
FALSE
Is there such func in R?
- Gundala Viswanath
Jakarta - Indonesia
__
Hello R users,
I run this code under windows XP and R 2.7.1 :
head(esoph)
agegp alcgptobgp ncases ncontrols
1 25-34 0-39g/day 0-9g/day 040
2 25-34 0-39g/day10-19 010
3 25-34 0-39g/day20-29 0 6
4 25-34 0-39g/day 30+ 0 5
5
Look at %in% or match
foo %in% x
HTH,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
check ?%in%, e.g.,
x - c(foo, bar, bar2, qux)
foo %in% x
GUNDALA %in% x
I hope it helps.
Best,
Dimitris
---
Dimitris Rizopoulos
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
On 8/1/2008 4:49 AM, David Hajage wrote:
Hello R users,
I run this code under windows XP and R 2.7.1 :
head(esoph)
agegp alcgptobgp ncases ncontrols
1 25-34 0-39g/day 0-9g/day 040
2 25-34 0-39g/day10-19 010
3 25-34 0-39g/day20-29 0 6
4
Dear all,
I have been trying to investigate the behaviour of different weights in
weighted regression for a dataset with lots of missing data. As a start
I simulated some data using the following:
library(MASS)
N - 200
sigma - matrix(c(1, .5, .5, 1), nrow = 2)
sim.set -
Please do read ?apply (see the posting guide)
If 'X' is not an array but has a dimension attribute, 'apply'
attempts to coerce it to an array via 'as.matrix' if it is
two-dimensional (e.g., data frames) or via 'as.array'.
and note
sapply(esoph, class)
$agegp
[1] ordered factor
Hi Jim,
Thanks for your advice. The problem is that I can't lose any of the data - it's
a global dataset, where the left-most column = 180 degrees west, and the
right-most is 180 degrees east. The top row is the North Pole and the bottom
row is the South Pole.
I've got 512MB RAM on the
If you can reduce the size of your data by averaging, then you could
read in a subset of the rows, average the 6x6 matrices and then write
them out for a second phase of processing. The 2160x4230 object would
take up 75MB if numeric, which is probably 50% of your available
memory if you are
library(mvtnorm)
x = seq(-4,4,length=201)
xy= expand.grid(x,x)
sigma = (diag(c(1,1))+1)/2
d2= matrix(dmvnorm(xy,sigma=sigma),201)
xsamp = rmvnorm(200,sigma=sigma)
contour(x,x,d2)
points(xsamp,col=3,pch=16)
pdf(pdftry.pdf)
contour(x,x,d2)
points(xsamp,col=3,pch=16)
dev.off()
Dear all,
In R 2.7.1 on Windows it looks to me that the generic plot function for GLM
objects uses standardized working residuals and not as labeled in the graph
the standardized deviance residuals. It looks to me that from 2.7.0 to 2.7.1
there has been a bug introduced.
Has anybody
Ok thanks Jim - I'll give it a go! I'm new to R, so I'm not sure how I'd go
about performing averages in subsets... I'll have a look into it, but any
subsequent pointers would be gratefully received as ever!
I'll also try playing with it in Access, and maybe even Excel 2007 might be
able to
What viewers are you using?
Works for me (using ghostscript 4.61 and acroread 8.1.2) -- I even tried
2.7.1 (as well as R-patched).
On Fri, 1 Aug 2008, Patrizio Frederic wrote:
library(mvtnorm)
x = seq(-4,4,length=201)
xy= expand.grid(x,x)
sigma = (diag(c(1,1))+1)/2
d2=
dear Ripley and Diffort,
thank you for the quick reply.
I figured out it was my mistake: I wrote this to the list:
contour(x,x,d2)
in fact my framework I used
contour(x,x,d2,labex=0) # that produced the error
then I learned by myself that if I want to suppress labels I have to use
Hi everybody,
I am reading the Lomb paper (Lomb, 1976) and I found an interesting
equation, and I wish to resolve it using R. I am wondering if anybody has a
hint. The equation is:
Yis[i] = a*cos((2*pi/T)*(Times[i] - Tau)) + b*sin((2*pi/T)*(Times[i] -
Tau)) ... (1)
Where T and Tau are
JGR's Copy Commands command works well for me (even if it is both
fascinating and embarrassing how little is sometimes left over). It
retains only commands that worked, so it is still not the minimum
possible.
Antony Unwin
Professor of Computer-Oriented Statistics and Data Analysis,
In the example below, a straight application of strsplit() is probably the
simplest solution. In a more general case where it may be desirable to match
patterns, a combination of sub() or gsub() with strsplit() might do the trick:
x - Best-K Gene 11340 211952_at RANBP5 Noc= 3 - 2 LL= -963.669
in line
MAIDER MATEOS DEL PINO wrote:
Hi all,
I´m using the arima() function to study a time series but it gives me
the following error:
Error en optim(init[mask], armafn, method = BFGS, hessian = TRUE,
control = optim.control, :
non-finite finite-difference value [3]
I know that I
On Fri, Aug 1, 2008 at 7:31 AM, Stephen Tucker [EMAIL PROTECTED] wrote:
In the example below, a straight application of strsplit() is probably the
simplest solution. In a more general case where it may be desirable to match
patterns, a combination of sub() or gsub() with strsplit() might do
Dear R users,
I have a newbie-question that I couldn't resolve after reading through
several pieces of documentation and searching the archive.
I have a data.frame containing experimental data from a group experiment
in psychology. Each line represents a single participant, but
participants
something like that should work :
aggregate(test, list(test[,1]), mean)
2008/8/1 Bertolt Meyer [EMAIL PROTECTED]
Dear R users,
I have a newbie-question that I couldn't resolve after reading through
several pieces of documentation and searching the archive.
I have a data.frame containing
Hi Bertolt,
by(test,INDICES=test$groupID,FUN=mean)
And today's a holiday in Switzerland, so stop working already ;-)
HTH
Stephan
Bertolt Meyer schrieb:
Dear R users,
I have a newbie-question that I couldn't resolve after reading through
several pieces of documentation and searching the
one option is aggregate(), e.g.,
test - as.data.frame(cbind(c(rep(1,5),rep(2,5)), rnorm(10), rnorm(10)))
names(test)[1] - groupID
aggregate(test[c(V2, V3)], list(test$groupID), mean)
I hope it helps.
Best,
Dimitris
--
Dimitris Rizopoulos
Biostatistical Centre
School of Public Health
Catholic
Hello,
When I plot y=f(x) from the file xy.txt (
http://www.nabble.com/file/p18773387/xy.txt xy.txt ), I can clearly see a
trend.
Is there a function or a package able to take the median value of y for an
interval of x (x +/- a defined value) to plot nice graph (at least a better
one) ?
Another option is ?by
test - as.data.frame(cbind(c(rep(1,5),rep(2,5)), rnorm(10), rnorm(10)))
names(test)[1] - groupID
test$groupID - factor(test$groupID)
by(test[, -1], test$groupID, mean)
HTH,
Thierry
ir. Thierry
VK == Vadim Kutsyy [EMAIL PROTECTED]
on Thu, 31 Jul 2008 15:43:56 -0700 writes:
I am getting an error allocMatrix: too many elements
specified when I am trying to create large matrix or
vector (about 1 billion elements).
How can I find out limits on allocMatrix?
Hi list, I have some questions regarding
1) conversion of date + time characters to chron
2) formatting chron object printing
Regarding (1), Gabor's Rnews 2004 4/1 article has been indispensible,
but I often work with files where dates and times are contained in a
single field. In this case, I
Treat it as an over-determined linear system, that is:
A - cbind(cos((2*pi/T)*(Times - Tau)), sin((2*pi/T)*(Times - Tau)))
qr.solve(A, Yis)
because 'solve' will only handle square matrices.
Hans W. Borchers
Josué Polanco wrote:
Hi everybody,
I am reading the Lomb paper
Hello and thank you for your reply.
My dummy example was a bit too simple... I'm having difficulty correctly
specifying the 'at' component since my real situation concerns a multipanel
display with ' relation=free '.
To illustrate :
dates-as.Date(32768:32895,origin=1900-01-01)
Hi Jeff,
You are absolutely right. In all the mess, I forgot that my Rserve was
started by a different user! Sometimes it's the simplest solution, isn't
it? Thanks a lot.
-Prasad
-Original Message-
From: Jeffrey Horner [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 31, 2008 5:14 PM
To:
Interestingly, if I fitted the model using glm() rather than lm(),
drop1() would behave as expected:
summary(model.glm - glm(y ~ ., data = sim.set, family = 'gaussian'))
summary(model.lm - lm(y ~ ., data = sim.set))
drop1(model.glm, test = 'F')
drop1(model.lm, test = 'F')
model.glm -
Yep you are totally right. I looked at the graphs to do the analysis
quickly, and sacrificed correctness.
z - rnorm(5000)
z.ts - ts(z)
f - fft(z.ts)
d - fft(f, inverse=T)
plot(z.ts, d/5000)
#this is how far off the algorithm was from recreating the series.
After it is divided by the signal
Dear collegues,
I have used R statistical program, package 'lmer', several times
already.
I never encountered major differences in the outcome between SPSS and R.
...untill my last analyses.
Would some know were the huge differences come from.
Thanks in advance, Ronald
In SPSS the Pearson
Hi,
I was just woundering if there is in R a stable package for:
- Diffusion maps [1]
- Isomaps [2]
1:
http://www.cs.tau.ac.il/~shekler/Seminar2007a/DM%20GH%20and%20App/dm_elsevier.pdf
2: http://isomap.stanford.edu/
Thanks
Peter
--
Martin Maechler wrote:
VK The problem is in array.c, where allocMatrix check for
VK if ((double)nrow * (double)ncol INT_MAX). But why
VK itn is used and not long int for indexing? (max int is
VK 2147483647, max long int is 9223372036854775807)
Well, Brian gave you all info:
Hi,
I would like to convert a simple list into an environment object. It seems I
have to create an environment object with new.env() and assign the single
values afterwards. Now what I did not really understand from the guides
until now is, how the parent environment supplied to the new.env()
I ended up finding one solution to my 2nd question.
Here it is :
http://tolstoy.newcastle.edu.au/R/help/04/01/0649.html
Sorry for the bother.
David
De: GOUACHE David
Date: ven. 01/08/2008 15:50
À: Deepayan Sarkar
Cc: [EMAIL PROTECTED]
Objet : RE : [R]
On 8/1/2008 9:46 AM, Benjamin Otto wrote:
Hi,
I would like to convert a simple list into an environment object. It seems I
have to create an environment object with new.env() and assign the single
values afterwards. Now what I did not really understand from the guides
until now is, how the
VK == Vadim Kutsyy [EMAIL PROTECTED]
on Fri, 01 Aug 2008 07:35:01 -0700 writes:
VK Martin Maechler wrote:
VK The problem is in array.c, where allocMatrix check for
VK if ((double)nrow * (double)ncol INT_MAX). But why
VK itn is used and not long int for indexing? (max
Hi,
I have a modelo like this:
Yvar - c(0, 0, 0, 0, 1, 0, 0, 0, 1, 2, 1, 1, 2, 3, 6, 6, 3, 3, 4)
TIME - 4:22
ID - rep(PlotA,19)
m - lmer(Yvar~TIME+(TIME|ID),family=poisson)
anova(m)
summary(m)
How to get the p-value for this case?
Thanks
Ronaldo
--
Just because you're paranoid doesn't mean
on 08/01/2008 10:11 AM Ronaldo Reis Junior wrote:
Hi,
I have a modelo like this:
Yvar - c(0, 0, 0, 0, 1, 0, 0, 0, 1, 2, 1, 1, 2, 3, 6, 6, 3, 3, 4)
TIME - 4:22
ID - rep(PlotA,19)
m - lmer(Yvar~TIME+(TIME|ID),family=poisson)
anova(m)
summary(m)
How to get the p-value for this case?
Thanks
Hi
I'm sure this question has been asked before but I can't find it in the
archives.
I have a data frame which includes interval and ordered nominal results.
It looks something like
Measured Eyeball
46.5 Normal
43.5 Mild
56.2 Normal
41.1 Mild
37.8 Moderate
12.6 Severe
17.3
Hi everyone,
I thought that for a selfStart function, these two should be exactly
equivalent
nls(Aform, DF)
nls(Aform, DF, start=getInitial(Aform, DF))
but in this example that is not the case in R (although it is in S-plus
V6.2)
--
SSbatch-selfStart(
The biggest problem is that SPSS cannot fit a generalized linear mixed
model but lmer does. So, why would you expect the GLM in SPSS and the
GLMM in lmer to match anyhow?
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Draga, R.
Sent: Friday, August
Hi R users,
I would like to create an image using three matrices which contain the
values of Red, Green, and Blue of each pixel, i.e. one matrix which has
values of red, one which has values of green, and one which has values of
blue.
The values are between 0 and 1 instead of 0-255.
I have
Hi
if I try to import a raster layer which consists only of NULL values
from grass by using the readRAST6, I get an error message:
readRAST6(HSericea_seedsDisperse_2007)
ERROR: Invalid value for null (integers only)
Error in readBinGrid(rtmpfl11, colname = vname[i], proj4string = p4,
integer
Hi Rostam,
did you check
?rgb
already?
Hope this helps,
Roland
rostam shahname wrote:
Hi R users,
I would like to create an image using three matrices which contain the
values of Red, Green, and Blue of each pixel, i.e. one matrix which has
values of red, one which has values of green, and
Thomas Chu wrote:
Neither of those 3 lines of commands managed to drop x4 and its P value
magically decreased from 0.94 to almost 0! I am also baffled by how R
calculated those RSS.
Maybe it is using a different type of SS. If i have a lm() model, and i do:
First off, Marc Schwartz posted this link earlier today, read it.
http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-are-p_002dvalues-not-di
splayed-when-using-lmer_0028_0029_003f
Second, your email is not really descriptive enough. I have no idea what
OR is, so I have no reaction.
Third, you're
On Fri, Aug 1, 2008 at 6:03 PM, Roger Bivand [EMAIL PROTECTED] wrote:
On Fri, 1 Aug 2008, Rainer M Krug wrote:
Hi
if I try to import a raster layer which consists only of NULL values
from grass by using the readRAST6, I get an error message:
readRAST6(HSericea_seedsDisperse_2007)
I have a data file called inputdata.csv that looks something like this
ID YearResult Month Date
1 71741954 103 540301
2 7174195443 540322
3 20924 1967 4 2 670223
4 20924
On Fri, 1 Aug 2008, Rainer M Krug wrote:
Hi
if I try to import a raster layer which consists only of NULL values
from grass by using the readRAST6, I get an error message:
readRAST6(HSericea_seedsDisperse_2007)
ERROR: Invalid value for null (integers only)
Error in readBinGrid(rtmpfl11,
Dear list,
I'm writing a long document (thesis) and as much as I would like to
use only ggplot2 for the graphics, some features are still a bit
undocumented so I often end up choosing either ggplot2, lattice, or
base plots (which i know better) depending on the particular graph to
I'm not quite sure if this is what you mean but have a look at ?lowess or
?smooth. I think you might get want you want if you play around with the
parameters in lowess
--- On Fri, 8/1/08, Ptit_Bleu [EMAIL PROTECTED] wrote:
From: Ptit_Bleu [EMAIL PROTECTED]
Subject: [R] Best way to select
Sandy,
You can re-order a factor with
df$Eyeball-factor(df$Eyeball, levels=c(Normal, Mild, Moderate,
Severe), ordered=T)
(assuming df is your data frame and that you want an _ordered_ factor;
the latter is not essential to your plots)
Incidentally, NULL isn't a particularly friendly item to
HI R users
With clara function I get a data frame (maybe this is not the exact word,
I'm new to R) with the following variables:
names(myclara)
[1] sample medoidsi.med clustering objective
[6] clusinfo diss call silinfodata
I want to export clustering and data
on 08/01/2008 10:21 AM Sandy Small wrote:
Hi
I'm sure this question has been asked before but I can't find it in the
archives.
I have a data frame which includes interval and ordered nominal results.
It looks something like
Measured Eyeball
46.5 Normal
43.5 Mild
56.2 Normal
41.1
Use gc() in the loop to possibly free up any fragmented memory. You
might also print out the size of B (object.size(B)) since that appears
to be the only variable in your loop that might be growing.
On Fri, Aug 1, 2008 at 12:09 PM, Tom La Bone [EMAIL PROTECTED] wrote:
I have a data file
Hi,
I'm trying to help a friend who is doing a thesis in a nurse college, to
evaluate medical question forms.
There are about 30 questions giving more than 110 parameters to describe
each responding person's (gender, health etc.) and there are about 120
question forms to evaluate.
I have
Hello.
I don't know how to do to ouput segments between points like the chart attached.
Can you help me please?
Thanks.
_
Envo__
R-help@r-project.org mailing list
Hello.
I don't know how to do to ouput segments between points like the chart attached.
Can you help me please?
Thanks.
.yahoo.fr__
R-help@r-project.org mailing list
Hi,
I am getting the following error when using R CMD INSTALL ever since I
upgraded to R-2.7.1:
hhc: not found
CHM compile failed: HTML Help Workshop not intalled?
As indicated, the package is installed but without CHM help files. I
have downloaded the latest version of Rtools and I have tried
I'm not really clear on what you want here. Are you talking about plotting
multiple data points for each value ? In that case something like boxplot
might be what you want. Otherwise if you just wish to plot a data point for
each occurance of Normal etc then this will work but I'm not sure
Just recently the ability to handle POSIXt style formats in as.chron
was added:
x - c(07/01/2001 12:00:00,07/17/2001 15:00:00)
y - as.chron(x, %m/%d/%Y %H:%M:%S)
y
[1] (07/01/01 12:00:00) (07/17/01 15:00:00)
# Here is a workaround
format(as.POSIXct(y), tz = GMT, format = %m/%d %H:%M)
[1]
try
str(myclara)
to see what you have - a data frame , matrix etc
Are you getting any error messages?
I tried your write.table commands and they work okay.
--- On Fri, 8/1/08, pacomet [EMAIL PROTECTED] wrote:
From: pacomet [EMAIL PROTECTED]
Subject: [R] Exporting data to a text file
To:
Em Sex 01 Ago 2008, Marc Schwartz escreveu:
on 08/01/2008 10:11 AM Ronaldo Reis Junior wrote:
Hi,
I have a modelo like this:
Yvar - c(0, 0, 0, 0, 1, 0, 0, 0, 1, 2, 1, 1, 2, 3, 6, 6, 3, 3, 4)
TIME - 4:22
ID - rep(PlotA,19)
m - lmer(Yvar~TIME+(TIME|ID),family=poisson)
anova(m)
Dear Bert:
Thank you for your reply. But the eval.parent function does not seem to
solve the problem. Below is the code. I have tried running it with
eval.parent(myknot)
as well as with integers from 0 through 4, as in
eval.parent(myknot, 4)
Each attempt produces the same error:
Error in
Same problem. The Windows Task Manager indicated that Rgui.exe was using
1,249,722 K of memory when the error occurred. This is R 2.7.1 by the way.
library(boot)
setwd(C:/Documents and Settings/Tom/Desktop)
data.in - read.csv(inputdata.csv,header=T,as.is=T)
per95 - function(
Hi all,
I have data that looks like
number|grouping
I would like to preform stats for each grouping
so
1|5
6|5
10|5
11|5
3|9
5|9
10|9
Say I would like to take the median for above, I should be returned 2 lines,
one for group #5 and one for group #9
Does this make sense?
I am sorry for the
Hi,
I would like to view matrices I am working with in a clean, easy to read,
separate window.
A friend showed me how to do something like I want with edit(). I can view
the matrix in the 'R Data Editor':
For a sample matrix:
mat=matrix(1:15,ncol=3)
mat
[,1] [,2] [,3]
[1,]16
5a) save my entire history to a text file
5b) open it up in Emacs
5c) prune any lines that don't have assignment operators
Ken Williams
Research Scientist
The Thomson Reuters Corporation
Eagan, MN
No one has yet mentioned the obvious. ESS does your 5a 5b 5c with
M-x
Hi,
I am trying to get the positions in array coordinates (needed later) of certain
elements in an array but I am not sure how to get them.
My array is Q and the condition is dtdV, where dt and dV are arrays of exactly
the same dimensions as Q.
I know that I can extract the elements of Q by
See ?View but I don't think it 'auto updates' per your last sentence.
Maybe there's a better option?
Rachel Schwartz wrote:
Hi,
I would like to view matrices I am working with in a clean, easy to read,
separate window.
A friend showed me how to do something like I want with edit(). I can
Hi Ronaldo,
... lmer p-values
There are two packages that may help you with this and that might work with
the current implementation of lmer(). They are languageR and RLRsim.
HTH, Mark.
Bugzilla from [EMAIL PROTECTED] wrote:
Hi,
I have a modelo like this:
Yvar - c(0, 0, 0, 0, 1, 0,
Dear all,
Your constant talking about what bootstrap is and is not suitable for
made me finally verify the findings in the Pawinski et al paper.
Here is the procedure and the findings:
- First of all I took the raw data (that was posted earlier on this
list) and estimated the AUC values
On 8/1/08 12:40 PM, Richard M. Heiberger [EMAIL PROTECTED] wrote:
5a) save my entire history to a text file
5b) open it up in Emacs
5c) prune any lines that don't have assignment operators
No one has yet mentioned the obvious. ESS does your 5a 5b 5c with
M-x
I meant 5a 5b 5c. Multiple-line commands are handled correctly.
What is is doing is looking for and + prompts. Anything else
is removed.
Here is a selection from the *R* buffer and the result after cleaning.
It includes an example of par().
Rich
*R*
options(chmhelp = FALSE)
Hi Folks!
I used the code below previously with no problems, but now I get:
DTB3-read.table(C:\\Program
Files\\R\\R-2.7.1\\DTB3.csv,header=TRUE,sep=,)
tail(DTB3)
DATE VALUE
14233 2008-07-23 1.56
14234 2008-07-24 1.62
14235 2008-07-25 1.71
14236 2008-07-28 1.70
14237
My suspicion is that there is some value
that R does not think is numeric, so the
column becomes a factor, and you are
seeing the codes for the factor.
Patrick Burns
[EMAIL PROTECTED]
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and A Guide for the Unwilling S User)
Kerpel,
Apparently, the Fed changed the way they handled missing values in the
interest rates files; now they use a period instead of #N/A like they
did in my old files. When I do a global replace and replace the periods
with a blank prior to importing in R, I get what I used to get:
# I am sure there is a better way than this
a - c(1,6,10,11,3,5,10)
group - c(5,5,5,5,9,9,9)
my.df - cbind(a,group)
a.5 - subset(my.df, group==5)
median(a.5[,1])
a.9 - subset(my.df, group==9)
median(a.9[,1])
# MASS 4 is a good book
On Fri, Aug 1, 2008 at 1:30 PM, Lotta R [EMAIL PROTECTED] wrote:
I know the following is documented behaviour, in the sense that the
help page for as.character mentions that it truncates at about 500
characters... but wouldn't it be better if there was a warning of
some sort issued? Or am I misunderstanding what's happening here?
str -
I have a matrix named spec (see below), it is a 6x3 matrix, and each element
of spec is a list. For example, spec[1,wavenumber] is a list, and it contains
1876 numeric numbers and NAs. I want to replace the NAs to zero, but don't know
how to change it, the difficulty may be all the elements are
?aggregate
Something like this should do it.
aggregate(xx[,1], list(xx[,2], median)
--- On Fri, 8/1/08, stephen sefick [EMAIL PROTECTED] wrote:
From: stephen sefick [EMAIL PROTECTED]
Subject: Re: [R] simple help request
To: Lotta R [EMAIL PROTECTED]
Cc: r-help@r-project.org
Received:
I have data that looks like
O.lengthO.age
176 1
179 1
182 1
...
493 5
494 5
514 5
606 5
462 6
491 6
537 6
553 6
432 7
522 7
625 8
661 8
687 10
704 10
615 12
(truncated)
with a simple VonB growth model from within nls():
Dear Lotta,
Try
my.df - data.frame(a - c(1,6,10,11,3,5,10), group - c(5,5,5,5,9,9,9))
tapply(my.df$a,my.df$group,median)
5 9
8 5
See ?tapply and/or ?aggregate for more information.
HTH,
Jorge
On Fri, Aug 1, 2008 at 1:30 PM, Lotta R [EMAIL PROTECTED] wrote:
Hi all,
I have data that
Hi,
to be honest, I never created a matrix of lists before, but hopefully
this code will help you?
set.seed(12345)
my.pool - c(NA, 0:10)
n - 25
alist - list(sample(x=my.pool, size=n, replace=TRUE))
alist
mymatrix - matrix(rep(alist, 6*3), nrow=6)
mymatrix2 - lapply(X=mymatrix,
Hello,
I am trying to compute a distance measure for the rows (var1) in a
sparse matrix:
require(Matrix)
dfx = xtabs(~ var1 + var2, data = df, sparse = T, drop.unused.levels = T
)
dm = dist(dfx)
on my data frame. Note that I am using the xtabs function from the
Matrix package, not
Thanks Erik, almost worked! I am a mac user and for some reason View worked
perfectly for my PC using friend, but
doesn't for me.
When I tried:
mat=matrix(1:10,ncol=2)
mat
[,1] [,2]
[1,]16
[2,]27
[3,]38
[4,]49
[5,]5 10
View(mat)
I get no error
On 8/1/2008 12:39 PM, Richard Chandler wrote:
Hi,
I am getting the following error when using R CMD INSTALL ever since I
upgraded to R-2.7.1:
hhc: not found
CHM compile failed: HTML Help Workshop not intalled?
As indicated, the package is installed but without CHM help files. I
have
Rachel Schwartz wrote:
Thanks Erik, almost worked! I am a mac user and for some reason View
worked perfectly for my PC using friend, but
doesn't for me.
When I tried:
mat=matrix(1:10,ncol=2)
mat
[,1] [,2]
[1,]16
[2,]27
[3,]38
[4,]49
[5,]5 10
It seems like the objects are reasonable size and the memory size also
seems reasonable. That is what I usually go by to see if there are
large objects in my memory. If it was showing that R had 1.2GB of
memory allocated to it, I wonder if there might be a memory leak
somewhere.
On Fri, Aug 1,
I'm interested in analysing some of my data using multinomial regression.
I have been using nnet's multinom so far.
However, I found that some of the data shows overdispersion and hence want to
change to robust multinomial regression, package: multinomRob
I have succesfully implemented Agresti's
1 - 100 of 120 matches
Mail list logo