similar to: if value is in vector, perform this function

Displaying 20 results from an estimated 100 matches similar to: "if value is in vector, perform this function"

2007 Sep 09
2
Batch mode scenario ("use case")
Hello, I came up with this scenario of the use of batch mode while thinking of back-up schemes to use for myself. However, it could be that the last step needed in this scenario is not supported by rsync! Here's the scenario: At one time, /c/home/wer/work and /e/gold had identical content and were really huge (say, 200 GBytes). After some complex, intricate work, Mr. Wer
2011 Nov 15
1
Estimating model parameters for system of equations
Hi all, I'm trying to estimate model parameters in R for a pretty simple system of equations, but I'm having trouble. Here is the system of equations (all derivatives): eqAlgae <- (u_Amax * C_A) * (1 - (Q_Amin / Q_A)) eqQuota <- (p_max * R_V) / (K_p + R_V) - ((Q_A-Q_Amin)*u_Amax) eqResource <- -C_A * (p_max * R_V) / (K_p + R_V) eqSystem <- list(C_A = eqAlgae, Q_A = eqQuota,
2008 Aug 11
1
Logistic regression on aggregate data
Hi, I want to run a logistic regression on summary data and I was not able to find the adequate R function to do so. The data is summarized daily and instead of the binary y_t I have n_d and m_d, where is the number of instances in which a choice could have been made and m_d is the number of instances in which the choice was made. The other characteristics have been averaged throughout the day.
2012 Feb 14
3
Wildcard for indexing?
Hi, I'd like to know if it is possible to use wildcards * for indexing... E.g. I have a vector of strings. Now I'd like to select all elements which start with A_*? I'd also need to combine that with logical operators: "Select all elements of a vector that start with A (A*) OR that start with B (B*)" Probably that is quite easy. I looked into grep() which I think might
2006 Dec 30
2
search on multiple table
Hello, I am trying to make a search, using acts_as_ferret on a has_and_belongs_to_many relation : class a < ActiveRecord::Base belongs_to :b has_and_belongs_to_many :c Joboffer.find_by_contents( query +b_id:1 ) is working fine but Joboffer.find_by_contents( query +c:1 ) is not working Here are the tables descriptions: Table a have field : id, b_id Table b have field : id,
2009 Nov 22
1
How to make a matrix of a number of factors?
I use the following code to generate a matrix of factors. I'm wondering if there is a way to make it more general so that I can have any number of factors (not necessarily 5). a=3 b=4 c=5 d=6 e=7 A=1:a B=1:b C=1:c D=1:d E=1:e X=matrix(nr=a*b*c*d*e,nc=5) for(i_a in 1:a-1) { for(i_b in 1:b-1) { for(i_c in 1:c-1) { for(i_d in 1:d-1) { for(i_e in 1:e-1) { X[(((i_a
2010 Feb 09
1
"1 observation deleted due to missingness" from summary() on the result of aov()
I have the R code at the end. The last command gives me "1 observation deleted due to missingness". I don't understand what this error message. Could somebody help me understand it and how to fix the problem? > summary(afit) Df Sum Sq Mean Sq F value Pr(>F) A 2 0.328 0.16382 0.1899 0.82727 B 3 2.882 0.96057 1.1136 0.34644 C
2009 Nov 22
1
Why F value and Pr are not show in summary() of an aov() result?
I have the following code. I'm wondering why summary() doesn't show F value and Pr? Rscript multi_factor.R > a=3 > b=4 > c=5 > d=6 > e=7 > > A=1:a > B=1:b > C=1:c > D=1:d > E=1:e > > X=matrix(nr=a*b*c*d*e,nc=5) > colnames(X)=LETTERS[1:5] > > for(i_a in 1:a-1) { + for(i_b in 1:b-1) { + for(i_c in 1:c-1) { + for(i_d in 1:d-1) { +
2010 Apr 15
1
can't find "daphnia.txt" and others while working through Crawley's R-Book
I have a feeling that this is an embarassingly simple fix, but I've been at it for most of the morning and can't get things figured out. I'm trying to work through some examples in Crawley's "The R Book". I have installed packages and libraries as described in the book, but when I try, for example: data<-read.table("c:\\temp\\daphnia.txt", header=T)
2012 Aug 10
2
Zoo object problem: Find the column name of a univariate zoo object
Hi everyone and Achim, Achim, I appreciate your help about the function "NCOL". When I use "NCOL" instead of "ncol", I can find out the number of columns (number of time series) in the presence of only one time series (one variable, one column). Now I want to know how I can find out the column names of the zoo objects? In case of more than one time series, the
2012 Aug 09
1
Zoo object problem: problem when I attempt to create a zoo object of only one column
Hi, Part of my program is to calculate the number of time series in a zoo object. It works well if it has more than one time series, but it fails if it has only one. How can I access the number of column (i.e. the number of time series) when I have only one column? Why is the number of an object of only one object "NULL"? It should be one, shouldn't it? (The following example
2011 Jul 27
1
Converting F-value from ANOVA to cohen's d in meta-analysis (metafor-package)
Dear R-experts! Running a meta-analysis (using the magnificent metafor-package), I use cohen's d as a main outcome measure in a random-effects model. For most of the samples cohen's d is derived form a comparison of two groups (A & B). However some studies report results from an ANOVA (one-factor with three levels: C,D,E) whereas two groups (C,D) correspond to one group in the other
2010 Oct 26
4
divide column in a dataframe based on a character
Hello, If I have a dataframe: example(data.frame) zz<-c("aa_bb","bb_cc","cc_dd","dd_ee","ee_ff","ff_gg","gg_hh","ii_jj","jj_kk","kk_ll") ddd <- cbind(dd, group = zz) and I want to divide the column named group by the "_", how would I do this? so instead of the first row being x
2004 Aug 04
4
ERROR: compilation failed for package 'rgl'
X-BeenThere: r-help at stat.math.ethz.ch X-Mailman-Version: 2.1.5 Precedence: list Reply-To: korponai.janos at nyuduvizig.hu List-Id: "Main R Mailing List: Primary help" <r-help.stat.math.ethz.ch> List-Unsubscribe: <https://www.stat.math.ethz.ch/mailman/listinfo/r-help>, <mailto:r-help-request at stat.math.ethz.ch?subject=unsubscribe> List-Archive:
2010 Aug 19
1
Help with Vectors and conditional functions
Good morning, I have something like this: names(coint_tests) <- apply(b,2,paste, collapse="_") which prints 15 names like: A_B, C_D, E_F, ... AA,B,C,D.. Are time series. Then there is a vector called coint_tests of length 15 which yields "yes" or "no". I need to add a function to plot the time series Ai_Bi if the coint_tests vectors gives me a "YES".
2009 Aug 28
1
problems with strsplit using a split of ' \\\ ' : a regex problem
I have a vector of gene symbols, some of which have multiple aliases. In the case of an alias, they are separated by ' \\\ '. Here is a real world example, which would represent one element of my vector: Eif4g2 /// Eif4g2-ps1 /// LOC678831 What I would like to do is input the vector into a function and output a vector with just the first alias of each element (or, if there are no aliases,
2010 Apr 15
4
Does "sink" stand for anything?
Hello Everyone,   Learning about R and its wonderful array of functions. If it's not obvious, I usually try to find out what a function stands for. I think this helps me remember better.   One function that has me stumped is "sink." Can anyone tell me if this stands for something?   Thanks,   Paul         __________________________________________________ [[alternative HTML
2010 Jun 03
3
Nested ANOVA with covariate using Type III sums of squares
Hello, I have been trying to get an ANOVA table for a linear model containing a single nested factor, two fixed factors and a covariate: carbonmean<-lm(C.Mean~ Mean.richness + Diversity + Zoop + Diversity/Phyto + Zoop*Diversity/Phyto) where, *Mean.richness* is a covariate*, Zoop* is a categorical variable (the species), *Diversity* is a categorical variable (Low or High), and
2006 Oct 03
1
HP Toolbox kills Samba
Hi, I've encountered the following problem at a client. The problem results in one or more of the smbd processing continuously grabbing more and more memory until the system runs out of memory or just becomes unusable due to a low memory condition. This error is extremely serious as the entire server is eventually brought down by one error. After debugging this error at the
2020 Feb 27
2
[PATCH] Update the 5 year logo to 10 year logo
Already outdated, but rounded ;) I literally just opened the 5yrs logo, changed the text and then done: inkscape -z -o logo/fish-10yrs.{png,svg} cp {logo,website}/fish-10yrs.svg and then updated the rest of the files. Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- Makefile.am | 2 + logo/fish-10yrs.png | Bin 0 -> 65790 bytes logo/fish-10yrs.svg |