Dear Dennis, David, Jeff, and Denes,
Thanks for your helps and comments. The simple one seems good enough for
my works.
Best,
Steve
On Wed, Dec 17, 2014 at 5:46 AM, Dénes Tóth wrote:
>
> Dear Jeff,
>
> On 12/17/2014 01:46 AM, Jeff Newmiller wrote:
>
>> You are chasing ghosts of performance pa
Dear Jeff,
On 12/17/2014 01:46 AM, Jeff Newmiller wrote:
You are chasing ghosts of performance past, Denes.
In terms of memory efficiency, yes. In terms of CPU time, there can be
significant difference, see below.
The data.frame
function causes no problems, and if it is used then the OP w
You are chasing ghosts of performance past, Denes. The data.frame
function causes no problems, and if it is used then the OP would not need
to presume they know the internal structure of the data frame.
See below. (I am using R3.1.2.)
a1 <- list(x = rnorm(1e6), y = rnorm(1e6))
a2 <- list(x = rn
On 12/16/2014 06:06 PM, SH wrote:
Dear List,
I hope this posting is not redundant. I have several list outputs with the
same components. I ran a function with three different scenarios below
(e.g., scen1, scen2, and scen3,...,scenN). I would like to extract the
same components and group the
inal Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of SH
Sent: Tuesday, December 16, 2014 11:06 AM
To: r-help
Subject: [R] Extract values from multiple lists
Dear List,
I hope this posting is not redundant. I have several list outputs with the
same components. I ran a
Dear List,
I hope this posting is not redundant. I have several list outputs with the
same components. I ran a function with three different scenarios below
(e.g., scen1, scen2, and scen3,...,scenN). I would like to extract the
same components and group them as a data frame. For example,
pop.i
f$group), length))
shall give you desired vector.
Regards
Petr
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of Benjamin Gillespie
> Sent: Sunday, November 17, 2013 3:47 PM
> To: r-help@r-project.org
> Subje
ilto:r-help-bounces@r-
> project.org] On Behalf Of Benjamin Gillespie
> Sent: Sunday, November 17, 2013 3:47 PM
> To: r-help@r-project.org
> Subject: [R] Extract values from vector and repeat by group
>
> Hi all,
>
> I hope you can help.
>
> I have a data frame '
November 2013 16:48
To: R help
Cc: Berend Hasselman; Benjamin Gillespie
Subject: Re: [R] Extract values from vector and repeat by group
Hi,
?merge() sometimes change the order.
For example:
df1 <- df[-12,]
df2 <- df1
merge(df1, df1[df1$time == 4, c("group", "var")], by.x
Hi,
?merge() sometimes change the order.
For example:
df1 <- df[-12,]
df2 <- df1
merge(df1, df1[df1$time == 4, c("group", "var")], by.x = "group", by.y =
"group", suffixes = c("", "GroupSK0"))
In that case,
df1$ord1 <- with(df1,order(group,time))
res <- merge(df1, df1[df1$time == 4, c("group",
On 17-11-2013, at 15:47, Benjamin Gillespie wrote:
> Hi all,
>
> I hope you can help.
>
> I have a data frame 'df':
>
> group=c(rep(1,8),rep(2,10),rep(3,11))
> var=rnorm(29)
> time=c(seq(1,8),seq(1,10),seq(1,11))
> df=data.frame(group,var,time)
>
> I would like to extract the value from 'var
Hi all,
I hope you can help.
I have a data frame 'df':
group=c(rep(1,8),rep(2,10),rep(3,11))
var=rnorm(29)
time=c(seq(1,8),seq(1,10),seq(1,11))
df=data.frame(group,var,time)
I would like to extract the value from 'var' for each 'group' at 'time'=4 and
repeat these extracted values in a new vec
Hello,
I don't understand. Your object is a vector, with a dim attribute, so
x[, 1] is meaningless. And all the values are less than 1820:
any(x > 1820) # FALSE
Given the names attribute of your data, is it the values of x
corresponding to names greater than 1820? If so, try
y <- as.numer
Thank very much for your help!
On 12 March 2013 20:04, Sarah Goslee wrote:
> Data in x is never > 1820:
> > summary(x)
>Min. 1st Qu. MedianMean 3rd Qu.Max.
> 0.8465 1.2890 1.5660 1.5710 1.8050 3.4340
>
> And your object is a vector: trying to extract the first column with
> x
Data in x is never > 1820:
> summary(x)
Min. 1st Qu. MedianMean 3rd Qu.Max.
0.8465 1.2890 1.5660 1.5710 1.8050 3.4340
And your object is a vector: trying to extract the first column with
x[,1] is meaningless, because x has no dimensions.
> dim(x)
NULL
It looks to me as if you wa
iversity
College Station, TX 77843-4352
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of catalin roibu
> Sent: Tuesday, March 12, 2013 12:50 PM
> To: r-help@r-project.org
> Subject: [R] extract values
>
First take a look at your data and understand its structure. What you have
is a named vector and not a matrix:
> str(x)
Named num [1:213] 2.58 1.73 3.43 2.19 1.93 ...
- attr(*, "names")= chr [1:213] "1799" "1800" "1801" "1802" ...
> x1 <- x[names(x) > '1820']
> x1
1821 1822 1823 1824
uesday, March 12, 2013 1:50 PM
Subject: [R] extract values
Hello all!
I have a problem to extract values greater that for example 1820.
I try this code: x[x[,1]>1820,]->x1
Please help me!
Thank you!
The data structure is:
structure(c(2.576, 1.728, 3.434, 2.187, 1.928, 1.886, 1.2425,
1.23, 1
Hello all!
I have a problem to extract values greater that for example 1820.
I try this code: x[x[,1]>1820,]->x1
Please help me!
Thank you!
The data structure is:
structure(c(2.576, 1.728, 3.434, 2.187, 1.928, 1.886, 1.2425,
1.23, 1.075, 1.1785, 1.186, 1.165, 1.732, 1.517, 1.4095, 1.074,
1.618, 1
Hello,
There's a general purpose way to get the members of the object returned
by summary functions. What you have tried unsuccessfully is a particular
case of that method: assign summary to a variable and see what's int it.
si <- summary(indication3)
class(si) # see the class of summary ob
Hi everybody,
I am doing Indicator species analysis using the function "indval" from the
package "labdsv".
For further analysis I need the values "Number of Significant Indicators"
and "Sum of Indicator Values" that is calculated from the summary on my
indval object.
indication3<-indval(Veg,cav
The error seems clear enough to me... you are trying to mix vectors of
different lengths where one length is not a multiple of the other length.
Your discussion is pretty confused though, referring to possible data frames x,
x.sub, x.res and Dataset. You might benefit from reviewing ?str and ?dp
#add column Start
Hello
Good Afternoon I am trying to create a new column in the data frame, the
target is based on a column of dates to extract a value of life and add a
new column to data frame
f<-x.res$T-x.res$duration
Dataset$StarEvent<-(as.character.POSIXt(f))
x.sub$T is:
[1] "2006-10-31
Hi Ista,
Thanks for your suggestion, I am still trying to wrap my head around the
functions you used, as I am not familiar with any of them, but it works
perfectly!
I do want to understand the code, if you don't mind I would like to ask a
few questions
In this line:
dfm <- melt(df[c(1, 2, 5, 8)],
On Fri, Aug 12, 2011 at 3:54 AM, Lali wrote:
> Hi Ista,
> Thanks for your suggestion, I am still trying to wrap my head around the
> functions you used, as I am not familiar with any of them, but it works
> perfectly!
> I do want to understand the code, if you don't mind I would like to ask a
> fe
Hi Laura,
On Thu, Aug 11, 2011 at 7:01 AM, Lali wrote:
> Hi everyone,
> I have a data frame that looks *sort of* like this:
>
> name <- letters[1:5]
> signal.1 <- c("12", "bad signal", "noise", "10", "X")
> length.signal.1 <- 5:9
> intensity.signal.1 <- 3:7
> signal.2 <- c("13", "noise", "19.2",
Hi everyone,
I have a data frame that looks *sort of* like this:
name <- letters[1:5]
signal.1 <- c("12", "bad signal", "noise", "10", "X")
length.signal.1 <- 5:9
intensity.signal.1 <- 3:7
signal.2 <- c("13", "noise", "19.2", "X", "V")
length.signal.2 <- 2:6
intensity.signal.2 <- 1:5
signal.3 <- c
> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of Erik Iverson
> Sent: Sunday, August 08, 2010 11:27 PM
> To: Alexander Eggel
> Cc: r-help@r-project.org
> Subject: Re: [R] Extract values from data frame in
On Aug 9, 2010, at 2:16 AM, Alexander Eggel wrote:
Using R, I would like to find out which Samples (S1, S2, S3, S4, S5)
fulfill
the following criteria:contain minimally one value (x, y or z)
bigger than
4. Any ideas? Thanks, Alex.
data
Sample xy z
1S1 -0.3
On 08/09/2010 01:16 AM, Alexander Eggel wrote:
Using R, I would like to find out which Samples (S1, S2, S3, S4, S5) fulfill
the following criteria:contain minimally one value (x, y or z) bigger than
4. Any ideas? Thanks, Alex.
data
Sample xy z
1S1 -0.35.3
Using R, I would like to find out which Samples (S1, S2, S3, S4, S5) fulfill
the following criteria:contain minimally one value (x, y or z) bigger than
4. Any ideas? Thanks, Alex.
> data
Sample xy z
1S1 -0.35.32.5
2S20.40.2 -1.2
3S3
Hi Melanie,
I think you just need
merge(TABLE1, TABLE2)
see ?merge for details.
-Ista
On Wed, Mar 10, 2010 at 12:47 AM, Melanie HAMEL wrote:
> Dear all,
>
> I would like to solve a trivial problem (I guess it is) but can't find the
> right way. Maybe someone can help me ?
>
> I've got a table
Dear all,
I would like to solve a trivial problem (I guess it is) but can't find the
right way. Maybe someone can help me ?
I've got a table with two factors (station = station ID, buffer = buffer size
in meters) and a value for each unique combination of those two factors (S =
number of habit
On Feb 15, 2010, at 4:35 PM, Jay wrote:
Hello,
silly question I suppose, but somehow I can't manage to extract the
probabilities from a glm.predict() result:
str(res)
Named num [1:9] 0.00814 0.01877 0.025 0.02941 0.03563 ...
- attr(*, "names")= chr [1:9] "1" "2" "3" "4" ...
I got from:
#
Hello,
silly question I suppose, but somehow I can't manage to extract the
probabilities from a glm.predict() result:
> str(res)
Named num [1:9] 0.00814 0.01877 0.025 0.02941 0.03563 ...
- attr(*, "names")= chr [1:9] "1" "2" "3" "4" ...
I got from:
# A Gamma example, from McCullagh & Nelder (
Felipe Carrillo yahoo.com> writes:
>
> # How can I extract the 'Forecasts' from the 'summary(predicted)' from the
example below?
..
> # I would like to extract the three predicted values and
> # make a line plot with the 'Point Forecast' values only.
> # I tried str(predicted) and names(pred
Hi:
# How can I extract the 'Forecasts' from the 'summary(predicted)' from the
example below?
library(forecast)
weightData <- data.frame(weight = c(2.1,2.4,2.8,3.6,4.1,5.2,6.3),week= 1:7)
weight <- as.numeric(weightData$weight)
predicted <- forecast(weight,h=3,level=95) # see the predicted
sum
On Tue, 23 Dec 2008, Sean Zhang wrote:
Dear R-Helpers:
I am a entry level user of R.
You need to read
An Introduction to R
particularly this section:
2.7 Index vectors; selecting and modifying subsets of a data set
...
2. A vector of positive integral qua
How about this?
value.vec[which.vec]
HTH,
Jorge
On Tue, Dec 23, 2008 at 9:52 PM, Sean Zhang wrote:
> Dear R-Helpers:
>
> I am a entry level user of R.
>
> Have the following question. Many thanks in advance.
>
>
> # value.vec stores values
> value.vec <- c('a','b','c')
> # which.vec stores t
> sapply(which.vec, function(x){ value.vec[x] } )
[1] "c" "b" "b" "a"
On Dec 23, 2008, at 9:52 PM, Sean Zhang wrote:
# value.vec stores values
value.vec <- c('a','b','c')
# which.vec stores the locations/indexs of values in value.vec.
which.vec <- c(3, 2, 2, 1)
# How can I obtain the followin
Dear R-Helpers:
I am a entry level user of R.
Have the following question. Many thanks in advance.
# value.vec stores values
value.vec <- c('a','b','c')
# which.vec stores the locations/indexs of values in value.vec.
which.vec <- c(3, 2, 2, 1)
# How can I obtain the following vector based on t
Thanks a lot for the suggestions!
Gang
On 4/7/08, Uwe Ligges <[EMAIL PROTECTED]> wrote:
>
>
> Gang Chen wrote:
>
> > Sorry for this dumb question. Suppose I have a named array ww defined as
> >
> > ww <- 1:5
> > names(ww) <- c("a", "b", "c", "d", "e")
> >
> > How can I extract the whole array of
Gang Chen wrote:
> Sorry for this dumb question. Suppose I have a named array ww defined as
>
> ww <- 1:5
> names(ww) <- c("a", "b", "c", "d", "e")
>
> How can I extract the whole array of numbers without the names?
> ww[1:5] does not work while ww[[1]] can only extract one number at a
> time.
Try:
as.numeric(ww)
On Mon, Apr 7, 2008 at 1:33 PM, Gang Chen <[EMAIL PROTECTED]> wrote:
> Sorry for this dumb question. Suppose I have a named array ww defined as
>
> ww <- 1:5
> names(ww) <- c("a", "b", "c", "d", "e")
>
> How can I extract the whole array of numbers without the names?
> ww[1:5
Sorry for this dumb question. Suppose I have a named array ww defined as
ww <- 1:5
names(ww) <- c("a", "b", "c", "d", "e")
How can I extract the whole array of numbers without the names?
ww[1:5] does not work while ww[[1]] can only extract one number at a
time.
Thanks,
Gang
45 matches
Mail list logo