Displaying 20 results from an estimated 600 matches similar to: "if() for() { }"
2006 Apr 04
1
imaging and contouring
Dear R'Helpers and Colleagues,
I have looked in the documentation, asked to some colleagues in the  
lab, but was unable to solve the following difficulty.
I am running R on a  iMac  G5 with OS 10.4.
The file below (73 rows x 144 col) shows the values of a climatic  
index on the globe with a grid of 2,5 ?  x 2,5 ? (NA = no value):
?
With image() and map() and running the following
2006 Oct 23
2
character manipulation
Dear R'helpers,
I am reading lines in a .txt file
Each line is stocked into a n elements object, as this:
[958] " 422 287 339  31 203 602 547 1026 500 366 346 227"
[959] " 410  67  11 220 110 451 562 598 732 163 163 220"
[960] " 179 513  95 186 102 595 333 1289 804 210 294 459"
[961] " 276 153 307 138 126 233 623 739 521 421 209  75"
[962] "  64
2006 Jun 07
2
how to read hdf files under R?
Hi!
I am trying to install in my R environment the rhdf5 package and  
library but it seems to have vanished from either the CRAN or  
BioConductors sites.
Can you tell me where it would be possible to find it or any R  
library (or function) able to read hdf files?
Sincerely,
Nicolas Degallier
UMR 7159 / IRD UR182
Laboratoire d'Oc?anographie et du Climat, Exp?rimentation et  
Approches
2018 Feb 05
1
Concatening two maps/shapefiles...
Dear All,
I'm new with mapping and using shapefiles in R.
I use the version: R 3.2.1 GUI 1.66 with Snow Leopard Mac OS (6956)
I want to build a map of the countries of Africa, in order to add points of collecting species of beetles, for later publishing.
library(maptools)
library(mapdata)
When I put the extreme coordinates of Africa, the map began only at longitude 0? and thus lacks the
2007 Feb 22
3
several Filled.contour plots on the same device...
hello -
a question about filled.contour plots, for which i haven't found a
response in previous posts - sorry if already treated.
i'd like to draw several filled.contour plots (that is, maps) on the same
device (a postscript file, actually). I know about layout(matrix) ,
split.screen or par(mfrow) : it works well for simple plots, but with
filled.contour plots, i get several pages
2005 Jun 23
3
grep negation
hi,
using the example in the grep help:
txt <- c("arm","foot","lefroo", "bafoobar")
i <- grep("foo",txt); i
[1] 2 4
but how can i get the negation (1,3) when looking for 'foo'?
thanks,
m.
2013 Jan 26
2
different legends in lattice panels
Hi listers,
I want to make lattice plots xyplots with the indication of legends 
inside each panel with only the points and the lines actually ploted 
inside each given panel according to the group(ing) factor.
The code below shows what I have achieved so far and I hope will make 
clear what I want to have.
It seems to me that my solution is a very "dirty hack" and there 
certainly is
2005 Jul 27
1
how to get actual value from predict in nnet?
Dear All,
After followed the help of nnet, I could get the networks trained and, excitedly, get the prediction for other samples. It is a two classes data set, I used "N" and "P" to label the two. My question is, how do I get the predicted numerical value for each sample? Not just give me the label(either "N" or "P")?  Thanks!
FYI: The nnet example I
1999 Oct 11
1
if(grep())
Would anyone care to comment if this is the best solution to this problem?
> trygrep <-function(x,y)
+ if(grep(x,y))
+ print("yes") else
+ print("NO")
>  
>trygrep("foo","bafoobar")
[1] "yes"
>
> trygrep("foo","bar")
Error in if (grep(x, y)) print("yes") else print("NO") : missing value
2003 Feb 13
3
search contrasts tutorial
I'm looking for a tutorial or notes on the use of contrasts factor in 
linear model in R, 
I've  found  some mails and infos about in various documents about R,
but I've probably missed
a good review on this subject. 
-- 
Robert Espesser     
Laboratoire Parole et Langage  UMR 6057, CNRS
29 Av. Robert Schuman  13621 AIX    (FRANCE)
Tel: +33 (0)4 42 95 36 26   Fax: +33 (0)4 42 59 50
2016 Dec 02
2
pdftools on Ubuntu
Hi,
I am trying to install pdftools package on R 3.3.1 (Ubuntu 16.04), but the
following issue occurs:
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because poppler-cpp was not found. Try installing:
 * deb: libpoppler-cpp-dev (Debian, Ubuntu, etc)
 * rpm: poppler-cpp-devel (Fedora, CentOS, RHEL)
 * csw: poppler_dev (Solaris)
 * brew: poppler (Mac OSX)
2013 Dec 12
1
censored counts and glmer/glmmADMB
dear R-users,
I have to model counts where all counts above some threshold
have been censored. In the same dataset I have too many zeroes for
a Poisson or even a negative binomial distribution to make
sense, so I would need a zero-inflated-censored negative binomial
family for use in glmer (or glmmADMB?). That seems not to exist.
my question is :
how could I add a custom-built family of
2010 Mar 10
1
Extract values of a two-factor table and duplicate them into a three-factor table
Dear all,
I would like to solve a trivial problem (I guess it is) but can't find the right way. Maybe someone can help me ?
I've got a table with two factors (station = station ID, buffer = buffer size in meters) and a value for each unique combination of those two factors (S = number of habitats within each buffer around each station) like this:
TABLE 1
station buffer S
Abaia01 200 2
2010 Oct 18
1
Error: subscript out of bounds
Dear All
     I have problem with this:
 > IWJR.temp <-IWJR.missing[sample(1:length(IWJR.missing),1),]
Error: subscript out of bounds
How I can solved this.
Thanks
IRD
2016 Dec 02
1
pdftools on Ubuntu
Hi Francois,
Thanks for your quick response.
Actually, I had already done that...
sudo apt-get install libpoppler-cpp-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libpoppler-cpp-dev is already the newest version (0.41.0-0ubuntu1.1).
0 upgraded, 0 newly installed, 0 to remove and 107 not upgraded.
Therefore, I assume I have this installed.
Best
2009 Nov 02
1
modifying predict.nnet() to function with errorest()
Greetings,
I am having trouble calculating artificial neural network 
misclassification errors using errorest() from the ipred package. 
I have had no problems estimating the values with randomForest() 
or svm(), but can't seem to get it to work with nnet(). I believe 
this is due to the output of the predict.nnet() function within 
cv.factor(). Below is a quick example of the problem I'm
2011 Feb 10
3
modifynig some elements of a vector
He everybody,
I want to add 1 to some elements of  a vector:
x is a vector
u is a vector of idices, that is, integers
assumed to be within the range 1..length(x)
and I want to add 1 to the elements of x
each time their index appears in u
x[u]<-x[u]+1 works only when there are no
duplicated values in u
I found this solution:
tu <- table(u)
indices <- as.numeric(names(tu))
x[indices]
2005 Oct 20
4
read.fwf doesn't work with header = TRUE (PR#8226)
Full_Name: Emmanuel Paradis
Version: 2.1.1
OS: Linux
Submission from: (NULL) (193.49.41.105)
read.fwf(..., header = TRUE) does not work properly since:
1/ the original header is printed on the console and not in FILE;
2/ the different 'parts' of the header should be separated with tabs
   to work with the call to read.table.
Here is a suggested fix for src/library/utils/R/read.fwf.R:
2003 Aug 13
1
stars graphs
Hi listers,
A few days ago I posted a question about the use of the stars function
on selected lines of a frame. Thanks to two helpers, a closer look at
the scale argument allowed to partially solve the problem. Yet I still
have a problem with stars.
Allow me to explain what I intend to do (sorry for my poor English and
the long post):
I want to graph an activity index of a fish during the day
2006 Sep 11
3
"unvector" ?
Hi ev'rybody,
is there a way to pass a vector to a function
expecting separate arguments?
more specifically, I have a character vector, say u
and I want a single string, but
>paste(u) 
doesn't work, so I would like something like 
>paste(unvector(u)).
I am interested in a solution to the general problem too,
as the only one I found is maintaining two versions of the
functions I