Displaying 20 results from an estimated 600 matches similar to: "Applying a function"
2011 Oct 07
5
Find a particular point on a curve
Hi,
my question is really precise.
I'm interested in drops of stomacal temperature (of seal pups) following
milk ingestion. Temperature starts at an average of 37.8oC (sd=0.2) and
drops rapidly to around 36.0oC and then stabilizes slowly to a temperature
silimar to the previous one. It looks a bit like an inverse skewed bell
curve.
I want to find different points on that curve, and I have a
2011 Aug 16
2
Assignment working differently inside ifelse()
Hello all, I need to extract rows and columns from a data frame and put
them in a matrix. In some cases, there are no rows in the data frame
meeting the selection criteria. For those rows I want to put a row of
0's in the matrix. Here's my clumsy code:
tab1.m1 <- matrix(0, nrow=2, ncol=4)
tab1.m1[1,] <- ifelse(length(as.matrix(tab1[tab1$comp==the.comp & tab1$schlid==the.schl
2011 Mar 15
1
Problem with nls.lm function of minpack.lm package.
Dear R useRs,
I have a problem with nls.lm function of minpackl.lm package.
I need to fit the Van Genuchten Model to a set of data of Theta and hydraulic conductivity with nls.lm function of minpack.lm package.
For the first fit, the parameter estimates keep changing even after 1000 iterations (Th)
and
I have a following error message for fit of hydraulic conductivity (k);
Reason for
2005 Jul 27
2
How to delete rows
Dear R-users,
I am very new to R, so maybe my question is very easy to answer.
I have the following table:
TAB1<-data.frame(Name,Number), "Name" and "Number" are all character
strings,
it looks like this:
Name Number
ab 2
ab 2
NA 15
NA 15
NA 15
cd 3
ef 1
NA 15
NA 15
gh 15
gh 15
I want to delete all the rows
2013 Apr 10
6
means in tables
Hi.
I have 2 tables, with same dimensions (8000 x 5). Something like:
tab1:
V1 V2 V3 V4 V5
14.23 1.71 2.43 15.6 127
13.20 1.78 2.14 11.2 100
13.16 2.36 2.67 18.6 101
14.37 1.95 2.50 16.8 113
13.24 2.59 2.87 21.0 118
tab2:
V1 V2 V3 V4 V5
1.23 1.1 2.3 1.6 17
1.20 1.8 2.4 1.2 10
1.16 2.6 2.7 1.6 11
1.37 1.5 2.0 1.8 13
1.24 2.9 2.7 2.0 18
I need generate a table of averages, the
2005 Oct 27
2
F tests for random effect models
Dear R-users,
My question is how to get right F tests for random effects in random effect models (I hope this
question has not been answered too many times yet - I didn't find an answer in rhelp archives).
My data are in mca2 (enc.) :
names(mca2)
[1] "Lignee" "Pollinisateur" "Rendement"
dim(mca2)
[1] 100 3
replications(Rendement ~ Lignee *
2008 Feb 13
2
apply on large arrays
I have a big contingency table, approximately of size 60*2*500*500,
and I need to count the number of cells containing a count of 1 for each
of the factors values defining the first dimension.
Here is my attempt:
tab1<-with(pisa1,table(CNT,GENDER,ISCOF,ISCOM))
tab2<-apply(tab1,1:4,function(x)ifelse(sum(x)==1,1,0))
tab3<-apply(tab2,1,sum)
Computing tab2 is very slow.
Is there a faster
2013 Feb 11
2
How to plot doubles series with different location using plotCI
Dear list
members,
I would
like to create two series of plotted mean values and error bars, yet with
different locations along the x-axis.
Plotting of
first series using plotCI with the standard arguments goes without any problem.
However I do not succeed to add the second series in the same plot, which
should be horizontally shifted from the first series along the x-axis. The “add=TRUE”
2010 Jul 25
1
Left Outer Join 2 DF's on Multiple Conditions
Hi,
I am trying to execute the following SQL statement using two data frames:
tab1, tab2 : Two Tables
Select tab1.*, tab2.*, tab1.tobiiTime - tab2.ruiTime as timeDiff,
IFNULL(n-m, -9999999) as alwaysIncrement
FROM tab1
LEFT OUTER JOIN tab2 On tab1.data1 - tab2.mouseX = 0 And tab1.data2 -
tab2.mouseY = 0
I am trying to do the following in R:-
*#Getting error here:*
data
2010 May 26
3
shapiro.test
Hi,
I am not so sure about an error note I got when using shapiro.test.
I imported some data into R by wrinting it into a .txt file via
> tab1<-read.table("etc....txt",header=T)
> attach(tab1)
The following object(s) are masked _by_ .GlobalEnv :
ozon
> ozon$V1 [1] 2.5 3.0 5.6 4.7 6.5 6.7 1.7 5.3 4.6 7.4 5.4 4.1 5.1 5.6 5.4 6.1 7.6[18] 6.2 6.0 5.5 5.8 8.2 3.1 5.8 2.6
Now
2006 Oct 27
3
How to best divide table by table
Hi all,
how can I divide two tables of the same dimension so that all names are
preserved, ie do not become NA? I have "tab1" and "tab2", each having
names in the first column. I want "tab3" with the same names and values
"tab1/tab2".
Thanks,
Serguei
2006 Nov 21
2
keeping dim() for array
Hi All,
I noticed the following:
pip = array(1:6, dim = c(3,2))
dim(pip)
[1] 3 2
pup = pip[1,]
dim(pup)
NULL
I bet there is a *good* reason why one row of an array is *dimensionless*, but
it's highly inconvenient for my purpose, i.e. to use apply() after an array goes
through a number of logical steps and is redimensioned, sometimes to one single row.
How do I keep dim(pup) to 1 2?
2011 Oct 29
1
Refresh tab content on click in JQuery UI Tabs
HI Guy''s
TAB1 and TAB2 have some radio button, checkbox and dropdown menu. When
TAB1 is selected, I have to switch to TAB2 and then back to TAB1 to refresh
the loaded content.
How to make TAB1 refresh loaded content when click on its tab?
*code is something like that*
<ul class="tabs">
<li><a *href="#tab1"*>Gallery</a></li>
2005 Jun 24
1
comparing strength of association instead of strength of evidence?
Hi,
I asked this question before, which was hidden in a bunch of
questions. I repharse it here and hope I can get some help this time:
I have 2 contingency tables which have the same group variable Y. I
want to compare the strength of association between X1/Y and X2/Y. I
am not sure if comparing p-values IS the way even though the
probability of seeing such "weird" observation under H0
2005 Oct 28
2
Random effect models
Dear R-users,
Sorry for reposting. I put it in another way :
I want to test random effects in this random effect model :
Rendement ~ Pollinisateur (random) + Lignee (random) + Pollinisateur:Lignee (random)
Of course :
summary(aov(Rendement ~ Pollinisateur * Lignee, data = mca2))
gives wrong tests for random effects.
But :
summary(aov1 <- aov(Rendement ~ Error(Pollinisateur * Lignee), data =
2010 Apr 24
2
table command
Hi,
Let s be a dataframe.
> s
A B C
0 0 1
1 0 1
1 0 1
0 0 1
1 0 1
0 1 1
0 1 1
0 1 1
0 0 1
> tab1=table(s[,c(1,2)])
> tab1
B
A 0 1
0 3 3
1 3 0
> tab2=table(s[,c(1,3)])
> tab2
C
A 1
0 6
1 3
The problem is I need to access frequency corresponding to (0,0).
tab1[1] will give me the correct value
2009 Dec 22
2
Nested For loops
Dear R experts,
Might be very simple question to ask but would be insightful. As the same story of nested "for loops". following is the code that I am using to get the autocorrelation function of the sample data. I have tried to get rid of for loops but since I am touching R after such a long time that I need to practice more but I need help to revive my skills. I know that apply() or
2008 Sep 12
2
Fw: Complex sampling survey _ Use of survey package
--------------------------------------------------
From: "Ahoussou Sylvie" <sylvie.ahoussou at antilles.inra.fr>
Sent: Friday, September 12, 2008 9:48 AM
To: "Thomas Lumley" <tlumley at u.washington.edu>
Subject: Re: [R] Complex sampling survey _ Use of survey package
> Thanks for your answer
>
> I think I made a mistake when I recopied the 5 first rows of
2010 Jul 14
2
count - help
Hi,
I have a data frame with several factors and I want to count the occurrences
of an event resulting from an interaction of some factors.
I tried to do several tables (and then converting to d.f and then merge them
by one factor and the freq
Tab1 <- merge (BPorAmost,BPorSector,by=c('Sample','Freq'))
Tab1 <- merge (Tab1,BPorDist,by=c('Sample','Freq'))
Tab1
2010 Jun 02
2
pup problem
Hello!
On May 28, I had a problem with pup and seamonkey. I was doing an
update via pup and reading a page via seamonkey; seamonkey froze with a
plain brown screen. I waited awhile, and then did the
press-the-power-button-until-it-shuts-off. However, I don't know
whether it was seamonkey or pup that actually caused the freeze, but
apparently pup did not do its updating job correctly.