On Jun 12, 2008, at 2:24 AM, Qman Fin wrote:
Hi all,
I have some data x, which are actualy consisted of numerical
enties. But the
class of this matrix is set to be "factor" by someone else. I used
"class(x)", it turns out to be "factor". So I can not calculate them.
The typical approach is
If x is a vector (one dimensional) then as.numeric(levels(x)) works - I am not
sure whether this is the best solution.
If you have a matrix you can use apply, i.e
x1 <- apply(x,2,function(a) as.numeric(levels(a)))
--- On Thu, 12/6/08, Qman Fin <[EMAIL PROTECTED]> wrote:
> From: Qman Fin <[EMAI
Try:
x <- factor(1:10)
class(x)
x + 1
class(x) <- "numeric"
x+1
On Jun 12, 2008, at 8:24 AM, Qman Fin wrote:
Hi all,
I have some data x, which are actualy consisted of numerical
enties. But the
class of this matrix is set to be "factor" by someone else. I used
"class(x)", it turns out to b
i am new user of R-language. i have problem in attachment of spss file . i have
downloaded the foreign package but i have still problem in attachment.
i am typing 'data=read.spss(file name.choose()). is it right or not?
could you plz tell me the way for attachment?
thanks
Hi Selina,
try ?as.numeric,
small example
a=c(1,2,3,4,5)
b=as.factor(a)
class(b)
c=as.numeric(b)
class(c)
in the case of a matrix of factor,try
apply(matrix,1, as.numeric)
Cheers
A.
- Messaggio originale -
Da: Qman Fin <[EMAIL PROTECTED]>
A: r-help@r-project.org
Inviato: GiovedÃ
I have successfully installed ADaCGH package, and trying the example in
SegmentPlotWrite did produce alot of pngs and html. I tried again the same
example this morning (after a long night of installation), ADaCGH crashes at
mpiInit() showing the error:
Loading required package: Rmpi
ELAN_EXCEP
Seeing how there have been three wrong answers so far, I should point
out that:
1) This is an FAQ: http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-
do-I-convert-factors-to-numeric_003f
2) Most of the other methods suggested so far fail if the example x
used is not of the form 1:n. The only
On Thu, Jun 12, 2008 at 03:42:23AM -0400, Charilaos Skiadas wrote:
> Seeing how there have been three wrong answers so far, I should point
> out that:
>
> 1) This is an FAQ: http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-
> do-I-convert-factors-to-numeric_003f
Going over the r-help archive,
Conversion to factor may happen (and often does) when you read in data with
read.table(). So one solution may be reading in the same data again in a
slightly different way:
read.table(file="mydatafile", as.is=TRUE)
# see also ?read.table
You can also specify a class to each column of the data you
Wild extrapolation thought it is... it works for me with mgcv 1.4-0 and R
2.7.0 on linux:
> test
1 2 3 45
20.73032 16.83549 59.42120 29.07759 13.09754
what mgcv and R versions are you using, and on what OS? (btw `gam.method'
isn't a
I have an additional question concerning to this topic.
I usually use something liek that:
read.table(, colClasses=c("numeric", "factor", "character",
"my.funny.class"))
but why can I not implement "ordered.factor" in there?
Birgit
Kenn Konstabel wrote:
>
> Conversion to factor may hap
Hi,
How do I ensure that I always get a matrix back when I extract rows?
The mickey-mouse example doesn't matter much, but if instead of 1:2 or
1, I have a vector which may have 1 or more values, then I'm in trouble.
Any way to make this consistently return a matrix?
Thx in advance.
- Ken
#
--
Dear List,
Do you know any way I can convert XML parameters into column headers. My
data is in a csv file with each row containing a xml form of data , and
multiple parameters (
data_val1 , data_val2 )
I want to convert it so each row caters to one record and each parameter
becomes a differe
Feng, Ken wrote:
> Hi,
>
> How do I ensure that I always get a matrix back when I extract rows?
>
> The mickey-mouse example doesn't matter much, but if instead of 1:2 or
> 1, I have a vector which may have 1 or more values, then I'm in trouble.
>
> Any way to make this consistently return a matrix
Hi all,
I've been reading and using the information from the list for some time but
this is my first question here. English is not my primary language, so sorry
in advance for any language mistakes. :)
I'm working with the "timereg" package to analize survival data. I want to
perform a multivaria
Thank you for those details, the only optimization routine I've come accross
outside of CRAN is:
http://www.stat.umn.edu/geyer/trust/
Personally I only use nlminb for the estimation of Time Series models, which
typically have well defined limits for the elements of the parameter vector
- so in my
Dear Daren,
First, please note that since this problem concerns a particular
package, you are supposed to contact the package maintainer (me)
directly. (See the R-FAQ, 9.2).
Anyway, I've never seen that error message before. But I think it
indicates a problem with your MPI setup, nothing related
On Thu, 12 Jun 2008, Birgitle wrote:
I have an additional question concerning to this topic.
I usually use something liek that:
read.table(, colClasses=c("numeric", "factor", "character",
"my.funny.class"))
but why can I not implement "ordered.factor" in there?
Because the help page s
Georg Otto wrote:
Hi,
I have a question about applying a function recursively through a
list. Suppose I have a list where the different elements have
different levels of recursion:
...
I understand that with a fixed number of recursion levels one can use
lapply() in a nested way, but what i
In R version 2.7.0 (2008-04-22) as.numeric(".") returns zero.
> as.numeric(".")
[1] 0
This must be a bug. Splus and previous versions of R (<= 2.6.0) return NA,
as you might expect.
I'm running R version 2.7.0 (2008-04-22) on Windows XP.
Paul
___
Hi,
thanks a lot for your help. Somehow rapply had escaped my notice. I
also have a follow-up question on that. I would like to "flatten" my
output list to a list with only one level. Option "unlist" in rapply
returns a character vector, in my example:
> rapply(test.list, rev, how="unlist")
Prof Brian Ripley wrote:
>
> See ?rapply
Golly, the things one learns when least expecting it.
Jim
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guid
Paul Johnson:
> In R version 2.7.0 (2008-04-22) as.numeric(".") returns zero.
>
>> as.numeric(".")
> [1] 0
Seems to be fixed already. In R version 2.7.0 Patched (2008-06-12 r45898):
$ as.numeric(".")
[1] NA
Warning message:
NAs introduced by coercion
--
Karl Ove Hufthammer
__
I've been trying to write the consoles output to a tktext window, but have not
succeeded...
Does anybody know if that works?
Any help would be highly appreciated.
Thanks in advance,
Andreas Posch
__
R-help@r-project.org mailing list
https://stat.ethz.
Paul Johnson wrote:
> In R version 2.7.0 (2008-04-22) as.numeric(".") returns zero.
>
>
>> as.numeric(".")
>>
> [1] 0
>
> This must be a bug. Splus and previous versions of R (<= 2.6.0) return NA,
> as you might expect.
>
> I'm running R version 2.7.0 (2008-04-22) on Windows XP.
>
>
I su
You have failed to provide the most basic of information as requested in
the posting guide. As you mention 'i create a x11 window and plot' I will
assume you mean that you open an X11() device and hence this is some
Unix-alike OS.
This has come up several times before, so please search the ar
I keep running up against the same error when I try to plot a line from a nls
model. The data is fisheries length/weight data. Code follows:
require(graphics)
pow = nls(Weight~alpha*Length^beta, data=wae,
start=list(alpha=0.001, beta=3.0), trace=TRUE)
pre
On Thu, 12 Jun 2008, Peter Dalgaard wrote:
Paul Johnson wrote:
In R version 2.7.0 (2008-04-22) as.numeric(".") returns zero.
as.numeric(".")
[1] 0
This must be a bug. Splus and previous versions of R (<= 2.6.0) return NA,
as you might expect.
Depends who is doing the expecting. Americans
Ranney, Steven montana.edu> writes:
> plot(Weight~Length, data = wae, pch=19,
> xlab="Length (mm)", ylab="Weight (g)",
> xlim = c(150,1000), ylim = c(0, 10050))
> mod = seq(150, 1000)
To predict from Weight~alpha*Length^beta you need to specify Length, not
Weight. It is most likely finding Length from your workspace.
On Thu, 12 Jun 2008, Ranney, Steven wrote:
I keep running up against the same error when I try to plot a line from a nls
model. The data is fisheries length
Thanks. As a (relatively) new user of R and programming in general, I tend to
miss things like that. I appreciate your patience.
SR
Steven H. Ranney
Graduate Research Assistant (Ph.D)
USGS Montana Cooperative Fishery Research Unit
Montana State University
PO Box 173460
Bozeman, MT 59717-3460
Wrap each element in an environment, flatten that and then
extact the element in each environment. (Be sure not to use
an old version of R since sufficiently far back R had a bug when
environments were stored in lists that was since fixed.)
L <- rapply(test.list, function(el) environment(), how =
- begin included message
In case cohort study, we can fit proportional hazard regression model to
case-cohort data. In R, the function is cch() in Survival package
Now I am working on case cohort analysis with time dependent covariates
using cch() of "Survival" R package. I wonder if cch() pro
Here's a naive question about axis()
How do you control the location of the labels with the axis() command?
In the following example:
foo <- data.frame(plot.x=seq(1:3), plot.y=seq(4:6))
plot(foo$plot.x, foo$plot.y, type='n', axes=FALSE)
points(foo$plot.x, foo$plot.y)
axis(1, at=foo$plot.x, label
Try this workaround:
library(methods)
setClass("of")
setAs("character", "of", function(from) as.ordered(from))
Input <- "A B
b 1
c 2
a 3
"
DF <- read.table(textConnection(Input), header = TRUE,
colClasses = c("of", "numeric"))
str(DF)
On Thu, Jun 12, 2008 at 4:57 AM, Birgitle <[EMAIL PROTECTE
Hi Andrew,
Perhaps this example would help. You can add in spaces to the mtext text
to move the text sideways.
par(mai=c(0.5,0.5,0.5,0.5),oma=c(2,2,2,2)) #mai units are INCHES, oma
units are LINES
plot(runif(50),xlab="xlab",ylab="ylab",bty="l") #n.b. these labels don't
appear
mtext("First in
Dear R User,
say I have this sample of data ( attach with). What i'm going to do is to
test whether this data is uniformly distributed or not by finding the p-value.
I've tried using the punif command but it gave me the value of 1 of all the
data. Any suggestion on R command to find the p-
Here's a sample:
> unif_rand_1 <- runif(1000);
> unif_rand_2 <- runif(1000);
> ks.test(unif_rand_1,unif_rand_2);
Two-sample Kolmogorov-Smirnov test
data: unif_rand_1 and unif_rand_2
D = 0.021, p-value = 0.9802
alternative hypothesis: two-sided
So in your case:
> ks.test( runif( length( you
Something like. . .
> midpoint <- c(132968364, 135945080, 156539568, 157817896,
+ 162399496, 168344072, 173146584, 176302744,
+ 182878168, 183946152, 185068720, 190791232,
+ 84317660, 93708872, 106810172, 12684,
+ 148519056, 150945112, 155771432, 181069984,
+ 87104384
+ )
> shapiro.test(
Dear all
I am trying to compare the performances of several methods using the AUC0.1
and
not the whole AUC. (meaning I wanted to compare to AUC's whose x axis only
goes to
0.1 not 1)
I came to know about the Mcneil Hanley test from Bernardo Rangel Tura
and I referred to the original paper for th
Not sure if this is what you are looking for but you can get
the p-value with something like this:
# Create a vector
mydata<-
c(132968364, 135945080, 156539568, 157817896, 162399496,
168344072, 173146584, 176302744, 182878168, 183946152,
18506
Our July *** New York City *** R/S Fundamentals and Programming
Techniques is scheduled for:
New York City / July 28-29, 2008 ***
Please direct enquiries to Sue Turner: [EMAIL PROTECTED]
Ask for Group Discount ---
Looking for R Advanced course? It's comming up in Seattle on
I tried your alternative method on the example in cch() description manual.
The example data "nwtco" has not time-dependent covariates yet. I test cch()
and coxph() on the same data. But the estimation result is different. I
don't know if I did anything wrong.
subcoh <- nwtco$in.subcohort
selccoh
Simon Blomberg wrote:
>>> Good points Ben. For now I'd recommend simply that the allergic
>>> reaction to insignificant statistical tests be treated with an
>>> antihistamine :-)
>>>
>> A vote for Frank's comment to be added to the 'fortunes' package.
>>
>>
> Seconded! :-)
>
>
Tha
on 06/12/2008 09:37 AM Peter Dalgaard wrote:
Simon Blomberg wrote:
Good points Ben. For now I'd recommend simply that the allergic
reaction to insignificant statistical tests be treated with an
antihistamine :-)
A vote for Frank's comment to be added to the 'fortunes' package.
S
To whom it may concern,
I am currently writing a program where I need to use function rep.
The results I get are quite confusing. Given two
vectors A and B, I want to replicate a[1] b[1]
times, a[2] b[2] times and so on.
All the entries of vector B are positive integers.
My problem comes from th
On Jun 12, 2008, at 10:48 AM, Julien Hunt wrote:
Do you
need more information on my specific program.
Thanks for your time and help,
Yes, as the posting guide says, we would probably need a reproducible
self-contained example. Emphasis on "reproducible" and "self-contained.
Best regards,
We need a reproducible example of this to tell you what is going on.
Find a small example that exhibits the confusing behavior, and share it
with the list.
Julien Hunt wrote:
To whom it may concern,
I am currently writing a program where I need to use function rep.
The results I get are quite
Thanks for the reply. I think I've figured it out, you can set this with
the mgp parameter.
So I'd use the following statement instead:
axis(1, at=foo$plot.x, labels=foo$plot.x, mgp=c(3,0.5,1)) #this brings the
axis labels closer to the axis line
Andrew
On Thu, Jun 12, 2008 at 9:53 AM, Toby Ma
G'day Julien,
On Thu, 12 Jun 2008 16:48:43 +0200
Julien Hunt <[EMAIL PROTECTED]> wrote:
> I am currently writing a program where I need to use function rep.
> The results I get are quite confusing. Given two
> vectors A and B, I want to replicate a[1] b[1]
> times, a[2] b[2] times and so on.
>
on 06/12/2008 09:48 AM Julien Hunt wrote:
To whom it may concern,
I am currently writing a program where I need to use function rep.
The results I get are quite confusing. Given two
vectors A and B, I want to replicate a[1] b[1]
times, a[2] b[2] times and so on.
All the entries of vector B ar
same subject id has to be multiple in mutiple times like following format,
Multiple records per id not allowed in cch()
so it's difficult to use cch() for time dependent covariate. Maybe coxph()
is alternative, but seems difficult because coxph() and cch() return
different estimate for same data "n
Hi,
I am a newbie to R and I am working with a Mac.
Is there any package that I can use to generate random samples from a
user defined distribution ? That is , I define a distribution
function ( maybe multi dimension ) and I want some random samples
generated from my this distribution.
Jin Wang had an error. My original note specified a variable that was 1 for
subjects NOT in the subcohort, so the correct coxph call is
coxph(Surv(edrel, rel) ~ stage + histol + age +
offset(-100*(subcohort==0)) + cluster(seqno), data =ccoh.data)
This gives the same coeffici
Dear R users,
I would like to know if there is a way to increase the for() loop speed
because in my routine the calculations are too slow.
Best regards.
Rafael Barros de Rezende
Cedeplar - Center for Development and Regional Planning
Face, UFMG ([1]http://www.cedeplar.ufmg.
Berwin appears to be correct here. After you do x <- x / 0.0001,
I inserted a call to round(x) - x, and received
round(x) - x
[1] 7.275958e-12 0.00e+00 0.00e+00
This is basically a case of FAQ 7.31.
Julien Hunt wrote:
Hi I believe this should provide an example of the confusing behav
Dear list,
I have a problem with freq from prettyR.
Please have a look at my syntax with a litte example:
library(prettyR)
#Version 1
test.df<-data.frame(q1=sample(1:4,8,TRUE), gender=sample(c("f","m"),8,TRUE))
test.df
freq(test.df) #No error message
#Version 2
test.df<-data.frame(gender=sampl
Dear R users,
I would like to know if there is a way to increase the for() loop speed
because in my routine the calculations are too slow.
Best regards.
Rafael Barros de Rezende
Cedeplar - Center for Development and Regional Planning
Face, UFMG ([1]http://www.cedeplar.ufmg.
Hi,
Can we execute a unix shell command from within R shell?
thanks,
Sam
--
View this message in context:
http://www.nabble.com/shell-command-tp17803089p17803089.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org ma
Hi I believe this should provide an example of the confusing behavior.
Run this with t=100 for example:
test=function(t){
x=c()
while(sum(x)<=t){
###I simply generate some numbers from an
exponential until the sum of these numbers gets
to 100(without loss of generality)
x=c(x,round(rexp(1,0.1)
I have a 2x2 plot set up using: par(mfrow=c(2,2))
I'd like to put an overall title on the page, but I cannot figure out how. Any
ideas?
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/li
Yes, see ?system
samitj wrote:
Hi,
Can we execute a unix shell command from within R shell?
thanks,
Sam
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/post
samitj wrote:
Hi,
Can we execute a unix shell command from within R shell?
thanks,
Sam
?system
hth,
Paul
--
Drs. Paul Hiemstra
Department of Physical Geography
Faculty of Geosciences
University of Utrecht
Heidelberglaan 2
P.O. Box 80.115
3508 TC Utrecht
Phone: +31302535773
Fax:+31302
Hi Ajay --
"ajay ohri" <[EMAIL PROTECTED]> writes:
> Dear List,
>
> Do you know any way I can convert XML parameters into column headers. My
In R, the XML package will help you...
> data is in a csv file with each row containing a xml form of data , and
> multiple parameters (
>
> data_val1 ,
13 minutes is a long time for a loop to simply send an email, what other
calculations are going on?
Rafael Barros de Rezende wrote:
Dear R users,
I would like to know if there is a way to increase the for() loop speed
because in my routine the calculations are too slow.
Best regar
See mtext:
mtext("Title", outer = T, side = 3, line = -2)
On Thu, Jun 12, 2008 at 12:38 PM, <[EMAIL PROTECTED]> wrote:
> I have a 2x2 plot set up using: par(mfrow=c(2,2))
> I'd like to put an overall title on the page, but I cannot figure out how.
> Any ideas?
>
>
>[[alternative HTML
Please try this:
> z1 <- rexp(100)
> z2 <- rexp(100)
> z3 <- rexp(100)
> z4 <- rexp(100)
> par(mfrow=c(2,2),oma = c(0, 0, 3, 0))
> curve(dexp,from=0,to=5)
> hist(z1,main="first")
> hist(z2,main="second")
> hist(z3,main="third")
> mtext("Densities", outer = TRUE, cex = 1.5)
>
Hope this helps.
Sin
Dukka k.c. wrote:
Dear all
I am trying to compare the performances of several methods using the AUC0.1
and
not the whole AUC. (meaning I wanted to compare to AUC's whose x axis only
goes to
0.1 not 1)
I came to know about the Mcneil Hanley test from Bernardo Rangel Tura
and I referred to the o
My routine is on Financial Econometrics (Yield Curve Modeling). It is very
intensive. And I have heard that the for() loop speed could be increased
with a command. I want to know if there a way to do it.
Best regards.
Rafael Barros de Rezende
-- Original Message
?title, see 'outer' (and you will need to make room for an outer margin).
This is described in 'An Introduction to R' (and in all good books on R).
On Thu, 12 Jun 2008, [EMAIL PROTECTED] wrote:
I have a 2x2 plot set up using: par(mfrow=c(2,2))
I'd like to put an overall title on the page, but
We would certainly need more information about your function to offer
any specific advice, therefore I'll fall back on the general. First
there is no command that will increase a for loop speed, it is not as if
they are artificially slowed down.
In general, you may be able to do whatever it i
I believe this might do what you want a bit faster. I replaced the
while loop with something that is likely to be faster. I saw no
reason for the rounding you were doing, better to use as.integer at
the end.
test <- function(t){
x <- rexp(t,0.1)
while(sum(x) <= t) {
x <- c(x, rexp(
I would like to add two horizontal lines representing acceptible drug levels to
a trellis plot.
I tried using abline and I get an error that "plot.new has not been called."
See below.
xyplot(FK~WEEK|Event1/MRN, data=FKdat.o1)
abline(h=5)
abline(h=10)
Error in int_abline(a = a, b = b, h = h,
Please read about panel functions in ?xyplot and ?panel.abline
In particular, you do this sort of thing in panel functions where you must
use grid graphics functions or various lattice forms (wrappers) thereof. The
standard graphics constructions will not work (as you found out).Suggested
refere
The first thing to do is to run Rprof and determine where time is
being spent. It may be that it is one of the functions that you are
calling inside the loop that is taking the majority of time and if
that is the case, there may not be any improvement other than coming
up with a different algorith
Hello,
I have a question about running R in a cluster environment. The shell script
I am running looks like this:
#!/bin/bash
cd /nfs/apollo/2/c2b2/users/mb0001/Data
/nfs/apollo/1/shares/software/core_facility/local/x86_64_rocks/R/current/bin/
R --save < calculate.R >& script.out
I ha
Hi Manisha,
How about you incluse something like this on your script.R:
setwd("/your/full/working/directory") # ?setwd
save.image()# or save.image("your_workspace.RDA").
By the way, I don´t know if you added the line below to run in background:
R --save < calculate.R >& script.out
May be
Greetings,
I am doing matching/merge for a table (40919x3) to data
which is in the form of a list of 1268 data.frames. Using
lapply this is taking ~5 minutes. I know that the match/merge
functions are time consuming, so is there an alternative to
this accomplish this goal? is lapply not efficie
Hi!
How can I subset several variables in cast?
For example, I can do it for one, (ie, ph):
cast(am, organismo +arriba ~ variable,subset=variable=="ph",mean,na.rm=T)
For selecting ph, temperature and Ba I'm using:
cast(am, organismo +arriba ~ variable,subset=variable=="ph"
variable=="temperatu
Hi All,
I am using em() function to estimate a poisson-gaussian process from a
univariate one dimension time series, but not sure how to do. In the help
manual, it specify that in "pro" of the argument "parameter", if the model
includes a Poisson term for noise, there should be one more mixing
pro
On Thu, Jun 12, 2008 at 2:27 PM, Agustin Lobo <[EMAIL PROTECTED]> wrote:
> Hi!
>
> How can I subset several variables in cast?
>
> For example, I can do it for one, (ie, ph):
> cast(am, organismo +arriba ~ variable,subset=variable=="ph",mean,na.rm=T)
>
> For selecting ph, temperature and Ba I'm usi
Check out this previous post from years ago.
http://tolstoy.newcastle.edu.au/R/help/00a/2237.html
Bill> Date: Thu, 12 Jun 2008 10:38:03 -0500> From: [EMAIL PROTECTED]> To:
r-help@r-project.org> Subject: [R] overall title> > I have a 2x2 plot set up
using: par(mfrow=c(2,2))> I'd like to put a
Hi,
I would appreciate if someone could comment on this problem I am
experiencing. I am writing a C++ program to be called from R. In this
program, there is a verbose switch that decides whether to print some
debugging info using Rprintf. On windows, things work ok. On linux, things
are fine in no
Hi all,
I have a matrix called 'data', which looks like:
> data[1:4,1:4]
Probe_ID Gene_Symbol M1601 M1602
1 A_23_P10586213CDNA73-1.60.16
2 A_23_P76435 15E1.20.180.59
3 A_24_P402115 15E1.21.63
Hi,
I'm looking for some way to pick up the numbers which are contained and buried
in a long character.
For example,
outtree.new="(((B:1204.25,E:1204.25):7581.11,F:8785.36):8353.85,C:17139.21);"
num.char =
unlist(strsplit(unlist(strsplit(unlist(strsplit(unlist(strsplit(unlist(strsplit(outtre
Hello -
ss wrote:
Hi all,
I have a matrix called 'data', which looks like:
data[1:4,1:4]
Probe_ID Gene_Symbol M1601 M1602
1 A_23_P10586213CDNA73-1.60.16
2 A_23_P76435 15E1.20.180.59
3 A_24_P402115 15E1.2
Dear Erik,
Thanks! The 'data' is matrix but all(apply(data[,3:85], 2, class) ==
"numeric")
is false.
> class(data)
[1] "matrix"
> a<- rowMeans(data[,3:85],na.rm = TRUE)
Error in rowMeans(data[, 3:85], na.rm = TRUE) : 'x' must be numeric
> all(apply(data[,3:85], 2, class) == "numeric")
[1] FALSE
>
ss wrote:
> Hi all,
>
> I have a matrix called 'data', which looks like:
>
>
>> data[1:4,1:4]
>>
> Probe_ID Gene_Symbol M1601 M1602
> 1 A_23_P10586213CDNA73-1.60.16
> 2 A_23_P76435 15E1.20.180.59
> 3 A_24_P402
on 06/12/2008 03:46 PM Hua Li wrote:
Hi,
I'm looking for some way to pick up the numbers which are contained and buried in a long character.
For example,
outtree.new="(((B:1204.25,E:1204.25):7581.11,F:8785.36):8353.85,C:17139.21);"
num.char =
unlist(strsplit(unlist(strsplit(unlist(strsplit
ss wrote:
Dear Erik,
Thanks! The 'data' is matrix but all(apply(data[,3:85], 2, class) ==
"numeric")
is false.
> class(data)
[1] "matrix"
> a<- rowMeans(data[,3:85],na.rm = TRUE)
Error in rowMeans(data[, 3:85], na.rm = TRUE) : 'x' must be numeric
> all(apply(data[,3:85], 2, class) == "nu
Hi,
I'm trying to use mars function in R to interpolate nonlinear
multivariate functions.
However, it seems that mars gives me a fit which uses only very few
basis function and
it underfits very badly.
For example, I have tried the following code to test mars:
require("mda")
f <- function(x
On Jun 12, 2008, at 5:06 PM, Marc Schwartz wrote:
on 06/12/2008 03:46 PM Hua Li wrote:
Hi,
I'm looking for some way to pick up the numbers which are
contained and buried in a long character. For example,
outtree.new="(((B:1204.25,E:1204.25):7581.11,F:8785.36):8353.85,C:
17139.21);"
num.char
I'm having some issues with getting my own jars to work properly with
rJava.
Bear with me as I explain my scenario:
I have a java package called rjbridge, with the following classes:
RJBridge.class
ObjectInfo.class
Each of the classes has the following line on top: package com.rjbridge
Thanks, Marc and Haris!
I didn't know the values of the numbers beforehand, so the scan method won't
work, but "[^+-\\d.]+" will do!
And Haris, I didn't intend to keep the information of which number is B, which
is C etc when asking the question, as I had a tedious way to do it (use
strspilt
Oh, Sorry, Marc. The scan method does work!
Hua
--- On Thu, 6/12/08, Charilaos Skiadas <[EMAIL PROTECTED]> wrote:
> From: Charilaos Skiadas <[EMAIL PROTECTED]>
> Subject: Re: [R] numbers as part of long character
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED], r-help@r-project.org
> Date: Thu
I'm invoking R in batch mode from a bash script as follows:
R --no-restore --no-save --vanilla
<$TARGET/$directory/o2sat-$VERSION.R>
$TARGET/$directory/o2sat-$VERSION.Routput
When R comes across some error in the script however it seems to halt
instead of running subsequent lines in the script:
On Jun 12, 2008, at 6:34 PM, Hua Li wrote:
Thanks, Marc and Haris!
I didn't know the values of the numbers beforehand, so the scan
method won't work, but "[^+-\\d.]+" will do!
And Haris, I didn't intend to keep the information of which number
is B, which is C etc when asking the question,
ss wrote:
> Thank you very much, Wacek! It works very well.
> But there is a minor problem. I did the following:
>
> >data <-
> read.table('E-TABM-1-processed-data-1342561271_log2_with_symbols.txt',
> +row.names = NULL ,header=TRUE, fill=TRUE)
looks like you have a data frame, not a matrix
> > d
Hi Wacek,
Yes, data is data frame not a matrix.
> is.numeric(data[3])
[1] FALSE
But I looked at the column 3 and it looks okay though. There are few NAs and
I did find
anything strange.
Any suggestions?
Thanks,
Allen
On Thu, Jun 12, 2008 at 7:01 PM, Wacek Kusnierczyk <
[EMAIL PROTECTE
To answer your specific question, you can use mvrnorm (from MASS, i.e.
library(MASS)) to generate each component.
To generate a mixture with three components (Prob(1 st component) = p1,
Prob(2nd component) = p2, Prob(3rd component) = p3, p1+p2+p3=1), you can
generate a uniformly distributed varia
1 - 100 of 119 matches
Mail list logo