similar to: Help get this simple function to work...

Displaying 20 results from an estimated 300 matches similar to: "Help get this simple function to work..."

2009 Jul 13
2
Help me get this function to work...
I have a function (see below). This function has one object, ID. If I run the loops by itself using a character value (ie,"VFFF1-7"), then the loops work fine. However, when I try to insert the character value via the function call, it doesn't work. I don't get an error, but the TotalCover.df dataframe does not update according to the loop criteria. Any obvious problems that
2011 Mar 29
2
List extraction
I have created a list of tables with the same columns but different number of row. Example (actual list has ~200 elements): > temp1<- data.frame(ID=c("Herb","Shrub"),stat=c(4,5),pvalue=c(.03,.04)) > temp2<- data.frame(ID=c("Herb","Shrub", > "Tree"),stat=c(12,15,13),pvalue=c(.2,0.4,.3)) > L<-list(a=temp1,b=temp2) > L $a
2009 Aug 19
2
how do i vectorize relational queries in R
I am basically trying to append a value(vector) to one dataframe using a relational value from another dataframe. Obviously, I can use a loop to accomplish this. However, is there a way to vectorize it? Example: > data <- data.frame(c(1,1,1,2,2,2,3,3,3),rep(2,9)); names(data) <- > c("Sample","Score") > meta <-
2008 Aug 29
1
significance of random effects in poisson lmer
Hi, I am having problems trying to assess the significance of random terms in a generalized linear mixed model using lme4 package. The model describes bird species richness R along roads (offset by log length of road log_length) as a function of fixed effects Shrub (%shrub cover) and Width (width of road), and random effect Site (nested within Site Cluster). >From reading answers to previous
2003 Jul 22
1
Making a group membership matrix
Hi Helpers: I have a factor object that has 314k entries of 39 land cover types. (This object can be coerced to characters neatly should that be easier to work with.) > length(foo) [1] 314482 > foo[1:10] [1] Montane Chaparral Barren Red Fir Red Fir [5] Red Fir Red Fir Red Fir Red Fir [9] Red Fir Red Fir 39 Levels:
2011 Jan 09
1
Rectangle height in lattice xyplot key
Dear All I have a problem with the height of the boxes in the key in the following. (The text is over 2 lines to accentuate the problem of no space between the rectangles.) Is there an easy way to put a space between the rectangles; size controls the width but there appears to be nothing for the height? xyplot(1~1, key = list(corner = c(0.8,0.8),
2010 Jun 23
1
Shapefile
Hopefully the attachment will make it this time... Hi: I am practicing with the attached shapefile and was wondering if I can get some help. Haven't used 'rgdal' and 'maptools' much but it appears to be a great way bring map data into R. Please take a look at the comments and let me know if I need to explain better what I am trying to accomplish. library(rgdal)
2006 Mar 04
1
replicated time series - lme?
Dear R-helpers, I have a time series analysis problem in R: I want to analyse the output of my simulation model which is proportional cover of shrubs in a savanna plot for each of 500 successive years. I have run the model (which includes stochasticity, especially in the initial conditions) 17 times generating 17 time series of shrub cover. I am interested in a possible periodicity of shrub
2012 Nov 28
3
Conditional model in R
Hello all, I have a data set where the response variable is the percent cover of a specific plant (represented in cover classes 0,1,2,3,4,5, or 6). This data set has a lot of zeros (plots where the plant was not present). I am trying to model cover class of the plant as a function of both total nitrogen and shrub cover. After quite a bit of research I have come across a conditional approach
2008 Jan 18
3
Problems with lattice plot
Hello useRs, I have some problems when I try to plot a lattice. The lattice has 200 columns (X value) and 5 rows (Y value), with a total of 1000 squares. I want to plot this lattice with the squares having different colours according to a variable value. The variable I want to plot is cover value of a shrub, and it has values between 0 and 1. I want to plot the squares with value 1,
2010 Nov 09
2
new column from column in another df
If I have a data frame where a species occupies several rows with different phases such as (both col's ar factors): species,phase Populus tremula,1 Populus tremula,2 Populus tremula,3 Calluna vulgaris,1 Calluna vulgaris,2 Betula alba,1 Betula alba,2 Betula alba,3 Primula veris,1 Primula veris,2 and another df where each species only have one row: species,growth_form Populus tremula,tree Acer
2008 Dec 01
1
Spatstat - K2 index
Hi all, I'm using spatstat to investigate the spatial structure of an arid shrub population. The first-order intensity of my data does not appear to be homogenous, so I would like to use inhomogeneous techniques. I realise there is a inhomogeneous K-function available in spatstat, but there doesn't not appear to be one for the pair-correlation function (O-ring statistic). As such I was
2010 Jun 23
1
Plotting Data on a Map
Hi: I am practicing with the attached shapefile and was wondering if I can get some help. Haven't used 'rgdal' and 'maptools' much but it appears to be a great way bring map data into R. Please take a look at the comments and let me know if I need to explain better what I am trying to accomplish. library(rgdal) library(maptools) library(ggplot2) dsn="C:/Documents and
2008 Jan 15
1
error in my selection
Hi everybody, Well, I really hoped that until now i know how to do a selection ..... but obviously i don't. So risking your laughing at me - here you go. I have a table with lots of vegetation data, and one column specifies in which region the data is. There are only 2 regions, region 1 and region 3. I want to select all data that belong to region 1 and after do some xtabs on it. If i do
2005 Nov 25
1
glmmPQL
Hi, My name is Jos?? Mar??a G??mez, and I am pretty new in R. Thus, I apologize deeply if my questions are extremmely na??ve.I have checked several available books and URL's, without finding any answer. I'm trying to fit Generalized Linear Mixed Models via PQL. Below I provide the structure of my data set. Year and Plot are random variables. Fate is the binomial dependent. I have severe
2009 Jan 26
1
glm StepAIC with all interactions and update to remove a term vs. glm specifying all but a few terms and stepAIC
Problem: I am sorting through model selection process for first time and want to make sure that I have used glm, stepAIC, and update correctly. Something is strange because I get a different result between: 1) a glm of 12 predictor variables followed by a stepAIC where all interactions are considered and then an update to remove one specific interaction. vs. 2) entering all the terms
2008 Oct 22
1
Spatstat help - quadratcount query
Hi all, I am using quadratcount in spatstat to divide a window containing a point pattern into a grid of quadrats containing the intensity of points in each quadrat. My data is in UTM co-ordinates. My window is defined as follows: >p15<-ppp(x,y,window=owin(c(341710,342100),c(3126465,3126780)),marks=NUL L, checks=TRUE) Giving me a distance of 390m in the 'x' direction and 315m in
2009 Dec 08
1
Quadratcount problem in spatstat
Hi, I know there are older threads discussing the quadratcount function in spatstat. Unfortunately, I could not find a solution to my problem there. I'm analyzing a point pattern in an irregular polygonal window. Both the window (an entire country) and the points are projected using WGS84. When I do quadratcount with only one quadrat for the entire country it holds all my 154 points:
2005 Dec 05
2
lmer and glmmPQL
I have been looking into both of these approaches to conducting a GLMM, and want to make sure I understand model specification in each. In particular - after looking at Bates' Rnews article and searching through the help archives, I am unclear on the specification of nested factors in lmer. Do the following statements specify the same mode within each approach? m1 = glmmPQL(RICH ~ ZONE,
2010 Jun 24
0
rgdal-maptools
The shapefile data can be downloaded from the link below: download all the six files and save them on your working directory and make sure the dsn path is set to where the files are saved. My shapefiles are saved on C:/Data. https://secure.filesanywhere.com/fs/v.aspx?v=897263875a6472a99baa Hi: I am practicing with the attached shapefile and was wondering if I can? get some help. Haven't