Erik,
On Thu, Jul 15, 2010 at 9:27 PM, Erik Iverson wrote:
> Isn't that what you can do after you define mypng and set
> options(device = "mypng")
Thank you! I completely missed the second part where you use that as
the default device. I must have skimmed your email.
I'm definitely going to t
On Thu, Jul 15, 2010 at 1:51 PM, Michael Friendly wrote:
> In a paper I'm writing using Sweave, I make use of lattice graphics, but
> don't want to explicitly show (or explain)
> in the article text the print() wrapper I need in code chunks for the graphs
> to appear. I can solve this by including
Hi:
A nice package for doing this sort of thing is doBy. Let's manufacture an
example
since you didn't provide one:
set.seed(126)
d <- data.frame(g = rep(letters[1:3], each = 10),
x1 = rnorm(30),
x2 = rnorm(30, mean = 5),
x3 = rnorm(30, mean = 10
If you are exporting your dataframes to Excel on Windows and
if you have Excel installed and
if you are willing to make your hands dirty by programming VBA
(the programming language built into Excel) and
if you are willing to install RExcel
(by way of the CRAN package RExcelInstaller or by visiti
There may exists a good solution, but I can only give a shortcut:)
tmp2 <- (tmp1!=0)*tmp3
-
A R learner.
--
View this message in context:
http://r.789695.n4.nabble.com/how-to-skip-a-specific-value-when-using-apply-function-to-a-matrix-tp2290898p2290925.html
Sent from the R help mailing li
Correction:
## Minus 7*60*60 seconds to change AM interval from 0-12AM to 7AM-7PM
barplot(table(format((dates-7*60*60), "%w %p")),names.arg=labels)
-
A R learner.
--
View this message in context:
http://r.789695.n4.nabble.com/How-to-plot-a-histogram-of-weekday-frequencies-in-a-list-of-date
G'day,
I'm calculating LSM for the following model, and am finding that R and
SAS give different answers.
Whilst the error is at the second or third decimal, the percentage
error can be quite large.
I'm using the effects library (Version: 2.0-10) on R 2.11.1 in the
following manner:
options(contr
Hope it works.
## Create a sample of dates
dates <- sample(seq(ISOdate(2009,1,1), ISOdate(2009,12,31), "hour"),1000)
## Create 14 labels for barplot("Mon AM","Mon PM",etc.)
labels <- format(seq(ISOdate(2010,7,11,5), ISOdate(2010,7,18,4), "12
hours"),"%a %p")
## Use table function to calculate
Hello R experts,
I'd like to studentize a matrix (tmp1) by column using apply() function and
skip some specific values such as zeros in the example below to tmp2 but not
tmp3. I used the script below and only can get a matrix tmp3. Could you please
help me to studentize the matrix (tmp1) without
On Thu, Jul 15, 2010 at 10:45 PM, Murat Tasan wrote:
> hi all - i'm just wondering what sort of code people write to
> essentially performa an aggregate call, but with different functions
> being applied to the various columns.
>
> for example, if i have a data frame x and would like to marginaliz
hi all - i'm just wondering what sort of code people write to
essentially performa an aggregate call, but with different functions
being applied to the various columns.
for example, if i have a data frame x and would like to marginalize by
a factor f for the rows, but apply mean() to col1 and medi
Tena koe Stephen
You'll need to use loess(w[,"bkf_depths"]~w[,"measure"])) and predict with a
sufficiently dense sequence of w[,'measure'] to interpolate to an 'accuracy'
that meets your requirements. Actually, if I understand your data correctly,
it could be that simple linear interpolation (
Steven,
You can do it with assign() if you keep the names when you put the items in
the list:
Dlist <- list(D1=D1, D2=D2) # put the names of the objects in the list
Newlist <- lapply(Dlist, function(x) x[, columns]) # create a new list with
the output
for(i in seq(length(Newlist))) {
assign(na
Hi:
This seems to work:
b <- lapply(Dlist, function(x) x[, columns])
dnames <- c('D1', 'D2')
for(i in seq_along(dnames)) assign(dnames[i], b[[i]])
HTH,
Dennis
On Thu, Jul 15, 2010 at 6:18 PM, Steven Kang wrote:
> Hi all,
>
> There are matrices with same column names but arranged in different o
On 07/15/2010 08:32 PM, Axel Urbiz wrote:
Dear users,
My apologies for the simple question. I'd like to create a function where
the number of arguments is as big as the size of my data set. Supose I have
n observations in my data, how can I write a function like
fun<- function (x1,x2,,xn)
Dear users,
My apologies for the simple question. I'd like to create a function where
the number of arguments is as big as the size of my data set. Supose I have
n observations in my data, how can I write a function like
fun <- function (x1,x2,,xn) {x1*x2*...*xn}
Thanks in advance for y
So instead of:
> mypng()
> x=c(1,2,3)
> plot(x,x)
I can just do:
> x=c(1,2,3)
> plot(x,x)
Isn't that what you can do after you define mypng and set
options(device = "mypng")
?
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailm
Hi all,
There are matrices with same column names but arranged in different orders
and I desire columns of these matrices to have same order.
For example, below are 2 arbitrary data sets with columns arranged in
different order. I require columns of these to have same order as specified
in "colum
On Thu, Jul 15, 2010 at 8:43 PM, Erik Iverson wrote:
> On 07/15/2010 07:10 PM, James wrote:
>> I'm completely new to R, and I'd like to do something like this:
>> > x=c(1,2,3)
>> > plot(x,x)
>> At this point, R creates a file "Rplots.pdf", since the default device is
>> PDF and the defa
On Thu, Jul 15, 2010 at 8:36 PM, Sam Albers wrote:
> Unless you aren't writing scripts why wouldn't you just use something like
> this?
>
I'm writing scripts, and this is a convenience feature I'm trying to
implement. I know it can be done manually, but I'd love to be able to set
the default nam
I don't really understand your question. The function unique can remove
duplicate elements.
-
A R learner.
--
View this message in context:
http://r.789695.n4.nabble.com/Separating-parts-of-a-column-of-data-in-R-tp2290793p2290840.html
Sent from the R help mailing list archive at Nabble.com.
I'm trying to plot a series of densities using/comparing differing weights. I
see the reference to weights and subscripts, but I don't understand how to
implement that. My data are of the form:
I, J, Actual, Distance, Subset, Weight1, Weight2, ...
I'm trying to see the effect of the distance
On 07/15/2010 07:10 PM, James wrote:
I'm completely new to R, and I'd like to do something like this:
> x=c(1,2,3)
> plot(x,x)
At this point, R creates a file "Rplots.pdf", since the default device is
PDF and the default filename is "Rplots.pdf".
Since you're completely new to R,
Unless you aren't writing scripts why wouldn't you just use something like
this?
> x=c(1,2,3)
> pdf("RRules.pdf")
> plot(x,x)
> dev.off()
--
View this message in context:
http://r.789695.n4.nabble.com/Can-I-set-default-parameters-for-the-default-graphics-device-tp2290827p2290836.html
Sent fro
Excellent idea
-Original Message-
From: Erik Iverson [mailto:er...@ccbr.umn.edu]
Sent: Thursday, July 15, 2010 5:40 PM
To: Doran, Harold
Cc: r-help@r-project.org
Subject: Re: [R] Proper use of grep
Doran, Harold wrote:
> Thanks. Yes, I did that on a toy data set and with my real data.
Thanks. Yes, I did that on a toy data set and with my real data. It *seems* to
have worked. I just work with grep so rarely that I didn't want to miss
something.
-Original Message-
From: Erik Iverson [mailto:er...@ccbr.umn.edu]
Sent: Thursday, July 15, 2010 5:36 PM
To: Doran, Harold
Cc
I'm completely new to R, and I'd like to do something like this:
> x=c(1,2,3)
> plot(x,x)
At this point, R creates a file "Rplots.pdf", since the default device is
PDF and the default filename is "Rplots.pdf". I know I can set the default
device like this:
> options(device="png")
B
I would change that first dataOnly in
by(...) or lapply(...) to dataOnly[,-3].
In fact, if the dataframe mydata is suitably
subset, then, because of the as.matrix() in
function(x), both the by() and lapply() methods
will work fine with mydata.
-Peter Ehlers
On 2010-07-15 15:42, Phil Spector w
These data represent stream channel cross-sectional surveys. I would
like to be able to find the measurement on the tape (measure) where
the Bank Full Depth (bkf_depths) is 0. This will happen twice because
the channel has two sides. I thought fitting a loess line to these
data and then predicti
On 2010-07-15 15:15, Ralf B wrote:
Hi all,
I wonder why KLdiv does not work with data.frames:
Because it's not designed that way?
(I assume that you mean KLdiv() in pkg:flexmix.)
Check the help page. It's pretty clear about what input
is wanted: a matrix object or a flexmix object (or FLXMC
o
Hi there,
I am fairly new to R and I have been trying to figure out how to separate a
column of substrate data that I have into separate parts using R.
An example of my data looks like this is:
gmtTime Classification ClassValue Species Count
1449 Sand30
14
Ted,
Based upon your code below, you might be better off using two lapply()
constructs to create the x and y results separately, taking advantage of
lapply()'s built-in ability to create lists 'on the fly', while returning a
NULL when the function will not be applied to the data based upon your
Hi there
I am setting up a FreeBSD server for my research department at university,
and one of my teachers needs specifically R modules like tm, RWeka, rJava
and the like.
I have installed FreeBSD 8.0/i386 and applied the relevant security patches
as well as the native FreeBSD JDK 1.6 with its la
Dear David,
you can use Gin:
\setkeys{Gin}{width=0.5\linewidth}
just before the chunk that actually produces the figure.
and, cool, I hadn't realized, that
<>=
print (
<>
)
@
works.
with {} inside the print there can be even more than one statement in
the chunk-with-lattice-functi
Jannis,
You are right, it does not seem to matter. When the R string contains
two \\, xtable prints it as only one \. I should have looked into the
Latex output before posting!
'\\' is just _one_ character in R:
> nchar ("\\")
[1] 1
Just like '\n' etc.
It is just the `print`ed (as opposed
Ralf -
If you want to use by(), I think it should look like
this:
by(dataOnly,dataOnly[,3],function(x)KLdiv(as.matrix(x)))
But you might find the following more useful:
lapply(split(as.data.frame(dataOnly),dataOnly[,3]),
function(x)KLdiv(as.matrix(x)))
since it returns its re
Doran, Harold wrote:
Thanks. Yes, I did that on a toy data set and with my real data. It
*seems* to have worked. I just work with grep so rarely that I didn't
want to miss something.
Yes, I see no reason why it won't work. You can do another check
'manually'. You know how many of each you e
Doran, Harold wrote:
I just need to confirm something with pattern matching folks. I have
a factor with the following levels in a very large data set:
levels(all$Classical.Statistic)
[1] """AB;ABD"
"CollapsedSteps" "CR_P""CR_Prop;CR_P;AB"
Thanks Marc
Part of the challenge here is that EVERYTHING is dynamic. New data is being
added to the DB all the time Each active ID makes a new sample very day or
at a minimum every week, and new IDs are added every week. So I can't hard
code anything. If, for a given ID, I had 50 weekly sampl
I just need to confirm something with pattern matching folks. I have a factor
with the following levels in a very large data set:
> levels(all$Classical.Statistic)
[1] """AB;ABD" "CollapsedSteps"
"CR_P""CR_Prop;CR_P;AB"
[6]
I have wondered about this too. The approach I use isn't pretty but does
have a couple of advantages - there is only one set of code to run and I
have control over the figure size.
The first part of the code below is what is shown in the document (but not
run), and the second part actually run
Chester,
You may unsubscribe yourself here:
https://stat.ethz.ch/mailman/listinfo/r-help. A google search would
have found this information for you.
hth,
Stephen Sefick
On Thu, Jul 15, 2010 at 3:37 PM, Chester Kam wrote:
> Dear R-help team,
>
> Could you please remove my e-mail (chester_...@yah
I am using the coxph, survfit and summary.survfit functions to calculate an
estimate of predicted survival with confidence interval for future patients
based on the survival distribution of an existing cohort of subjects. I am
trying to understand the calculation and interpretation of the std.
On Jul 15, 2010, at 11:27 AM, AndrewPage wrote:
>
> Actually I have one more question that's somewhat related-- I'm starting out
> by importing a .txt file that isn't divided into vectors and is at times
> inconsistent with regards to spacing, indents, etc., so I can't rely on
> those. It looks
Hi all,
I wonder why KLdiv does not work with data.frames:
n <- 50
mydata <- data.frame(
sequence=c(1:n),
data1=c(rnorm(n)),
data2=c(rnorm(n))
)
# does NOT work
KLdiv(mydata)
# works fine
dataOnly <- cbind(mydata$data1, mydata$data2, mydata$group)
KLdiv(dataOnly)
Any ide
I am performing some analysis over a large data frame and would like
to conduct repeated analysis over grouped-up subsets. How can I do
that?
Here some example code for clarification:
require("flexmix") # for Kullback-Leibler divergence
n <- 23
groups <- c(1,2,3)
mydata <- data.frame(
Dear Michael,
I know this situation from writing vignettes and I usually cheat a bit
I redefine the functions along these lines:
plotmap <- function (...) print (hyperSpec:::plotmap (...))
(plotmap is a lattice-function for hyperSpec objects)
plotmap can tehn be used without the print in t
The X axis on the plot now starts from 2008.0; Since the data starts
from January 2008, can I make it 2008.1, and also show 2009.12 on the
axis?
Thanks.
Linda
On Wed, Jul 14, 2010 at 9:49 AM, Achim Zeileis wrote:
> You do not provide a reproducible example, as the posting guide asks you to.
> But
Hi:
I sincerely hope there's an easier way, but one method to get this is as
follows,
with d as the data frame name of your test data:
d <- d[order(with(d, Age, School, rev(Grade))), ]
d$Count <- do.call(c, mapply(seq, 1, as.vector(t(with(d, table(Age,
School))
d
> d
ID Age School Grade Co
On 15/07/2010 4:51 PM, Michael Friendly wrote:
In a paper I'm writing using Sweave, I make use of lattice graphics, but
don't want to explicitly show (or explain)
in the article text the print() wrapper I need in code chunks for the
graphs to appear.
I can solve this by including each chunk twi
I don't know how to reparameterise the model. will you please give the detail
for reparameterisation and delta method?
Thanks
--- On Tue, 7/13/10, Rubén Roa wrote:
From: Rubén Roa
Subject: RE: [R] ed50
To: "Dipa Hari" , r-help@r-project.org
Date: Tuesday, July 13, 2010, 6:27 AM
> -Men
Chester,
Please manage your subscription at https://stat.ethz.ch/mailman/listinfo/r-help
Cheers,
Corey
* Sent from my BlackBerry handheld device
-Original Message-
From: Chester Kam
Sender:
Date: Thu, 15 Jul 2010 13:37:37
To:
Subject: [R] Could you remove me from the mailing list
Ted,
I may not be completely clear on how you have your processes implemented, but
some thoughts:
If you will be creating multiple lists initially, where each list (say z1...z4)
contains 1 or more data frames and all of the data frames have the same column
structure, you can use:
do.call(rb
On Thu, Jul 15, 2010 at 4:21 PM, Dennis Murphy wrote:
> Hi:
>
> Tal was on the right track, but the function in package zoo that applies
> here is rollapply():
>
> library(zoo)
> m<-matrix(seq(1,80),ncol=20, nrow=4)
> t(apply(m, 1, function(x) rollapply(zoo(x), width = 5, FUN = mean, by = 5)))
>
In a paper I'm writing using Sweave, I make use of lattice graphics, but
don't want to explicitly show (or explain)
in the article text the print() wrapper I need in code chunks for the
graphs to appear.
I can solve this by including each chunk twice, with different options,
as in
<>=
library
Dear R-help team,
Could you please remove my e-mail (chester_...@yahoo.com) from the mailing
list?
Thanks so much!
Chester
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-hel
The data set for "combined" is pretty huge, but a few columns looks like
this, so just picture it with 187 columns:
dw_area vdw_vol vsa_acc vsa_acid vsa_base vsa_donvsa_hyd
1 0.8322680 0.93714800 -0.478551 -0.2791860 -0.724420 1.4647400
2 1.8746300 1.2639 0.23148
Hi:
Tal was on the right track, but the function in package zoo that applies
here is rollapply():
library(zoo)
m<-matrix(seq(1,80),ncol=20, nrow=4)
t(apply(m, 1, function(x) rollapply(zoo(x), width = 5, FUN = mean, by = 5)))
[,1] [,2] [,3] [,4]
[1,]9 29 49 69
[2,] 10 30 50
It's high time for a small, reproducible example. Don't say, "for
example", *give* us an example in R.
That being said, something like
combined[!names(combined) %in% names(miceSample)]
might be a start...
Addi Wei wrote:
But "miceSample" has multiple columns... For example if nvars=4, I ha
On 07/15/2010 07:59 AM, Claus Dethlefsen / Region Nordjylland wrote:
Dear List
My question relates to the rms (or Design) package. I have modified
the example from help(Glm) to include an offset argument. It works
with "glm" but "Glm" gives the error
Error in if (!length(fname) || !any(fname ==
But "miceSample" has multiple columns... For example if nvars=4, I have 4
columns of data to delete from "combined".
Specifically, I have 187 columns in "combined", and "miceSample" only has 4
columns. So the new data frame should have 183 columns.
--
View this message in context:
http://r
Yes, this behavior is new in 2.11.x. From the NEWS file:
o write.csv[2] no longer allow 'append' to be changed: as ever,
direct calls to write.table() give more flexibility as well as
more room for error.
HTH,
Marc
On Jul 15, 2010, at 3:01 PM, Jonathan Christensen wrote:
Thanks Marc
The next part of the question, though, involves the fact that there is a new
'z' list made in almost every iteration through the ID loop.
I guess there are two parts to the question. First, how would I make a list
containing all the data frames created by a call to rbind? I assume,
Never mind, I found the answer to my own question. From the 2.11.0 change
log:
owrite.csv[2] no longer allow 'append' to be changed: as ever,
direct calls to write.table() give more flexibility as well as
more room for error.
Jonathan
On Thu, Jul 15, 2010 at 2:01 PM, Jonathan Ch
Hello everybody,
I write my bachelor-work in statistic about "Methods of nonlinear prediction in
time series". I will apply the local linear point forecast (from Yao and Tong
(1994a): Nonparametric method with the kernel function). I couldn`t find a
appropriate package for this method. Have somebo
Dear Gabor Csardi,
Thanks. The problem is now resolved.
> No wonder, writing computer programs is not just typing in random words
> and let the computer figure
> out what you are trying to do. At least not yet.
Apart from typo errors like "wri" before "write..." and "lecompose" instead
of "d
Actually I have one more question that's somewhat related-- I'm starting out
by importing a .txt file that isn't divided into vectors and is at times
inconsistent with regards to spacing, indents, etc., so I can't rely on
those. It looks something like this:
"Drink=Coffee:Location=Office:Time=M
Out of curiosity, is this a change in 2.11? I'm still runnning 2.10.1,
?write.csv mentions the other options being ignored, but not append. This
might also explain why John Kane believes he has successfully used append
with write.csv in that past.
Jonathan
On Thu, Jul 15, 2010 at 9:36 AM, Marc S
Question from an [R] novice...
Hi,
I have a vector of date/times like the one shown below (a truncated
sample of a much longer list...)
> dates[1:4]
[1] "2006-03-16 08:41:00" "2006-03-16 10:28:00" "2006-03-16 11:03:00"
[4] "2006-03-16 11:04:00"
I would like to generate a weekday histogram showing
Hello there
how can i calculate coefficient of determination with R?
Kind regards
Ali Reza Ehsani
Ph.d. student
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do
Thanks! That's much less complicated and does everything I wanted it to do.
--
View this message in context:
http://r.789695.n4.nabble.com/Search-and-extract-string-function-tp2290268p2290356.html
Sent from the R help mailing list archive at Nabble.com.
Use write.table() instead.
I thought that I had used write.csv() with an append before but I cannot find
an example. Perhaps append= is not available in write.csv
--- On Thu, 7/15/10, Cliff Clive wrote:
> From: Cliff Clive
> Subject: [R] write.csv() : attempt to set 'append' ignored... Wh
On Jul 15, 2010, at 2:37 PM, Addi Wei wrote:
>
> e.g. I have a big data set called "combined", and then a small sample of
> "combined" called "miceSample". I wish to delete "miceSample" from
> "combined" to create a new smaller data set and store it into a new object.
>
> combined <- rbind(sca
e.g. I have a big data set called "combined", and then a small sample of
"combined" called "miceSample". I wish to delete "miceSample" from
"combined" to create a new smaller data set and store it into a new object.
combined <- rbind(scaleMiceTrain, scaleMiceTest)
miceSample <- sample(combined[
On Jul 15, 2010, at 2:18 PM, Ted Byers wrote:
> The data.frame is constructed by one of the following functions:
>
> funweek <- function(df)
> if (length(df$elapsed_time) > 5) {
>rv = fitdist(df$elapsed_time,"exp")
>rv$year = df$sale_year[1]
>rv$sample = df$sale_week[1]
>rv$granu
The data.frame is constructed by one of the following functions:
funweek <- function(df)
if (length(df$elapsed_time) > 5) {
rv = fitdist(df$elapsed_time,"exp")
rv$year = df$sale_year[1]
rv$sample = df$sale_week[1]
rv$granularity = "week"
rv
}
funmonth <- function(df)
if (
Thanks all! That did it.
On Thu, Jul 15, 2010 at 11:07 AM, Nikhil Kaza wrote:
> Building on Erik's solution and because it would easier to do date
> arithmetic..
>
> d1 <- as.character(date)
> d1 <- ifelse(nchar(d1)<4, paste(0,d1,sep=""),d1)
> d2 <- as.Date(date, "%m%d")
>
>
> On Jul 15, 2010, a
Building on Erik's solution and because it would easier to do date
arithmetic..
d1 <- as.character(date)
d1 <- ifelse(nchar(d1)<4, paste(0,d1,sep=""),d1)
d2 <- as.Date(date, "%m%d")
On Jul 15, 2010, at 1:21 PM, btc1 wrote:
Hello, I have a vector, "dates", as a series of 3 digit elements,
Try this:
gsub("^(.)", "\\1/", dates)
On Thu, Jul 15, 2010 at 2:21 PM, btc1 wrote:
>
> Hello, I have a vector, "dates", as a series of 3 digit elements, i.e. >
> date
> [1] 528 528 528 528 528 528 528 528 528 528 528 528 708 708 708 708 708
> 708
> [19] 708 708 708 708 529 529 529 529 529 5
gsub("(.*)(.{2})","\\1/\\2",dates)
-
A R learner.
--
View this message in context:
http://r.789695.n4.nabble.com/Cut-a-within-elements-by-length-not-value-of-vectors-tp2290440p2290471.html
Sent from the R help mailing list archive at Nabble.com.
louisey wrote:
Hello everyone!!
I have written a function in R and need to call it more than once say M
times then take an average of my output. How would I tell R to automatically
call my function many times instead of just the once?
The natural way will depend on what you're trying to do
btc1 wrote:
Hello, I have a vector, "dates", as a series of 3 digit elements, i.e. > date
[1] 528 528 528 528 528 528 528 528 528 528 528 528 708 708 708 708 708
708
[19] 708 708 708 708 529 529 529 529 529 529 529 529 529 529 529 529 529
529
[37] 529 624
I need to convert them into julian
Hello everyone!!
I have written a function in R and need to call it more than once say M
times then take an average of my output. How would I tell R to automatically
call my function many times instead of just the once?
Thanks! xxx
--
View this message in context:
http://r.789695.n4.nabble.c
Hi,
Is this what you are looking for?
a = c(528,528,528,528,708,708,529,1208,423,1506,321)
paste(substr(a,1,nchar(a)-2),substr(a,nchar(a)-1,nchar(a)),sep="/")
[1] "5/28" "5/28" "5/28" "5/28" "7/08" "7/08" "5/29" "12/08"
"4/23" "15/06" "3/21"
Martyn
-Original Message-
From: r-h
Hello, I have a vector, "dates", as a series of 3 digit elements, i.e. > date
[1] 528 528 528 528 528 528 528 528 528 528 528 528 708 708 708 708 708
708
[19] 708 708 708 708 529 529 529 529 529 529 529 529 529 529 529 529 529
529
[37] 529 624
I need to convert them into julian, but have to i
Thanks Jun and Phil!
On Thu, Jul 15, 2010 at 12:16 PM, Phil Spector
wrote:
> Juliet -
> Since you're operating on each column, apply() would
> be the appropriate function;
>
> mymat = apply(mymat,2,function(x){x[x<0] = min(x[x>0]);x})
>
>
> - Phil Spector
On 15/07/2010 12:11 PM, David Bickel wrote:
Sage and Marc, thank you for your helpful replies.
Since RLink enables R calls from Mathematica, I wonder if it would make
the Mathematica "Front End" useful for organizing R work even if no
Mathematica functions are needed. It would be nice R had so
David Bickel wrote:
Sage and Marc, thank you for your helpful replies.
Since RLink enables R calls from Mathematica, I wonder if it would make
the Mathematica "Front End" useful for organizing R work even if no
Mathematica functions are needed. It would be nice R had something like
the "Fro
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Hadley Wickham
Sent: Thursday, July 15, 2010 12:15 AM
To: Yves Rosseel
Cc: r-help@r-project.org; richard_rauber...@merck.com
Subject: Re: [R] [R-pkgs] New package "list" for analyzing
l
If you only want a count, please try table
text <- "ID Age School Grade
1 10 1 98
2 10 2 97
3 10 1 92
4 11 1 90
5 11 1 80
6 11 2 70
7 10 1 80
8 10 1 79
9 11 2 70"
df <- read.table(textConnection(text),header=T)
table(df[,2:3])
If you want sort the data, try order.
-
A R learner.
--
View t
Juliet -
Since you're operating on each column, apply() would
be the appropriate function;
mymat = apply(mymat,2,function(x){x[x<0] = min(x[x>0]);x})
- Phil Spector
Statistical Computing Facility
Dear Jonathan,
Thanks a lot for your help! That works pretty well!
Best wishes,
Wei
On 7/15/10 5:52 PM, Jonathan Flowers wrote:
> Hi,
>
> What if you create two data frames, then merge them by gene id.
>
> If your data is in a data frame called "dframe"...
>
> df1 <- subset(dframe,select=c("id2c
Sage and Marc, thank you for your helpful replies.
Since RLink enables R calls from Mathematica, I wonder if it would make
the Mathematica "Front End" useful for organizing R work even if no
Mathematica functions are needed. It would be nice R had something like
the "Front End," a GUI that ena
On 07/15/2010 05:07 AM, Peter Dalgaard wrote:
paul s wrote:
On 07/14/2010 06:15 PM, Peter Dalgaard wrote:
A quick calculation reveals that a matrix of that size requires about
2.7 TERAbytes of storage, so I'm a bit confused as to how you might
expect to fit it into 16GB of RAM...
However, eve
Hi, Juliet,
Something like this?
mymat[mymat<0]<-min(mymat[mymat>0])
Jun
On Thu, Jul 15, 2010 at 10:55 AM, Juliet Hannah wrote:
> Hi Group,
>
> I have a matrix, and I would like to replace numbers less than 0 by
> the smallest minimum number. Below is an
> small matrix, and the loop I used. I
Hi Group,
I have a matrix, and I would like to replace numbers less than 0 by
the smallest minimum number. Below is an
small matrix, and the loop I used. I would like to get suggestions on
the "R way" to do this.
Thanks,
Juliet
# example data set
mymat <- structure(c(-0.503183609420937, 0.1790
Hi,
What if you create two data frames, then merge them by gene id.
If your data is in a data frame called "dframe"...
df1 <- subset(dframe,select=c("id2c","2c"))
df2 <- subset(dframe,select=c("id1c","1c"))
merged <- merge(df1,df2,by.x="id2c",by.y="id1c",all=TRUE)
plot(merged$1c,merged$2c)
Ch
On Thu, Jul 15, 2010 at 10:48 AM, AndrewPage wrote:
>
> Hi all,
>
> I'm trying to write a function that will search and extract from a long
> character string, but with a twist: I want to use the characters before and
> the characters after what I want to extract as reference points. For
> exampl
On Jul 15, 2010, at 9:48 AM, AndrewPage wrote:
>
> Hi all,
>
> I'm trying to write a function that will search and extract from a long
> character string, but with a twist: I want to use the characters before and
> the characters after what I want to extract as reference points. For
> example,
Hi Andy,
thanks for your reply and your further correction.
While the next release is not available I rewrite my code with your
suggestion in case it might help anyone.
###
library(randomForest)
set.seed(0)
## build data set in data frame
X <- rbind( matrix( runif
1 - 100 of 157 matches
Mail list logo