I am a new R user and am beginning to employ function creation in my
statistical work. I am running into a problem when I want to pass on a
character (text) to the function as an argument. I have a simple example below
to demonstrate this problem. I cannot seem to find a fix in my R book or
Thanks again. I guess I have been fitting in splus gui and in R Commander, not
really calling it myself. I was thinking maybe there was a way to define it as
a class or something.
I will have to look at segments. Any thoughts if this might be easy to use with
years on an axis?
From: Peter Ehle
Hello R list,
I'm looking to do some stepwise discriminant function analysis (DFA) based
on the minimization of Wilks' lambda in R to end up with a composite
signature (of metals "Al","Sb","Bi","Cr","Ba") capable of discriminating
100% of the source factors (LANDUSE: "A","B","C").
The Wilks' lamb
On Sat, Mar 12, 2011 at 10:02 AM, Graham Williams
wrote:
> On 12 March 2011 00:07, Xiaobo Gu wrote:
>> On Fri, Mar 11, 2011 at 2:55 AM, Graham Williams
>> wrote:
>>> Did you scroll down the window to see the rules?
>> OK, it takes a long time for rattle to show the rules, about 30
>> seconds, an
On Mar 11, 2011, at 3:00 PM, Jim Price wrote:
Thanks Peter.
This is true, but consider this continuation of my example (which is
probably what I should have written originally):
my.opts <- list(default.args = list(
as.table = TRUE,
bet
Thanks Mikhail. I've been doing something very similar to your example
below, I was just wondering if anyone had packaged functions for this
task.
Thanks again,
Ista
On Sat, Mar 12, 2011 at 12:39 AM, Mikhail Titov wrote:
> I'm not sure what you are trying to achieve, but I think this can be a goo
Just as a note, if you are going to convert a factor to numeric, the
preferred idiom is:
## hypothetical numeric factor
x <- factor(paste(10:15))
## preferred method for conversion
as.numeric(levels(x))[x]
Cheers,
Josh
__
R-help@r-project.org mailing
On 12 March 2011 00:07, Xiaobo Gu wrote:
> On Fri, Mar 11, 2011 at 2:55 AM, Graham Williams
> wrote:
>> Did you scroll down the window to see the rules?
> OK, it takes a long time for rattle to show the rules, about 30
> seconds, and why the message on the status bar is "the decision tree
> model
I'm not sure what you are trying to achieve, but I think this can be a good
starting point:
files <- list.files("deleteme", full.names=TRUE, recursive=TRUE)
names <- sapply(strsplit(files, "/", TRUE), "[", 2)
x <- lapply(files, function(f) {
out <- read.csv(f)
out$city <- strsplit(f, "/",
On 2011-03-11 14:43, jonbfish wrote:
Thanks for the response, sorry I didn't post it initially.
kt.mat<-
function(x,y,z){
for(i in 1:length(x)){for(j in
1:length(y)){z[i,j]<-(y[j]-y[i])/(x[j]-x[i])}}
return(z)}
kt.slope<-
function(x,y,z,s){
count<-0
for(i in 1:length(x)){for(j in 1:length(y)){
I wrote some code which reads a gzipped text file directly from the web with
gzcon(url()) and it works perfectly on OSX, but I cannot get it to work on
linux at all, trying several different R versions and linux distributions. Any
ideas?
Here's an example of my code:
z <-
gzcon(url("ftp://ftp-
Thanks Peter.
This is true, but consider this continuation of my example (which is
probably what I should have written originally):
my.opts <- list(default.args = list(
as.table = TRUE,
between = list(x = 0.2, y = 0.2),
Thanks for the response, sorry I didn't post it initially.
kt.mat <-
function(x,y,z){
for(i in 1:length(x)){for(j in
1:length(y)){z[i,j]<-(y[j]-y[i])/(x[j]-x[i])}}
return(z)}
kt.slope <-
function(x,y,z,s){
count<-0
for(i in 1:length(x)){for(j in 1:length(y)){
if(j >= i+1) {
count<-count+1
s[coun
On 2011-03-11 10:49, jonbfish wrote:
Also called Sen's slope estimate...
Could you provide some reproducible code?
I have no idea how you're plotting the lines.
Peter Ehlers
--
View this message in context:
http://r.789695.n4.nabble.com/Kendall-Theil-line-as-fit-tp3344617p3348823.html
Sent
Thanks Gabor. I owe you again.
Kind regards
Pete
--
View this message in context:
http://r.789695.n4.nabble.com/Reference-Lines-Using-Grid-Graphics-tp3349185p3349259.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.or
On Fri, Mar 11, 2011 at 4:50 PM, Pete Brecknock wrote:
> Hi
>
> I would like to be able to add reference lines to a series of plots that are
> built using the Grid graphics package. These lines should coincide with tick
> marks which are different on each plot.
>
> I can add the lines manually usi
It is easy to recover the date by using as.Date:
> dat <- matrix(seq(as.Date("2011-01-01"), as.Date("2011-01-09"), by="1 day"),
> 3)
> dat
[,1] [,2] [,3]
[1,] 14975 14978 14981
[2,] 14976 14979 14982
[3,] 14977 14980 14983
> str(dat)
num [1:3, 1:3] 14975 14976 14977 14978 14979 ...
> as.
Apologies
I forgot to include that the reference lines should be for the y axis only.
Thanks.
Pete
--
View this message in context:
http://r.789695.n4.nabble.com/Reference-Lines-Using-Grid-Graphics-tp3349185p3349206.html
Sent from the R help mailing list archive at Nabble.com.
__
On 2011-03-11 13:33, Jeff Newmiller wrote:
Thank you for indicating more precisely where the bug arises.
I disagree with the blanket assertion that the I() is not needed. The
example is purposely simplified to illustrate the problem, which lm has
no difficulty with but which plot.lm does. plot.l
I meant to say, but my fingers got ahead of my brain:
source(textConnection(readLines(yourFile)[10:20]))
On Fri, Mar 11, 2011 at 4:53 PM, jim holtman wrote:
> You can do:
>
> source(readLines(yourFile)[10:20]) # lines 10-20 of the file
>
> On Fri, Mar 11, 2011 at 4:41 PM, Paul Y. Peng wrote:
You can do:
source(readLines(yourFile)[10:20]) # lines 10-20 of the file
On Fri, Mar 11, 2011 at 4:41 PM, Paul Y. Peng wrote:
> I have a text file of R commands. Some times I only want to run a few lines
> of the R commands in an existing R session and wonder whether there is a
> simple way to
Hi
I would like to be able to add reference lines to a series of plots that are
built using the Grid graphics package. These lines should coincide with tick
marks which are different on each plot.
I can add the lines manually using the grid.lines() function but would like
to understand how to ge
On Fri, Mar 11, 2011 at 4:41 PM, Paul Y. Peng wrote:
> I have a text file of R commands. Some times I only want to run a few lines
> of the R commands in an existing R session and wonder whether there is a
> simple way to do this.
>
> To run a few lines in a new session of R, I could use sed to pi
I have a text file of R commands. Some times I only want to run a few lines
of the R commands in an existing R session and wonder whether there is a
simple way to do this.
To run a few lines in a new session of R, I could use sed to pick up the
lines from the file and pipe them into R.
source() d
On Mar 11, 2011, at 20:31 , David Winsemius wrote:
>
> Are you sure you need I() on the LHS? The I function is designed to avoid the
> confusion related to the dual use of the arithmetic operator symbols
> affecting the construction of the model matrix, but I don't think that
> applies to th
Thank you for indicating more precisely where the bug arises.
I disagree with the blanket assertion that the I() is not needed. The example
is purposely simplified to illustrate the problem, which lm has no difficulty
with but which plot.lm does. plot.lm manages to deal with I() on the right
si
On Fri, Mar 11, 2011 at 4:15 PM, Bogaso Christofer
wrote:
> Dear all, when I put date objects (class of 'Date') in a matrix it becomes
> numeric:
>
>> dat <- matrix(seq(as.Date("2011-01-01"), as.Date("2011-01-09"), by="1
> day"), 3)
>
>> dat
>
> [,1] [,2] [,3]
>
> [1,] 14975 14978 14981
>
>
It will be difficult or impossible to store objects of
class Date in a matrix -- you'll need to store them
in a data frame:
pts = seq(as.Date("2011-01-01"), as.Date("2011-01-09"), by="1 day")
z = data.frame(pts[1:3],pts[4:6],pts[7:9])
z
pts.1.3. pts.4.6. pts.7.9.
1 2011-01-01 2011-01-04
Haakon,
as replicates imply that they all have the same data type, you can put
them into a matrix which is often faster and needs less memory (though
whether that can really matter depends of the number of replicates you
have: for small no of replicates you won't have much effect anyways).
Bu
On 2011-03-11 11:31, David Winsemius wrote:
On Mar 11, 2011, at 2:06 PM, Jeff Newmiller wrote:
> I am encountering an error with plot.lm:
>
>> tstdf<- data.frame( y=c(1.01,1.98,3.02,3.99),x=c(1,2,3,4))
>> plot(lm(I(y) ~ x, data=tstdf))
> Hit to see next plot:
> Hit to see next plot:
>
Dear all, when I put date objects (class of 'Date') in a matrix it becomes
numeric:
> dat <- matrix(seq(as.Date("2011-01-01"), as.Date("2011-01-09"), by="1
day"), 3)
> dat
[,1] [,2] [,3]
[1,] 14975 14978 14981
[2,] 14976 14979 14982
[3,] 14977 14980 14983
> class(dat[1,1])
[1] "nume
To get the equivalent of what your loop does, you could use
lapply(data[,3:5],function(x)x/ave(x,data$plateNo,FUN=mean))
but you might find the output of
sapply(data[,3:5],function(x)x/ave(x,data$plateNo,FUN=mean))
to be more useful.
- Phil Spector
Belay that. I misread the post.
On 11-Mar-11, at 12:09 PM, Don McKenzie wrote:
?pacf
On 11-Mar-11, at 9:42 AM, Kevin Boggs wrote:
Does anyone know of any R code for computing partial cross-
correlation? I have examples of cross correlation functions
(ccfs) that are not smooth but rather
?pacf
On 11-Mar-11, at 9:42 AM, Kevin Boggs wrote:
Does anyone know of any R code for computing partial cross-
correlation? I have examples of cross correlation functions (ccfs)
that are not smooth but rather consist of a peak of several high
values in consecutive lags, with sharp drops on
Also called Sen's slope estimate...
--
View this message in context:
http://r.789695.n4.nabble.com/Kendall-Theil-line-as-fit-tp3344617p3348823.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://st
Does anyone know of any R code for computing partial cross-correlation? I have
examples of cross correlation functions (ccfs) that are not smooth but rather
consist of a peak of several high values in consecutive lags, with sharp drops
on either side. This indicates that y(t) is a function of
Hello all,
I'm new to R and trying to figure out how to perform calculations on a large
dataset (300 000 datapoints). I have already made some code to do this but it
is awfully slow. What I want to do is add a new column for each "rep_ " column
where I have taken each value and divide it by t
Hi,
this sounds like a standard problem in Computational Geometry - I guess
game developers have to deal with something like this all the time. You
may want to look at a textbook or two.
An article with the promising title "On fast computation of distance
between line segments" can be found
Perfect, thanks Josh!
Cheers,
A
2011/3/10 Joshua Wiley
> Dear Aaron,
>
> The problem is not with your function, but using apply(). Look at the
> "Details" section of ?apply You will see that if the data is not an
> array or matrix, apply will coerce it to one (or try). Now go over to
> the "
I think I need to retract the part about 3 iterations... not true if, e.g.,
the segments intersect and the angle is small.
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of rex.dw...@syngenta.com
Sent: Friday, March 11, 2011 2:37 PM
I like Thomas's idea as a quick practical solution. Here is one more little
variation just in case you really do have millions of these distances. Pick
point P1 on line segment L1 (e.g., an endpoint). Pick 101 evenly spaced points
on line segment L2. Find the nearest to P1 and call it P2. N
On Mar 11, 2011, at 2:06 PM, Jeff Newmiller wrote:
I am encountering an error with plot.lm:
tstdf <- data.frame( y=c(1.01,1.98,3.02,3.99),x=c(1,2,3,4))
plot(lm(I(y) ~ x, data=tstdf))
Hit to see next plot:
Hit to see next plot:
Error in object$coefficients : $ operator is invalid for atomic
On 2011-03-10 15:07, Jim Price wrote:
Hi,
I'm currently designing some global themes for use with lattice, and have
hit a snag. There doesn't appear to be (in xyplot at least) a way of setting
a lattice option for the 'scales' parameter at a global level - changes have
to be made in each functio
I am encountering an error with plot.lm:
tstdf <- data.frame( y=c(1.01,1.98,3.02,3.99),x=c(1,2,3,4))
plot(lm(I(y) ~ x, data=tstdf))
Hit to see next plot:
Hit to see next plot:
Error in object$coefficients : $ operator is invalid for atomic vectors
Obviously I don't need the I() in this examp
Thanks a lot, David!
Exactly what I was looking for!
Dimitri
On Fri, Mar 11, 2011 at 1:46 PM, David Winsemius wrote:
>
> On Mar 11, 2011, at 1:26 PM, Dimitri Liakhovitski wrote:
>
>> Hello!
>>
>> The code below works and does what I need it to do.
>> However, I think the way I create myframe (las
On Mar 11, 2011, at 1:26 PM, Dimitri Liakhovitski wrote:
Hello!
The code below works and does what I need it to do.
However, I think the way I create myframe (last step) is very
un-R-like and probably not very efficient. I am sure there are better,
more R-appropriate methods.
Any pointers?
Tha
Hello!
The code below works and does what I need it to do.
However, I think the way I create myframe (last step) is very
un-R-like and probably not very efficient. I am sure there are better,
more R-appropriate methods.
Any pointers?
Thanks a lot!
Dimitri
# Step 1: Creating a vector of dates:
myd
Thanks Henrik, that is exactly what I was hoping for!
Best,
Ista
On Fri, Mar 11, 2011 at 1:02 PM, Henrik Bengtsson wrote:
> Hi,
>
> the R.filesets package was designed for this. It is heavily used by
> the aroma framework (http://www.aroma-project.org/), so it got a fair
> bit of mileage now (i
Hi,
the R.filesets package was designed for this. It is heavily used by
the aroma framework (http://www.aroma-project.org/), so it got a fair
bit of mileage now (in a good a way). Here is how you could setup
your data set and work with the data.
# - - - - - - - - - - - -
# Setup file data set
Thanks. This is a bug, the source code made an implicit assumption that there
would always be at least one smooth, when creating the gam object after
fitting. Fixed for the next release (1.7-5). For now, you could use glmmPQL
from the MASS library to get an equivalent fit when there are no smoot
Hi Andreas,
if your factor is named "x", you can do
as.numeric(as.character(x))
Best,
Ista
On Fri, Mar 11, 2011 at 10:45 AM, Andreas Emanuelsson
wrote:
> Hi, I have tried to load a file originally from Excel, via csv, text and
> clipboard today.
>
> When I succeed I cannot change the format from
You can only return a single object. You might want to create a list
if you have multiple objects:
return(list(output_avg_mc, output_stdev_mc))
On Fri, Mar 11, 2011 at 10:51 AM, Vincy Pyne wrote:
> Dear R helpers
>
> I have following data.frame and for each product_name, I have associated mean
Hi Andreas,
Assuming you are using read.table(), try setting the argument:
stringsAsFactors = FALSE
Also consider what about the Excel file is making R default to a
factor rather than numerical? There may be a nonstandard
reprsentation of missing data (e.g., "."), which could also be
specified t
Hi helpeRs,
I have inherited a set of data files that use the file system as a
sort of poor man's database, i.e., the data files are nested in
directories that indicate which city they come from. For example:
dir.create("deleteme")
for(i in paste("deleteme", c("New York", "Los Angeles"), sep="/")
If you are using 'read.csv', add the parameteras.is=TRUE to
prevent conversion to factors.
If you have factors that are supposed to be numeric, use the following
df$mydata <- as.numeric(as.character(df$mydata))
On Fri, Mar 11, 2011 at 10:45 AM, Andreas Emanuelsson
wrote:
> Hi, I have trie
Thank you Philipp, it is very useful! How come I haven't figured it out
myself I dont know...
Have a pleasant weekend!
Laszlo
--
View this message in context:
http://r.789695.n4.nabble.com/creating-additional-column-tp3341224p3348552.html
Sent from the R help mailing list archive at Nabble.com.
Hi,
I think, what you want is assign().
for (i in 1:6) assign(paste("df", i, sep="."), split(df,df$a)[[i]])
But using lists is usually a better solution since you can work with
them using functions such as lapply().
First, you don't need cbind() to create your data.frame:
df2 <- data.frame(a,
Hi Rainer
Or maybe you are referring to the outer function.
I'm a newbie in R, but I recently read something about it in the pdf book named
below (pages 91-2). I send to you an excerpt:
An introduction to R
An introduction to R
Longhow Lam
6.2.5 The outer function
outer function
Th
I have found the various "tz" arguments not to provide the support I would like
in terms of arbitrary timezones. For now I use Sys.setenv(TZ="timezone_spec")
prior to input or output, and do not use the tz arguments.
In your case, I would consider keeping a character copy of the input to write
Hi, I have tried to load a file originally from Excel, via csv, text and
clipboard today.
When I succeed I cannot change the format from "factor", and when I try to
convert it to numerical it only gives the position of the "factor-group", not
the real value in the column?
Any quick suggestions
On Mar 11, 2011, at 10:49 AM, Bodnar Laszlo EB_HU wrote:
Dear R-community,
I'd like to ask you a question concerning R again. I try to keep
this simple because I am not willing to confuse you at all.
I have a little data frame which I have created the following way:
a <-c(1,1,1,1,1,2,2,2,
On Mar 10, 2011, at 05:49 , Tyler Rinker wrote:
>
> My Question: What do I need to do to correct the three error codes R gives
> me and make the function run correctly?
>
> This is the session, code and R's error message when supplied with data:
>> rm(list=ls())
>> dat1<-read.table("dat1.csv
Dear R helpers
I have following data.frame and for each product_name, I have associated mean
and standard deviation. I need to generate 1000 random no.s for each of these
products and find the respective mean and standard deviation.
My R code is as follows.
library(plyr)
library(reshape2)
Dear R-community,
I'd like to ask you a question concerning R again. I try to keep this simple
because I am not willing to confuse you at all.
I have a little data frame which I have created the following way:
a <-c(1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6)
b
<-c(1,2,3,4,5,6
Dear R-community,
I'd like to ask you a question concerning R again. I try to keep this simple
because I am not willing to confuse you at all.
I have a little data frame which I have created the following way:
a <-c(1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6)
b
<-c(1,2,3,4,5,6
Dear all,
I have installed R-2.12.2 version on a Suse OS. I am trying to install the
Cairo package on R but I got this error message:
installing to /dades/R-2.12.2/lib64/R/library/Cairo/libs
** R
** preparing package for lazy loading
** help
*** installing help indices
** building pac
On 2011-03-11 01:07, Ivan Calandra wrote:
Hi,
From ?"$", you can see that using [[ instead would do what you're
looking for. You should read and try to understand the whole help file.
The reason is that for [[ the default is exact=TRUE, wheareas for $ the
only possible value is exact=FALSE, wh
On Wed, Mar 9, 2011 at 12:14 PM, Ralph Olsson
wrote:
> Hello,
>
> I work for a company in which a number of employees use R. Many of them like
> to run executables via the system function in such a way that the output of
> that executable is displayed in a separate window. To give an example of
Hi,
Thanks for taking the time to respond.
After further investigation I suspect the "invisible=FALSE" has nothing to do
with the problem we're having. It may also be a different issue to the one Jim
has seen.
Jim describes the command window flashing up and disappearing. We saw this in R
2.1
Is the L1 norm not equivalent to quantile regression for the 0.5th
quantile?
If so, quantreg would do it using rq with the defult value for tau.
S Ellison
>>> Wilhelm Caspary 11/03/2011 12:31 >>>
Hi,
I have been looking through all packages but I cannot find a routine
for
LAD-regression (L1-no
On Mar 11, 2011, at 9:23 AM, Daniel Nüst wrote:
2011/3/11 David Winsemius :
On Mar 11, 2011, at 8:54 AM, Daniel Nüst wrote:
Let me rephrase my question: How can I create a time object from the
character string "1995-05-25T15:30:00-10:00" and get exactly the
same
character string again whe
Rainer,
The are probably lots of ways, I'd use
levels(interaction(c("a", "b"), c('x', 'y'), sep=''))
Dave
>Hi
>
>I know there is a function - I have used it before - but I always forget
>what it is called...
>
>I need the combination of two character vectors, i.e:
>
>x <- c("a", "b")
>y <- c
2011/3/11 David Winsemius :
>
> On Mar 11, 2011, at 8:54 AM, Daniel Nüst wrote:
>> Let me rephrase my question: How can I create a time object from the
>> character string "1995-05-25T15:30:00-10:00" and get exactly the same
>> character string again when formatting it/printing it?
>
>> x <- as.POS
Update: I ran the following commands on a Linux machine:
> sessionInfo()
R version 2.12.1 (2010-12-16)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=de_DE.utf8 LC_NUMERIC=C
[3] LC_TIME=de_DE.utf8 LC_COLLATE=de_DE.utf8
[5] LC_MONETARY=de_DE.utf8 LC_MESSAGE
On Mar 11, 2011, at 7:31 AM, Wilhelm Caspary wrote:
Hi,
I have been looking through all packages but I cannot find a routine
for LAD-regression (L1-norm-regression).
Is there none?
(In addition to the pkg::sos search results the help archives can also
be reviewed.)
http://search.r-proj
Thanks so much for the help! Sorry about not finding that info in the help.
I must have overlooked it. My apologies.
--
View this message in context:
http://r.789695.n4.nabble.com/Library-in-R-2-12-2-for-windows-tp3347351p3348218.html
Sent from the R help mailing list archive at Nabble.com.
_
On Mar 11, 2011, at 8:54 AM, Daniel Nüst wrote:
2011/3/11 David Winsemius :
On Mar 10, 2011, at 8:46 PM, David Winsemius wrote:
On Mar 10, 2011, at 11:17 AM, Daniel Nüst wrote:
I try to parse a time stamp with time zone. I essentially just
want to
parse the time stamp "1995-05-25T15:30:00+1
Willi, try this:
install.packages("sos")
library("sos")
findFn("L1 norm regression")
I find 34 hits but you'd have to look them over to see if any of them
are the sort of thing you want.
HTH, Bryan
Prof. Bryan Hanson
Dept of Chemistry & Biochemistry
DePauw University
602 S.
On Mar 11, 2011, at 8:41 AM, Benjamin Stier wrote:
Hi Francisco,
Thanks for your solution. It runs pretty fast compared to my for
loop. Here
is a comparison of system.time():
system.time(splitVals <- by(serv, dates, aggregateDf ))
user system elapsed
1.129 0.218 1.348
system.time(
2011/3/11 David Winsemius :
> On Mar 10, 2011, at 8:46 PM, David Winsemius wrote:
>> On Mar 10, 2011, at 11:17 AM, Daniel Nüst wrote:
>>> I try to parse a time stamp with time zone. I essentially just want to
>>> parse the time stamp "1995-05-25T15:30:00+10:00" and output it exactly
>>> like it is,
Hi,
I have been looking through all packages but I cannot find a routine for
LAD-regression (L1-norm-regression).
Is there none?
Willi
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide h
Hi Francisco,
Thanks for your solution. It runs pretty fast compared to my for loop. Here
is a comparison of system.time():
system.time(splitVals <- by(serv, dates, aggregateDf ))
user system elapsed
1.129 0.218 1.348
system.time(... my long for loop...)
user system elapsed
276.
I’m wondering which is the most efficient (time, than memory usage) way to
obtain a multivariate time series object from a data frame (the easiest data
structure to get data from a database trough RODBC).
I have a starting point using timeSeries or xts library (these libraries can
handle time zo
On Fri, Mar 11, 2011 at 2:55 AM, Graham Williams
wrote:
> Did you scroll down the window to see the rules?
OK, it takes a long time for rattle to show the rules, about 30
seconds, and why the message on the status bar is "the decision tree
model has been built. Time taken:0.01 secs", I have attach
Try this:
aggregate(. ~ sample, x[-2], FUN = mean)
On Fri, Mar 11, 2011 at 6:32 AM, Aline Santos wrote:
> Hello R-helpers:
>
> I have data like this:
>
> samplereplicateheightweightage
> A1.0012.00.646.00
> A2.0012.20.386.00
> A3.0012.4
Hi, I'm trying to plot the dates on the x-axis of a persp plot, but
cannot find a way of doing so. This is where I am at:
|x<- seq(-10, 10, length= 30)
x0<- as.Date("2000-01-01")
x.dates<- seq(x0,x0+length(x)-1,1)
y<- x
f<- function(x,y) { r<- sqrt(x^2+y^2); 10 * sin(r)/r}
z<- oute
Hi,
One liners in data.table are :
> x.dt[,lapply(.SD,mean),by=sample]
sample replicate heightweight age
[1,] A 2.0 12.2 0.503 6.00
[2,] B 1.5 12.75000 0.715 4.50
[3,] C 2.5 11.35250 0.5125000 3.75
[4,] D 2.0 14.9
Hi:
df <- read.table(textConnection("
VAR DATETIME CONC COVAR
1 NOV20.2510 group1
1 NOV20.5 20 group1
1 NOV21 5 group1
1 NOV22 1 group1
1 NOV23 0.1 group1
2 NOV20.2510
Try this:
newX <- rbind(unique(transform(x, TIME = 0, CONC = 0)), x)
newX[order(newX$VAR),]
On Fri, Mar 11, 2011 at 9:28 AM, wrote:
> Can someone help with a fairly simple task?
> I have a data set where I would like to insert a 0 time event between
> individuals:
>
> what I have:
>
> VAR D
On Mar 10, 2011, at 3:58 PM, shai uliel wrote:
Dear R helpers
I have a table and i need to make new table
table1:
sire snp1 snp2 snp3 snp4 snp5 snp6 snp7 snp8 snp9 snp10
snp11 snp12 snp13 snp14 snp15 8877 -1 -1 -1 -1 0 0 -1 -1 -1 0 1 1 1
-1 -1
7765 1 1 1 0 0 0 -1 1 1 1 0 0 0
Can someone help with a fairly simple task?
I have a data set where I would like to insert a 0 time event between
individuals:
what I have:
VAR DATETIME CONC COVAR
1 NOV20.2510 group1
1 NOV20.5 20 group1
1 NOV21 5 group1
1
Thank you for helping me and this solved the problem
Best Regards
Umesh R
_
From: foolish.andr...@gmail.com [mailto:foolish.andr...@gmail.com] On Behalf
Of Felix Andrews
Sent: Friday, March 11, 2011 4:05 AM
To: Umesh Rosyara
Cc: R mailing list; deepayan.sar...@r-project.o
On Mar 10, 2011, at 8:23 AM, Benjamin Stier wrote:
Hello list!
I have a data.frame which looks like this:
serv
datum op.read op.write read write
1 2011-01-29 10:00:00 00 0 0
2 2011-01-29 10:00:01 00 0 0
3 2011-01-29 10:00:02 0
H Zeileis,
This helped out a lot - thanks!!
Jen
--
View this message in context:
http://r.789695.n4.nabble.com/tobit-regression-model-tp3345789p3347936.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
Hi:
Perhaps something like
f1(x, y) * I(z > 0) + f2(x, y) * I(z <= 0) ??
HTH,
Dennis
On Fri, Mar 11, 2011 at 3:10 AM, Otto Kässi wrote:
> Dear r-helpers,
>
> This might be an elementary question, but I have a hard time getting
> my head around it, so all help is much appreciated.
>
> I a
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 03/11/2011 12:48 PM, Eik Vettorazzi wrote:
> or even simpler
> paste(rep(x,each=length(y)),y,sep="")
I like that one - it makes perfect sense. I might wrap it into a
function and use it.
>
>
> Am 11.03.2011 12:44, schrieb Eik Vettorazzi:
>> Hi R
On Mar 10, 2011, at 8:46 PM, David Winsemius wrote:
On Mar 10, 2011, at 11:17 AM, Daniel Nüst wrote:
Hello!
I've been trying to get this right for quite a while now and fear
there is an easy solution I just don't see. I did not have this
problem in Linux, and I searched r-help and Google bu
or even simpler
paste(rep(x,each=length(y)),y,sep="")
Am 11.03.2011 12:44, schrieb Eik Vettorazzi:
> Hi Rainer,
> I don't know a function for literally substituting "THEFUNCTION", but
> x <- c("a", "b")
> y <- c("x", "y")
> sort(levels(interaction(x,y,sep="")))
>
> or
>
> as.vector(t(outer(x,y,
Hi Rainer,
I don't know a function for literally substituting "THEFUNCTION", but
x <- c("a", "b")
y <- c("x", "y")
sort(levels(interaction(x,y,sep="")))
or
as.vector(t(outer(x,y,paste,sep="")))
will work. "sort" and "t" respectively here are used to produce the
desired order.
hth.
Am 11.03.201
Dear List,
I have fitted a spherical function to my variogram using "variofit(...)"
from GeoR. Now I would like to predict some data with the function
"predict(object,...)" from package stats. Does anyone know wether this
works and if it does how to do it?
Thanks a lot!
Anna
___
1 - 100 of 116 matches
Mail list logo