Displaying 11 results from an estimated 11 matches for "datavar".
2009 Jul 16
9
Please help me understand how arrays are translated in rails
...le but I''m just having trouble making
headway into what is probably a very easy subject.
I understand arrays with at least 4 other languages but with Ruby I
haven''t found a mental connection with how I can assign variables to
arrays..
Take for example:
def calculate_tsos(model, datavar, teamvar, valvar)
var = model.compiled_this_week.find(:all)
var.each_with_index do |rows, i|
puts "#{model} [ Row #{i} | Team ID = #{rows.team_id} | Team =
#{rows.team.name} | #{datavar} = #{rows.__send__(datavar)}"
end
end
This will give me:
TotalOffense [ Row 0 | Team ID =...
2012 Feb 03
3
[fields] image.plot abends with NAs in image.plot.info
...t each
target layer contains values s.t.
* ? target values v: (v > 0) || is.na(v)
* ?i,j: is.na(value(source[i,j])) ? is.na(value(target[i,j]))
I also want, for each layer, to plot both the source and the target.
My plot code is like
plot.layers.for.timestep <- function(source.file, source.datavar,
target.datavar, datavar.name, datavar.n.layers, colors, map) {
# Get the grid origin, cell sizes, cell centers, etc
# ...
pdf("compare.source.target.pdf", height=3.5, width=5, pointsize=1)
for (i.layer in 1:datavar.n.layers) {
# plot the source data
# debugging
print(p...
2010 May 10
1
Problems executing cor(dataset) function in R 2.11.0 for OS X ( It works fine in R 2.10.1)
...ar all,
when trying to replicate John M. Quick's example for correlations between multiple variables posted on:
http://rtutorialseries.blogspot.com/2009/11/r-tutorial-series-zero-order.html
with R 2.11.0 (GUI 1.33) using my MacBook Pro with OX X 10.5.8 I got the following error message
> datavar<-read.csv("dataset_readingTests.csv")
> cor(datavar)
Error in cor(datavar) : 'x' must be numeric
The funny thing is that when I tried to do the same example using R 2.10.1, it worked fine.
Any ideas regarding how to solve this problem?
Many thanks in advance,
Ruben
2012 Nov 09
1
decorating API in R
...ncdf4 users is trying to make it easier (notably for ourselves :-) to write correctly IOAPI-formatted netCDF. Since IOAPI
http://www.baronams.com/products/ioapi/
decorates netCDF, one obvious way to do a package=ioapi is to decorate the netCDF API from package=ncdf4. E.g., to add a data variable (datavar) with the additional IOAPI metadata, ioapi::ncvar_add(...) would call ncdf4::ncvar_add(...), then (e.g.--not complete, strictly for illustration)
* create global attr=VAR-LIST if it does not already exist
* add properly-formatted variable name to VAR-LIST
* add properly-formatted attrs longname, u...
2010 May 17
2
Variable variables using R ... e.g., looping over data frames with a numeric separator
...y.nls.1
fit.var.1
summary.var.1
.....
fData.2
unique.2
fit.nls.2
summary.nls.2
fit.var.2
summary.var.2
.....
fData.L
unique.L
fit.nls.L
summary.nls.L
fit.var.L
summary.var.L
=========
I want to do something like
for(i in 1:L-1)
{
dataStr = gsub(' ','',paste("fData.",i));
dataVar = eval(dataStr);
## GOAL is to grab data frame 'fData.1' and do stuff with it, then in next
loop grab data frame 'fData.2' and do stuff with it
}
#############
in PHP, I would define the string $dataStr = "final.1" and then $dataVar =
$$dataStr which is a variable va...
2010 May 28
0
Problems executing cor(dataset) function in R 2.11.0 for OSX ( It works fine in R 2.10.1)
...oth in R 2.10 and R 2.11)
because there are only numeric values in the matrix and
as.matrix(read.table(..)) now converts the values to numeric by default.
I couldn't check John M. Quick's site, but I think the problem is that
somehow you are loading char string values in your matrix "datavar".
Carlos
On 10/05/2010 7:36 AM, Ruben Garcia Berasategui wrote:
Dear all,
when trying to replicate John M. Quick's example for correlations between
multiple variables posted on:
http://rtutorialseries.blogspot.com/2009/11/r-tutorial-series-zero-order.html
with R 2.11.0 (GUI 1.33) us...
2008 Dec 03
1
help on tapply using sample with differing sample-sizes
...f this is not possible, if there is another way to accomplish what I want to do. Perhaps, tapply is not the best way to go about getting what I want. if so what would all you strong programmers reccommend instead. I am thinking that perhaps loops may be the only way to go.
raoboot <- function (datavar, statavar, weight, nboot, ciqntl, ciqntu)
{
i <- 1
sdatavar <- sort(datavar)
sstratavar <- sort(statavar)
sweight <- sort(weight)
sdatavarwght <- sdatavar*sweight
# stramn <- tapply(sdatavar, sstratavar, mean)
meanvect <- rep(0, times = nboot)
stratasize <- tapply(sd...
2013 Apr 26
1
[newbie] how to find and combine geographic maps with particular features?
...data and plotted using package=rasterVis
http://cran.r-project.org/web/packages/rasterVis/
with code like
https://bitbucket.org/tlroche/gfed-3.1_global_to_aqmeii-na/src/95484c5d63502ab146402cedc3612dcdaf629bd7/vis_regrid_vis.r?at=master
> visualize.layers(
> nc.fp=monthly_out_fp,
> datavar.name=monthly_out_datavar_name,
> layer.dim.name=monthly_out_time_dim_name,
> sigdigs=sigdigs,
> brick=monthly.out.raster,
> map.list <- list(NorAm.shp),
> pdf.fp=monthly_out_pdf_fp,
> pdf.height=monthly_out_pdf_height,
> pdf.width=monthly_out_pdf_width
> )...
barchart error (invalid line type) maybe caused by mangled data frame, & fix() resolving the problem
2005 Mar 02
1
barchart error (invalid line type) maybe caused by mangled data frame, & fix() resolving the problem
...ngs right again. Now, is there a non-interactive
solution for this problem? Does anybody know what caused this problem in
the first place?
The data is read from a bundle of csv files using this function:
> cls.read.data <- function (name, months=months.default, only.all=F, ...) {
> datavars <- paste(name, months, sep="")
>
> for (m in months) {
> v <- paste(name, m, sep="")
> filename <- paste(data.dir, paste(v, ".txt", sep=""), sep="/")
> print(filename)
> data <-...
2012 Jan 05
1
[ncdf] programmatically copying a netCDF file
...oto allow reference semantics). Therefore,
ISTM, rather than attempting to modify a (copy of a) file in-place,
I should instead [copy the bits I want to keep from the source file
to the new/target file, read the one data variable I want to modify
from the source file, write the one modified datavar to the target
file]. (Please correct me if wrong!)
* I have a routine that (I believe) does the desired modification of
the one datavar.
And from reading `help(*ncdf)` and
http://www.image.ucar.edu/Software/Netcdf/
I believe (ICBW :-) I understand the definition, get, and put steps
that are...
2012 Aug 28
4
[ncdf4] error converting GEIA data to netCDF
summary: I can successfully ncvar_put(...) data to a file, but when I
try to ncvar_get(...) the same data, I get
> Error in if (nc$var[[li]]$hasAddOffset) addOffset = nc$var[[li]]$addOffset else addOffset = 0 :
> argument is of length zero
How to fix or debug?
details:
R code @
https://github.com/TomRoche/GEIA_to_NetCDF
successfully (if crudely) uses R packages={ncdf4, maps, fields}