Displaying 7 results from an estimated 7 matches for "sklon".
Did you mean:
salon
2002 Sep 19
5
how to use if statement in function correctly
...f statement in my function to work as I want (but I am not very
successful:(
My question is why my function with if statement is evaluated correctly in case of
atomic variables and incorrectly in case of vector variables.
Here is an example:
#function with if statement
fff <- function(otac,sklon)
{
test <- (otac * 3.69683+286.6*(1/sklon)-0.03100345*otac*sklon)
if(test<65)
{otac/sklon * 141.76}
else
{otac * 3.69683+286.6*(1/sklon)-0.03100345*otac*sklon}
}
> fff(20,70)
[1] 40.50286
# correct
> fff(50,70)
[1] 80.42371
#correct
> fff(seq(20,50,5),70)
[1] 40.50286 50.62857...
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%
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 solve this?
Thanks to all,
Michal
____...
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
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
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