similar to: how to use if statement in function correctly

Displaying 10 results from an estimated 10 matches similar to: "how to use if statement in function correctly"

2009 Mar 04
1
nice way to find or not a value (problem with numeric(0))
Hello, I have a data.frame called spec containing data about samples. But I don't have these data for all my samples. So if I have data (that is code of the sample is in spec$Code), I would like to assign data1 to the variable m. If I don't have this data, I would like to assign 1 to m. I tried this : m<-spec$data1[spec$Code==code]*(code %in%specmodules$Code) + 1*(!code %in%
2008 Oct 01
2
an unsophisticated question about recoding in a data frame with control structure if {}
Hello all, I apologize for a terribly simple question. I'm used to using Stata and am trying to `switch' over to R. I would like to recode a vector in a data frame when the value of it meets the following condition: if (dataframe$factor=='3'){dataframe$thevector<-(an arithmetic mean). What I would like to result is the creation of a new variable within the data frame for
2008 Jun 25
1
a loop....
I'm trying to make a loopo with some file.... > > library(dplR) > files.rwl <- system("ls *.rwl", intern=TRUE) > files.rwl [1] "cimfasy.rwl" "rocquce.rwl" > for (i in files.rwl) assign(gsub("\\.rwl$", "_rwl", i), read.rwl(i, header=0)) There are 70 series There are 21 series > > cimfasy_rwl 1990 1.55 0.00
2007 Nov 22
3
[PATCH] one-time ssh-agent confirmation password
The patch (against 4.7p1) modifies gnome-ssh-askpass to optionally generate a one-time password and transmits it to the user via an out-of-band communication channel. If you can read the password and enter it back into the gnome-ssh-askpass dialog, ssh-agent is allowed to continue with the authentication process. There are two ways to use the modified gnome-ssh-askpass. The first
2007 Nov 24
7
[Bug 1393] New: patch modifies gnome-ssh-askpass to optionally use one-time password
https://bugzilla.mindrot.org/show_bug.cgi?id=1393 Summary: patch modifies gnome-ssh-askpass to optionally use one- time password Classification: Unclassified Product: Portable OpenSSH Version: 4.7p1 Platform: All URL: http://www.swcp.com/~pgsery OS/Version: Linux Status: NEW Keywords:
2009 Jan 29
4
Text in a character vector to indicate "ifelse" argument
Hello I have a data set that looks like this; > b2 dato chr status PRRSvac PRRSsanVac PRRSsanDk PRRSdk 33 2007-12-03 090432 R?d SPF 34 2007-02-09 090432 R?d SPF+sanDK 35 2002-12-17 090432 R?d SPF+DK 36 2002-11-27 090432 R?d SPF+sanDK 37 2002-07-23
2010 Nov 26
0
contour figure from rsm
Dear r users, I wanted to perform contour figure from response surface model result. I typed this: > model = rsm (Index ~ SO(NV, SKLON, pH), bonita) > summary(model) > par(mfrow = c(2, 3)) > contour (model, ~NV+SKLON+pH) However, I got the error answer as follows: Error in lmobj$data[, nm] : object of type 'environment' is not subsettable Has someone any suggestions to
2009 Apr 14
3
scatterplot3d
Dear R-help, I am having trouble with your scatterplot3d program. For help with this problem I was directed to your address by Martin Maechler at " r-core-bounces at r-project.org." I'm also sending a CC to " r-core-owner at r-project.org" as I'm not yet certain of the proper address to use for this. I have R version 2.8.1 and have downloaded 'scatterplot3d.'
2012 Aug 03
1
Multiple Comparisons-Kruskal-Wallis-Test: kruskal{agricolae} and kruskalmc{pgirmess} don't yield the same results although they should do (?)
Hi there, I am doing multiple comparisons for data that is not normally distributed. For this purpose I tried both functions kruskal{agricolae} and kruskalmc{pgirmess}. It confuses me that these functions do not yield the same results although they are doing the same thing, don't they? Can anyone tell my why this happens and which function I can trust? kruskalmc() tells me that there are no
2009 Jan 28
2
t.test in a loop
Hi All, I've been having a little trouble with creating a loop that will run a a series of t.tests for inspection, Below is the code i've tried, and some checks i've looked at. I've used the get(paste()) idea as i was told previously that the use of the eval should try and be avoided. I've run a single syntax to check that my systax is correct and works without any problems