Displaying 20 results from an estimated 20000 matches similar to: "which() in subset()"
2012 Jul 14
3
Can't understand syntax
OK, I need help!!
I've been searching, but I don't understand the logic of some this
dataframe addressing syntax.
What is this type of code called?
test [["v3"]] [is.na(test[["v2"]])] <-10 #choose column v3 where column v2
is == 4 and replace with 10
and where is it documented?
The code below works for what I want to do (find the non-missing value in a
row),
2012 Jul 16
4
Error in as.xts
Hi
I got the following error using as.xts
Error in xts(x, order.by = order.by, frequency = frequency, ...) :
NROW(x) must match length(order.by)
Here is how the data looks like
> d1 <- read.csv(file.path(dataDir,"AppendixA-FishCountsTable-2009.csv"),
as.is=T)
> d1[1:3,]
dive_id date time species count size site depth level
TRANSECT VIS_M
1 62 10/12/2009
2018 Aug 05
2
Is this a bug in `[`?
Thanks.
This is exactly the doubt I had.
Rui Barradas
?s 05:26 de 05/08/2018, Kenny Bell escreveu:
> This should more clearly illustrate the issue:
>
> c(1, 2, 3, 4)[-seq_len(4)]
> #> numeric(0)
> c(1, 2, 3, 4)[-seq_len(3)]
> #> [1] 4
> c(1, 2, 3, 4)[-seq_len(2)]
> #> [1] 3 4
> c(1, 2, 3, 4)[-seq_len(1)]
> #> [1] 2 3 4
> c(1, 2, 3, 4)[-seq_len(0)]
2012 Nov 14
5
aggregate combination data
Dear R users,
I want to aggregate all *d *data from all combination of n *plots* taken
by k.
Thank very much!
My data is like that:
plot d 1 14 1 13 1 12 1 14 1 18 1 20 1 21 1
43 1 108 1 43 2 41 2 61 2 83 2 61 2 84 2 45 2 21 2 12 2 11 ... 100
10
100 12
--
---
Catalin-Constantin ROIBU
Forestry engineer, PhD
Forestry Faculty of Suceava
2018 Aug 04
3
Is this a bug in `[`?
?s 15:51 de 04/08/2018, I?aki ?car escreveu:
> El s?b., 4 ago. 2018 a las 15:32, Rui Barradas
> (<ruipbarradas at sapo.pt>) escribi?:
>>
>> Hello,
>>
>> Maybe I am not understanding how negative indexing works but
>>
>> 1) This is right.
>>
>> (1:10)[-1]
>> #[1] 2 3 4 5 6 7 8 9 10
>>
>> 2) Are these right? They
2012 Jul 07
11
Splitting a character vector.
I am lousy at simple regex and I have not found a solution to a simple problem.
I have a vector with some character values that I want to split.
Sample data
dd1 <- c( "XXY (mat harry)","XXY (jim bob)", "CAMP (joe blow)", "ALP (max jack)")
Desired result
dd2 <- data.frame( xx = c("XXY", "XXY", "CAMP",
2018 Nov 21
3
Subsetting row in single column matrix drops names in resulting vector
Hi Rui. Thanks for answer, I'm aware of drop = FALSE option. Unfortunately
it doesn't resolve the issue - I'm expecting to get a vector, not a matrix .
??, 21 ????. 2018 ?. ? 20:54, Rui Barradas <ruipbarradas at sapo.pt>:
> Hello,
>
> Use drop = FALSE.
>
> a[1, , drop = FALSE]
> # col1
> #row1 1
>
>
> Hope this helps,
>
> Rui Barradas
2013 Jul 22
4
How to split two levels several times?
Hi,
I have a small problem with the function split() and would appreciate your help.
I have a table called ?XXX? with 2 columns and 49 rows. The 49 rows belong to 8 different levels (electrode1, ...,electrode8). I want to split the table always at the row where ?electrode1? starts again so that I can export 7 individual dataframes (numbered ?dataframe1? to ?dataframe7?) which contain always
2018 Oct 07
4
Warning when calling formals() for `[`.
Hello,
I don't see why you say that the documentation seems to be wrong:
class(args(`+`))
#[1] "function"
args() on a primitive does return a closure. At least in this case it does.
Rui Barradas
?s 14:05 de 07/10/2018, Peter Dalgaard escreveu:
> There is more "fun" afoot here, but I don't recall what the point may be:
>
>> args(get("+"))
2018 Aug 05
2
Is this a bug in `[`?
El dom., 5 ago. 2018 a las 6:27, Kenny Bell (<kmbell56 at gmail.com>) escribi?:
>
> This should more clearly illustrate the issue:
>
> c(1, 2, 3, 4)[-seq_len(4)]
> #> numeric(0)
> c(1, 2, 3, 4)[-seq_len(3)]
> #> [1] 4
> c(1, 2, 3, 4)[-seq_len(2)]
> #> [1] 3 4
> c(1, 2, 3, 4)[-seq_len(1)]
> #> [1] 2 3 4
> c(1, 2, 3, 4)[-seq_len(0)]
> #>
2012 Jul 11
1
Analyzing subsets
Say I want to perform transformations on row subsets of my dataframe.
Do I have to break the dataframe into subsets, perform the analysis on each
subset, and rbind() them together again?
..or is there another way.
Thank you!
[[alternative HTML version deleted]]
2013 Jun 23
1
Scaling Statistical
Short question: Is it possible to use statistical tests, like the Augmented
Dickey-Fuller test, in functions with for-loops? If not, are there any
alternative ways to scale measures?
Detailed explanation: I am working with time-series, and I want to flag
curves that are not stationary and which display pulses, trends, or level
shifts.
>df
DATE ID VALUE2012-03-06 1
2017 Sep 21
2
rcorr error in R stat
Hello,
Please keep this on the list, always cc r-help.
One of the files in your attachment is empty:
y <- read.csv(file.choose("GT.csv"))
Error in read.table(file = file, header = header, sep = sep, quote = quote,? :
? no lines available in input
Rui Barradas
?
Citando Chaitanya Ganne <Chaitanya.Ganne at jefferson.edu>:
> Thank you so much for your input.
>
> I am
2013 Oct 31
1
Extracting values from a ecdf (empirical cumulative distribution function) curve
Hi R users,
I am a new user, still learning basics of R. Is there anyway to extract y
(or x) value for a known x (or y) value from ecdf (empirical cumulative
distribution function) curve?
Thanks in advance.
Mano.
[[alternative HTML version deleted]]
2015 Mar 23
2
[PATCH 1/1] Add virtio-input driver.
On Mo, 2015-03-23 at 15:54 +0100, Michael S. Tsirkin wrote:
> On Mon, Mar 23, 2015 at 03:27:35PM +0100, Gerd Hoffmann wrote:
> > Hi,
> >
> > > > > > You are doing leXXX everywhere, that's VERSION_1 dependency.
> > > > > > virtio_cread will do byteswaps differently without VERSION_1.
> > > > > > Just don't go there.
2015 Mar 23
2
[PATCH 1/1] Add virtio-input driver.
On Mo, 2015-03-23 at 15:54 +0100, Michael S. Tsirkin wrote:
> On Mon, Mar 23, 2015 at 03:27:35PM +0100, Gerd Hoffmann wrote:
> > Hi,
> >
> > > > > > You are doing leXXX everywhere, that's VERSION_1 dependency.
> > > > > > virtio_cread will do byteswaps differently without VERSION_1.
> > > > > > Just don't go there.
2012 Aug 13
4
write.dbf error: invalid subscript type 'list'
Dear all,
I am basically a GIS user and am new to R.
I am trying to write a data frame to a dbf file.
*n.simulations <- 999
binomial <- kulldorff(geo, cases, population, NULL, pop.upper.bound,
n.simulations, alpha.level, plot)
cluster <- binomial$most.likely.cluster$location.IDs.included
df <- data.frame(ID=seq(1,n.simulations,by=1),
simloglkhd=binomial$simulated.log.lkhd)
2015 Mar 23
2
[PATCH 1/1] Add virtio-input driver.
Hi,
> > > > You are doing leXXX everywhere, that's VERSION_1 dependency.
> > > > virtio_cread will do byteswaps differently without VERSION_1.
> > > > Just don't go there.
> So to clarify, you dislike using __virtio32 in virtio input header?
Well, as I understand things __virtio32 implies byteorder depends on
whenever we are using VERSION_1 or not.
2015 Mar 23
2
[PATCH 1/1] Add virtio-input driver.
Hi,
> > > > You are doing leXXX everywhere, that's VERSION_1 dependency.
> > > > virtio_cread will do byteswaps differently without VERSION_1.
> > > > Just don't go there.
> So to clarify, you dislike using __virtio32 in virtio input header?
Well, as I understand things __virtio32 implies byteorder depends on
whenever we are using VERSION_1 or not.
2020 Feb 04
2
Stroring and extracting AICs from an ARIMA model using a nested loop
I am nowaware that I should not post this type of questions on this group. However, Iwould like to have some clarifications related to the response you've?alreadyprovided. The code you provided yields accurate results, however I still haveissues grasping the loop process in case 1 & 2.
In case1,?the use of?"p+1" and "q+1" is still blurry tome? Likewise "0L"