Displaying 20 results from an estimated 3000 matches similar to: "private variables in package."
2007 May 25
1
Problem with accessing internal variable in package.
I am writing a package, which contains several functions and variables.
The variables are for internal use by functions.
Functions are ment to be callable by a user.
However, the function cannot access these variables.
The package contains only R code, and was created using package.skeleton
package.skeleton(name="ac9",
list=c(ls(pattern="(AB2)|(ac9)"),
2007 May 22
2
Please, remind a function name
Sorry, I'm stuck. :)
I am writing a function, which would fit either one linear model or another
one, depending on its argument model.type.
And I don't want to use several if's, because R allows doing it with much
more beauty.
That is I am looking for prettier alternative to the following
AB2C<-function(a,b,model.type="S") { # or HK, and return NULL if this
argument has
2007 Jan 24
2
how to trace what crashes R
I am writing bindings to the C library (neural network simulator SNNS).
DLL was produced with the command
R CMD SHLIB [source with C-wrappers, callable from R with .C and all
sources from the snns kernel]
I used latest MinGW.
The problem is. R crashes with the "segmentation violation".
Tracing with the insight and with simple Rprintf's gave me that crash occurs
on the call of the
2007 Oct 16
3
Updating R-Software without complete new installation
Hallo,
as I see there is a new version for R available. Can anyone tell me how
I can update my version 2.5.0 under Windows? The last times I just
uninstalled the old version and installed the new one. Afterwards I had
to install also all needed packages again. All in all it cost me half a
day until my system works fine again. Is there a quicker option? If yes
please tell me the commands.
Thanks,
2012 Dec 05
2
What is "print print print" ?
Hi all.
What is "print print print"?
I don't see output of the print command in for loop and have found this
link:
http://stackoverflow.com/questions/1816200/chisq-test-doesnt-print-results-when-in-a-loop
It describes a problem, similar to mine.
My problem. I want to execute print command in for loop.
If I copy for loop body with print() and paste it to console, I don't see
2007 Apr 04
5
how to image.plot a XY grid file into a lat-lon map
Hi All,
I have a netcdf gridded file with LCC projection. I can easily use
image.plot to visualize it. However, as the axises are in X,Y, not Lat and
Lon, I could not add state or country maps onto it (or lat lon information).
I do have a grid2d file that describes the lat and lon for each (X,Y) grid,
but the lat and lon are not regularly spaced, so I could not use image.plot.
Does anyone know
2007 Aug 15
4
Possible to "import" histograms in R?
Hi,
I have a large amount of data that I would like to create a histogram of and
plot and do things with in R. It is pretty much impossible to read the data
into R, so I have written a program to bin the data and now have a list of
counts in each bin. Is it possible to somehow import this into R and use
hist(), so I can, for instance, plot the probability density? I have looked
at the help page
2007 Jan 29
1
how to explore contents of R data file from command line?
Dear all,
I have a directory with my research project, containing files
.RData
and
inflow.RData
I am just curious, is there any way to explore contents of inflow.RData from
command line without affecting .RData and without copying inflow.RData to
another location?
I can see names and character attributes (of something in the file) in a 3rd
party raw file viewer.
--
View this message in
2007 May 07
1
looking for equivalent of matlab's medfilt1 function
Dear all,
I have several files with Matlab code, which I am translating to R.
For the zero-level approach, I took the very old shell script from R-help
archives, which has made some obvious leg-work such as replacement of "="
with "<-".
Now I am translating indexing, matrix operations and function call using
this table
http://37mm.no/mpy/octave-r.html
The problem is, I
2007 Apr 26
3
adding a column to a matrix
i would like to add a variable to an existing matrix by manipulating 2 previous variables eg for the data
m
treat strata censti survTime
[1,] 1 2 284.684074 690.4961005
[2,] 1 1 172.764515 32.3990335
[3,] 1 1 2393.195400 24.6145279
[4,] 2 1 30.364771 8.0272267
[5,] 1 1 523.182282 554.7659501
l
2007 Feb 04
1
Fwd: Re: Calling C code from R
Hi!
Thanks in advance.
Thanks to all of you who have responded to me on above. This is one of the responses I received on above.
I have installed perl (with path C:\Perl\bin\;) an MinGW (with path C:\MinGW\bin; C:\MinGW;).
At the Command Prompt (C:\R-2.4.0\bin) I have typed:
C:\R-2.4.0\bin>Rcmd SHLIB useC1.c
(No error and useC1.dll file has not been created)
2003 May 13
1
several regression lines in panel of xyplot (trellis graphics)
Dear r-help,
I need to draw xyplot() graphs with several regression lines:
one line for the whole range of x (the variable on the horizontal
axis) and two additional lines for subranges of x.
Is it possible to make first regression line (panel.lmline(x,y,...);)
to be drawn on the whole graph
and regression lines of the subsets to be drawn only over their subsets?
I have defined
2003 May 08
3
again troubles with lattice
Dear r-help community,
Thank you for your previous answers!
Now I have strange behaviour of the lattice library funcitons.
They do not draw graphics in the file when called from the script.
I created the script file, called, for example, "a.R", containing
the following
library(lattice);
trellis.device(device="png",
filename="a.png",
2005 May 20
5
getting the unique values and counts from a vector
Hi all,
>From a vector, I want to get the unique values and the counts of these
unique values in the vector. For example,
x<-c(2 ,1 ,2, 1, 4 ,2 ,1, 4 ,1 ,1)
xu<-unique(x)
xn<-numeric(length(xu))
for (i in 1:length(xu)) {xn[i]<-length(which(x==xu[i]))}
There must be a very much simpler method of doing this. Can somebody
direct me to the functions that I must read in order to do
2005 Aug 16
3
how to reshape an array avoiding for loops
Dear r-help,
I have an array a1 with dimensions [1:660,1:65,1:25]
I would like the first dimension to be the last one.
That is I want and array [1:65,1:25,1:660]
The only way to do this, I know, is
tmp.a<-array(dim=dim(a1)[c(2,3,1)])
for(i in 1:dim(a1)[1]) tmp.a[,,i]<-a1[i,,]
a1<-tmp.a
rm(tmp.a)
Is it possible to avoid 'for' loop here?
Thank you!
---
2003 Apr 16
2
layout.show()
Dear r-help,
Please, be so kind, tell me what does mean the parameter of layout.show()?
I use R 1.6.2... Windows NT 4.0
Unfortunately I cannot understand phrases from the help
"n: number of figures to plot."
what figures?
"`layout.show(n)' plots (part of) the current layout, namely the
outlines of the next `n' figures."
what figures?
2003 May 27
2
R doesn't remove temporary dirs and about bugreport
Dear r-help,
1. I always find in TEMP directory subdirs named like Rtmp#####
where ##### denote a number.
Obviously, they are created by R and are not removed by it after
finish.
Why?
I use R 1.7.0 and Windows NT Workstation 4.0, English. SP 6a.
2. Is it possible to get known whether my bug report was received?
I've sent to r-bugs at biostat.ku.dk the following but it seemed
2003 May 11
2
what does boxplot draw?
Dear r-help,
Unfortunately I cannot find in the documentation what determines
ranges of a 'box' in the box-and-whisker plot.
It is said in "Simple R" (http://www.math.csi.cuny.edu/Statistics/R/simpleR)
that they are 1st and 3rd Qus usually.
I tried to add to boxplot lines with (quantile(x,probs=0.25)), but
lines do not coincide with edges of boxes.
2003 May 06
5
xyplot (lattice), strip.default
Dear r-help,
I've got data of the following structure
1979 93.428747 0
1979 87.298608 20
1979 78.506340 40
...
1979 45.567890 340
1980 60.815289 0
1980 49.630904 20
1980 24.981362 40
...
The first column is year and the last one is the longitude.
I need a set of graphs showing the dependence of the middle value on
the longitude, for each year, situated one blow the other.
2005 May 20
3
Why does this give a syntax error?
Hi
I'm generating the following in a file and getting a syntax error:
bryansAtHeaderLevel <-
c(0,1,1,1,1,0,0,0,0,0,0,1,0,0,1,1,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,0,0,1,0,1,0,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,1,1,1,0,0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,0,0,1,0,1,0,0,0,)
finnsAtHeaderLevel <-