Displaying 20 results from an estimated 200 matches similar to: "accessing variables inside a function, inside a loop"
2011 Mar 07
4
png inside loop
hello list! I'm sorry, I just stumbled over this strange behaviour (at
least I am not able to explain the behaviour, therefore I assume it to
be a strange behaviour):
attach(water) # I know, this is not recommended
names(water[3:10])
[1] "temp" "pH" "DO" "BOD" "COD" "no3" "no2" "po4"
for (i in
2011 Oct 09
1
sapply(pred,cor,y=resp)
Hello. I am wondering why I am getting NA for all in cors=sapply(pred,cor,y=resp). I suppose that each column in pred has NAs in them. Is there some way to fix this? Thanks
> str(pred)
'data.frame': 200 obs. of 13 variables:
$ mnO2: num 9.8 8 11.4 4.8 9 13.1 10.3 10.6 3.4 9.9 ...
$ Cl : num 60.8 57.8 40 77.4 55.4 ...
$ NO3 : num 6.24 1.29 5.33 2.3 10.42 ...
$ NH4 : num 578
2009 Sep 13
2
zoo plot: yearly marks on X-Axis
On Sun, 2009-07-26 at 13:17 +0200, Poersching wrote:
> stvienna wiener schrieb:
> > Hi all,
> >
> > I am plotting a financial time series, but I need a more detailed X-Axis.
> >
> > Example:
> > x <- zoo(rnorm(1:6000), as.Date("1992-11-11")+c(1:6000))
> > plot(x)
> >
> > The X-Axis is labeled "1995", "2000"
2011 Mar 18
1
general question about dropping terms of glm model fits
hello dear list!
as I am currently helping someone with their statistical analysis of a
count survey, I stumbled upon a very basic question upon model optimization:
when fitting a model like:
model<-lmer(abundance~(x+y+z)^3,family=poisson,...)
in which x,y,z are continuous abiotic parameters such as po4
concentration, no2-concentration, which terms / interaction terms would
you recommend
2009 Sep 11
1
format (?) problems with data imported from postgres
Good day,
I read some data from a PostgreSQL database by a following script:
library(Rdbi)
library(RdbiPgSQL)
# conn becomes an object which contains the DB connection:
conn <- dbConnect(PgSQL(), host="localhost", dbname="BVS",
user="postgres", password = "*******")
query_duj_kal <- dbSendQuery(conn, "select zdroj as well, cas as date,
fe2,
2011 Jan 10
3
Help with Data Transformation
Greetings,
I am new to R and am having trouble with parsing a file with the following characteristics:
* Individual results for a single sample are written to multiple lines.
* First 16 columns are constant from sample to sample.
* Remaining 10 need to be matched up (cross-tabbed?)
o (the exact contents for the remaining 10 vary from sample to sample, as indicated in
2011 Nov 29
5
Why Numeric Values Become Factors in Data Frame
I have a data frame with 1 factor, one date, and 37 numeric values:
str(waterchem)
'data.frame': 3525 obs. of 39 variables:
site : Factor w/ 64 levels "D-1","D-2","D-3",..: 1 1 1 1 1 ...
$ sampdate : Date, format: "2007-12-12" "2008-03-15" ...
$ CO3 : num 1 1 6.7 1 1 1 1 1 1 1 ...
$ HCO3 : num 231 228 118 246
2009 Feb 03
3
non linear regression with nls
Hello,
I'm a beginner with R and it's the first time I'm using the R-help list... I hope I'm in the right place, if not:
Sorry!!
I need to do non linear regressions on a data set which columns are:
"river.name" "Portata" "PTG.P" "PO4.P" "NT.N" "NH4.N" "NO3.N" "BOD5" "SiO2"
2005 Dec 08
2
'mean' and 'sd' calculations do not match
Dear list,
I am using R 2.1.1 on a Fedora 3 Linux, 32 bit PC.
If I compute the aggregated mean and the standard deviation I get
standard deviation values for factors where the mean was not computed.
It seems to me that this is somehow related to the NA values. But I
don't quite understand what is going wrong?
Could it be related to the data import already? Some of the imported
data got the
2008 Jan 25
4
Function for translation of a list into a matrix as used by ordination?
Hello.
Does anyone know of an existing function that takes a list in the form of:
Plot1 Species1 Abundance1
Plot1 Species2 Abundance2
Plot2 Species1 Abundance1
Plot2 Species3 Abundance3
.
.
.
PlotN SpeciesN AbundanceN
and translates into a matrix in the form of
Species1 Species2.... SpeciesN
Plot1 Abundance1 Abundance2... AbundanceN
Plot2 Abundance1
2009 Apr 20
7
Fitting linear models
I am not sure if this is an R-users question, but since most of you here
are statisticians, I decided to give it a shot.
I am using the lm() function in R to fit a dependent variable to a set
of 3 to 5 independent variables. For this, I used the following
commands:
>model1<-lm(function=PBW~SO4+NO3+NH4)
Coefficients:
(Intercept) SO4 NO3 NH4
0.01323 0.01968
2013 Apr 12
2
Creating "%d/%m/%Y %H:%M:%S" format from separate date and time columns
Hi R forum,
Each row of my data (below) show a new contact event between animals.
In order to ultimately look at the patterns of intervals between
contacts, I need to calculate a contact end time. The contact starts
at the date and time shown in V4 and V5, and lasts for the duration
shown IN SECONDS in V6:
> data2<- read.csv(file=file.choose(), header=F, sep=" ")
>
2009 Jul 25
1
yaxp problem for more irregular time series in one plot
Good day,
I'm trying to get more time series in one plot. As there are bigger
differences in values of variables I need logaritmic y axis.
The code I use is the following:
nvz_3_data <- read.csv('/home/tomas/R_outputs/nvz_3.csv')
date <- (nvz_3_data$date)
NO3 <- (nvz_3_data$NO3)
NH4 <- (nvz_3_data$NH4)
date_p <- as.POSIXct(date, "CET")
par(mfrow=c(2,1), ylog
2002 Jun 06
2
covariance analysis model
Dear list users,
I have trouble with covariance analysis.
I measured nitrate concentrations in the soil (NO3) and the percentage of
legumes (LEG, continuous), affected by 2 different CO2 concentrations (CO2,
discrete). I suspect that CO2 has an effect on LEG and NO3, but also that
LEG has an effect on NO3, so this is the formula I wrote to test this:
NO3 ~ CO2 + LEG + CO2:LEG
Will LEG be
2007 Jun 15
1
interpretation of F-statistics in GAMs
dear listers,
I use gam (from mgcv) for evaluation of shape and strength of relationships
between a response variable and several predictors.
How can I interpret the 'F' values viven in the GAM summary? Is it
appropriate to treat them in a similar manner as the T-statistics in a
linear model, i.e. larger values mean that this variable has a stronger
impact than a variable with smaller F?
2009 Oct 26
1
issue with levels of a factor after subsetting
Hi
Second question in a day, i'm beginnning to feel incompetent...
This time i'm having a weird problem, i'm importing the next data base:
>car<-read.csv2("Historicos.csv")
'data.frame': 1818 obs. of 6 variables:
$ Dpto : Factor w/ 11 levels "ANTIOQUIA","ATL?NTICO",..: 2 2 2 2 2 1
1 1 1 5 ...
$ Rio : Factor w/ 43 levels
2007 Oct 03
0
datasets
Hi, my name is Luis, and I have a problem with a dataset.
Its name is algae and count the collection of data in a lake and respective
proliferation of algae.
The parameters that it has are: "mxPH", "mnO2", "Cl", "NO3" "NH4", "oPO4",
"PO4", "Chla" and "a1" all numerics.
a1 - algae1
If I try to do SVM with
2006 May 17
1
Fix for augPred/gsummary problem (nlme library)
Dear R-users,
I am a newbie to this site and a relative new-comer to S/R, so please tread lightly, for you tread...
There have been several posting relating to problems with augPred() from the nlme library. Here is a "fix" for one of these problems which may lie at the root of others.
In my case the problem with augPred() lay in gsummary(), which augPred() uses, causing it to fail.
2011 Jan 13
0
Help with Data Transformation - RESOLVED
Hi Dennis,
SOLVED!!!
My thanks to both you, John, and others who chimed in. Took a little more digging before finally working, but it is working!
Here's a little more of what I did and the ultimate resolutions:
I installed the reshape2 library from CRAN.
Executed
> (.packages())
[1] "reshape2" "stats" "graphics" "grDevices"
2008 Jan 31
1
winbind problem
Hi everyone,
I recently bought a qnap TS-209Pro [www.qnap.com].
This embeds samba 3.0.23d.I configured it to connect to our Active
Directory, but as soon as I set winbind enum users and winbind enum groups
to "yes" in the /etc/smb.conf file, winbindd uses 100% of CPU. I've googled
the problem and found a lot of problems, less solutions... Does anybody have
a clue on this ?
I have