Try this:
`class<-`(lapply(1:length(QuanImpUnsold),
function(idx)c(QuanImpUnsold[[idx]], PARCELS[[idx]])), "by")
On Fri, Jan 15, 2010 at 5:06 PM, L.A. wrote:
>
>
> Hey Guys,
> It sure seems I get stuck on things that should be easy.
> Heres my question:
>
> PARCELS<-by(ResImp[ , "ACCOUNTNO"], R
Hey Guys,
It sure seems I get stuck on things that should be easy.
Heres my question:
PARCELS<-by(ResImp[ , "ACCOUNTNO"], ResImp["Property"], length)
> PARCELS
Property: UNSOLD
[1] 9053
---
Property: SOL
On Monday 26 October 2009, Frank E Harrell Jr wrote:
> Dylan Beaudette wrote:
> > Hi,
> >
> > Using the latest rms package I am able to make nice plots of model
> > predictions +/- desired confidence intervals like this:
> >
> > # need this
> > library(rms)
> >
> > # setup data
> > d <- data.frame(
Dylan Beaudette wrote:
Hi,
Using the latest rms package I am able to make nice plots of model predictions
+/- desired confidence intervals like this:
# need this
library(rms)
# setup data
d <- data.frame(x=rnorm(100), y=rnorm(100))
dd <- datadist(d)
options(datadist='dd')
# fit model
l <- o
Hi,
Using the latest rms package I am able to make nice plots of model predictions
+/- desired confidence intervals like this:
# need this
library(rms)
# setup data
d <- data.frame(x=rnorm(100), y=rnorm(100))
dd <- datadist(d)
options(datadist='dd')
# fit model
l <- ols(y ~ rcs(x), data=d)
#
Super! It works. :-) Thanks a lot, you both.
Greetings
Jürgen
Petr PIKAL schrieb:
> Hi
> r-help-boun...@r-project.org napsal dne 09.09.2009 10:07:49:
>
>
>> Hi Henrique,
>>
>> Thanks for your reply.
>> I tried you suggestion but it didn't work with the poLCA package.
>>
>> Maybe i didn't exp
Hi
r-help-boun...@r-project.org napsal dne 09.09.2009 10:07:49:
> Hi Henrique,
>
> Thanks for your reply.
> I tried you suggestion but it didn't work with the poLCA package.
>
> Maybe i didn't express myself good.
>
> The normal syntax is:
>
> f <- cbind(V1,V2,V3)~1
> poLCA(f,data)
You compl
Hi Henrique,
Thanks for your reply.
I tried you suggestion but it didn't work with the poLCA package.
Maybe i didn't express myself good.
The normal syntax is:
f <- cbind(V1,V2,V3)~1
poLCA(f,data)
and what I wanna do is kind of use an expression to automatically
generate the "V1,V2,V3" argume
I don't understand the cbind(bi) sintax, but you can do this with the
folowing:
(Using iris data from R)
form <- formula(paste(paste(names(iris), collapse = " + "), "~ 1"))
2009/9/8 "Biedermann, Jürgen"
> Hi there,
>
> I have the following problem:
>
> I have a package called "polLCA" which has
Hi there,
I have the following problem:
I have a package called "polLCA" which has the following syntax:
poLCA(formula, data)
and needs the following formula definition:
formula <- cbind(V1,V2,V3,...)
So far so good.
What I tried now was the following:
#Get "data" with the "read.table" fuct
Thanks Erik and Henrique,
That's what I was after.
Jonas
On Tue, Sep 1, 2009 at 8:08 PM, Henrique Dallazuanna wrote:
> Try this:
>
> > sapply(vec.names, get)
>
> But for this example, you don't need for, try:
>
> > dat - 1
>
> On Tue, Sep 1, 2009 at 2:52 PM, jonas garcia <
> garcia.jona...@g
Try this:
> sapply(vec.names, get)
But for this example, you don't need for, try:
> dat - 1
On Tue, Sep 1, 2009 at 2:52 PM, jonas garcia
wrote:
> Dear list,
>
>
>
> I have a character vector such vec.names<- c("a", "b")
>
> It happens that I have also two R objects called "a" and "b" that I wo
-project.org
Subject: [R] cbind objects using character vectors
Dear list,
I have a character vector such vec.names<- c("a", "b")
It happens that I have also two R objects called "a" and "b" that I would
like to merge. Is it possible to
do something like cbind
Dear list,
I have a character vector such vec.names<- c("a", "b")
It happens that I have also two R objects called "a" and "b" that I would
like to merge. Is it possible to
do something like cbind(vec.names[1], vec.names[2]) ending up with the same
result as cbind(a,b)
Bellow is a reproduci
Hi Emma,
Here's what I suggest:
na.vec = is.na(A[,1]) ;
first.num.pos = min(which(na.vec==FALSE)) ;
first.part = (-first.num.pos+1):(-1) ;
second.part = 0:(length(A[,1])-length(first.part)-1) ;
Result.mat = cbind(c(first.part,second.part),A[,1]) ;
I hope this is what you wa
Yes, indeed!
Best,
Dimitris
Mike Lawrence wrote:
Unfortunately Dimitris' solution fails in the face of NA padding on
both sides of the numeric data, as in Emma's original example.
x <- c(rep(NA, 20), sample(100, 25), rep(NA,20))
On Tue, Apr 14, 2009 at 9:40 AM, Dimitris Rizopoulos
wrote:
Unfortunately Dimitris' solution fails in the face of NA padding on
both sides of the numeric data, as in Emma's original example.
x <- c(rep(NA, 20), sample(100, 25), rep(NA,20))
On Tue, Apr 14, 2009 at 9:40 AM, Dimitris Rizopoulos
wrote:
> try this:
>
> x <- c(rep(NA, 20), sample(100, 25))
>
oops, of course I meant:
a=c(NA,NA,2,3,NA,NA,NA)
b=1:length(a)
cbind(b=b-which.min(is.na(a)),a=a)
On Tue, Apr 14, 2009 at 9:43 AM, Mike Lawrence wrote:
>> a=c(NA,NA,2,3,NA,NA,NA)
>> which.min(is.na(a))
> [1] 3
>> b=1:length(a)
>> b-3
> [1] -2 -1 0 1 2 3 4
>> cbind(b=b-3,a=a)
> b a
>
> a=c(NA,NA,2,3,NA,NA,NA)
> which.min(is.na(a))
[1] 3
> b=1:length(a)
> b-3
[1] -2 -1 0 1 2 3 4
> cbind(b=b-3,a=a)
b a
[1,] -2 NA
[2,] -1 NA
[3,] 0 2
[4,] 1 3
[5,] 2 NA
[6,] 3 NA
[7,] 4 NA
On Tue, Apr 14, 2009 at 7:20 AM, emj83 wrote:
>
> I have a list of numbers with NAs as
try this:
x <- c(rep(NA, 20), sample(100, 25))
n.na <- sum(is.na(x))
cbind(seq(-n.na, length(x) - n.na - 1), x)
I hope it helps.
Best,
Dimitris
emj83 wrote:
I have a list of numbers with NAs as below:
A[,1]
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
NA
[1
I have a list of numbers with NAs as below:
> A[,1]
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
NA
[19] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
NA
[37] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
NA
[55] NA
I've just committed a fix to the zoo svn repository. You can grab it like this:
source("http://r-forge.r-project.org/plugins/scmsvn/viewcvs.php/*checkout*/pkg/R/merge.zoo.R?rev=575&root=zoo";)
On Sun, Mar 15, 2009 at 2:54 AM, Ajay Shah wrote:
> Folks,
>
> I often build up R objects starting fro
Folks,
I often build up R objects starting from NULL and then repeatedly
using rbind() or cbind(). This yields code like:
a <- NULL
for () {
onerow <- craft one more row
a <- rbind(a, onerow)
}
This works because rbind() and cbind() are forgiving when presented
with a NULL arg: they act like
Hi there
I want to cbind a vector(contains 20 values) to a dataframe containg (18
rows).The missing value in the dataframe is however a repeated values but
still i want to retain the repeats in the vector and the dataframe values
can even get enterd twice.
how should i go about it
Example:
Vec
I think the issue is that cbind applied to a vector or matrix drops
classes.
It seems that data.frame() should have been used to combine columns here.
On Mon, 25 Aug 2008, Charles Plessy wrote:
Le Sun, Aug 24, 2008 at 10:56:43PM -0700, Yuan Jian a écrit :
hi,
when I used cbind to combine col
lt;[EMAIL PROTECTED]>
Subject: Re: [R] cbind in data.frame
To: r-help@r-project.org
Date: Monday, August 25, 2008, 6:09 AM
Le Sun, Aug 24, 2008 at 10:56:43PM -0700, Yuan Jian a écrit :
> hi,
> when I used cbind to combine columns, some contents of columns has been
replaced by
> number
Le Sun, Aug 24, 2008 at 10:56:43PM -0700, Yuan Jian a écrit :
> hi,
> when I used cbind to combine columns, some contents of columns has been
> replaced by
> number. in the script below, column should be aaa,bbb,ccc but I was given
> 1,2,3.
> but when I change the column to vector, it gave me cor
hi,
when I used cbind to combine columns, some contents of columns has been
replaced by
number. in the script below, column should be aaa,bbb,ccc but I was given 1,2,3.
but when I change the column to vector, it gave me correct contents. can you
please
tell me why?
> d<-read.table("aaa.txt")
>
Try:
names(abc)[3] <- "w"
On Fri, Jul 18, 2008 at 1:08 PM, Rajasekaramya <[EMAIL PROTECTED]> wrote:
>
> hi there,
>
> I need to change a column name in a dataframe.how do i do that
> eg
> abc<- dataframe
> abc
> x y z
>
> i wanna change the colum z to w.
>
> Ramya
> --
> View this message in con
hi there,
I need to change a column name in a dataframe.how do i do that
eg
abc<- dataframe
abc
x y z
i wanna change the colum z to w.
Ramya
--
View this message in context:
http://www.nabble.com/cbind-help-tp18532609p18532609.html
Sent from the R help mailing list archive at Nabble.com.
_
-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Namens Ingrid Tohver
Verzonden: donderdag 29 mei 2008 3:23
Aan: r-help@r-project.org
Onderwerp: [R] cbind results to original data frame
I have the following script, which gives me a prediction for each of
my observations
I have the following script, which gives me a prediction for each of
my observations (> 49k), and subsets my data frame by site (n = 183):
ts <- (by(dem16,dem16['Site'],function(dat)
try(predict(nls(Tw ~ mu + ((alpha - mu)/
(1 + exp(gamma*(B - Mean_air
Is this what you want? You have to add "na.rm=TRUE" to the calculations:
> week<-c(28,28,28,28,28,28,28,29,29,29,29,29,29,29,30,30,30,30,30,30,30)
> td<-c(0.015,0.012,NA,0.015,NA,0.014,0.014,0.013,0.013,0.013,0.013,NA,0.010,0.013,0.015,0.011,0.014,0.014,0.014,0.014,0.016)
> pd<-c(0,0,NA,80,NA,45,
Hi:
I have been able to finally crunch my data by
importing it by week(thank you all for your help),but
here we go again..
Now I'am trying to do it for the the whole year.
Since the
dataset is huge I'm only making a 3 weeks dataframe.
- I want to get the mean of pd by week
- I want to count the
And here is a second solution, that differs in what happens if the variables
have differing lengths:
> var1 <- 1:4
> var2 <- 1:3
> sapply(ls(patt="^var[0-9]"), get)
$var1
[1] 1 2 3 4
$var2
[1] 1 2 3
> do.call("cbind", lapply(ls(patt="^var[0-9]"), get))
[,1] [,2]
[1,]11
[2,]2
Try this:
sapply(ls(patt="^var[0-9]"), get)
On 13/11/2007, livia <[EMAIL PROTECTED]> wrote:
>
> Hello everyone,
>
> I would like to use the "cbind" function to construct a dataset, combining
> some variable I defined before.
> The codes are something like
>
> var1 <- ...
> var2 <- ...
> var2 <- .
Hello everyone,
I would like to use the "cbind" function to construct a dataset, combining
some variable I defined before.
The codes are something like
var1 <- ...
var2 <- ...
var2 <- ...
...
data <- cbind(var1,var2,var3...)
The problem is I would like some flexibity in the data, i.e. the numbe
On 10/31/2007 8:06 AM, livia wrote:
> Hello,
>
> I would like to use the cbind() function to construct a matrix used in the
> middle of a function as following
>
> for (i in 1:1000) {
> b[i] <- function(cbind(a[[1]][[i]],
> a[[2]][[i]],a[[3]][[i]],...a[[67]][[i]]))
> }
>
>
> Is there an easy wa
Hi
Perhaps:
Hi,
Try this:
do.call("rbind", lapply(a, function(x)do.call("cbind", x)))
On 31/10/2007, livia <[EMAIL PROTECTED]> wrote:
>
>
> Hello,
>
> I would like to use the cbind() function to construct a matrix used in the
> middle of a function as following
>
> for (i in 1:1000) {
> b[i] <-
Or just:
sapply(a, function(x)do.call("cbind", x))
If is what you want.
On 31/10/2007, Henrique Dallazuanna <[EMAIL PROTECTED]> wrote:
>
> Hi
> Perhaps:
>
> Hi,
>
> Try this:
>
> do.call("rbind", lapply(a, function(x)do.call("cbind", x)))
>
> On 31/10/2007, livia <[EMAIL PROTECTED]> wrote:
> >
Hello,
I would like to use the cbind() function to construct a matrix used in the
middle of a function as following
for (i in 1:1000) {
b[i] <- function(cbind(a[[1]][[i]],
a[[2]][[i]],a[[3]][[i]],...a[[67]][[i]]))
}
Is there an easy way of achieving this rather than "cbind" every column?
--
101 - 141 of 141 matches
Mail list logo