Yes, I keep a copy in MS Word.
Would Notepad be OK?
I need sleep now, will work tomorrow.
--
View this message in context:
http://r.789695.n4.nabble.com/double-axis-labels-function-of-each-other-tp4705457p4705463.html
Sent from the R help mailing list archive at Nabble.com.
I have been doing other things, but want again to learn R.
First some code:
#try 2 axes at bottom
x1 - c(1,2,3,4,5,6,7,8,9)
x2 - c(5,1,9,6,3,7,8,2,4)
plot(x1,x2,type=l) #scatter plot x1 on horizontal, x2 on vertical axis
axis(1,labels=TRUE,tick=TRUE,col=red,col.axis=red,lwd=4,line=2.5)
Some
Thanks, That was good help; I tried this; I hope I didn't copy it wrong:
#try 2 axes at bottom
x1 - c(1,2,3,4,5,6,7,8,9)
x2 - c(5,1,9,6,3,7,8,2,4)
par(mar=c(7,4,4,2))
plot(x1,x2,type=l,xlab=””) #scatter plot x1 on horiz, x2 on vert axis
require(plotrix)
Thank you Jeff for your good orientation. You are an educator.
I looked at the documentation for more than an hour.
Yes, there is a big learning curve.
My R-coding friend doesn't know it either.
Here is runnable code for a graph I would like to redo in the better code.
The staxlab function was
of your curiosity?
Hurr
--
View this message in context:
http://r.789695.n4.nabble.com/Second-axis-on-bottom-of-graph-tp4690696p4691398.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https
graphic plot,
and it prints as-is.
But if I try to stretch it manually or press the
full-page button (Windows 7) it's ruined.
Hurr
--
View this message in context:
http://r.789695.n4.nabble.com/Second-axis-on-bottom-of-graph-tp4690696p4691311.html
Sent from the R help mailing list archive
In the R Documentation for top.line in staxlab in plotrix:
top.line is: Distance from the axis to place the first line of text.
Notice that in the original runnable code in this thread
for the two axes at the bottom of the graph:
prdAxDistDown=0; frqAxDistDown=3.5;
OK, so nobody knows how to explain my code or do it better.
My bigger problem is to know how to move the labels a small
distance away from the tick marks so I can see the decimal points.
Can anyone help me?
Hurr
--
View this message in context:
http://r.789695.n4.nabble.com/How-do-I-move
Another wish is to make the left and right
plot borders match the axis limits I
have placed on the second axis using
xlim= in plot().
But the axis is shorter than the
plot and I want them equal.
How do I do that?
Hurr
--
View this message in context:
http://r.789695.n4.nabble.com/Second
Thanks again Jim.
I stuck xaxs=i in the existing par() command and it worked as I wanted it.
I haven't looked at the documentation yet, but that's next.
Hurr
--
View this message in context:
http://r.789695.n4.nabble.com/Second-axis-on-bottom-of-graph-tp4690696p4691204.html
Sent from the R
to select a second page.
I think it is better to start a new thread when
that happens so others will see my post too.
Hurr
--
View this message in context:
http://r.789695.n4.nabble.com/Second-axis-on-bottom-of-graph-tp4690696p4691042.html
Sent from the R help mailing list archive at Nabble.com
#trying for both period-labeled and frequency labeled horizontal axis
rm(list=ls(all=TRUE))
install.packages('plotrix')
library(plotrix)
staxlab-function(side=1,at,labels,nlines=2,top.line=0.5,
line.spacing=0.8,srt=NA,ticklen=0.03,adj=1,...) {
if(missing(labels)) labels-at
to be standard soon was sent to me by
the author to make staxlab work on the second x axis.
Hurr
--
View this message in context:
http://r.789695.n4.nabble.com/How-do-I-move-the-axis-labels-precisely-tp4691082p4691095.html
Sent from the R help mailing list archive at Nabble.com
Next I want to move the x axis labels up towards the axis to
make the gap smaller. The mgp= was suggested to me.
The staxlab function to be standard soon was sent to me by
the author to make staxlab work on the second x axis.
Runnable code to help demonstrate what I want to do:
Hurr
#trying
On the page listing all of the post topics and time last post it
says that this topic has a post at 6:05 am today, but
that post doesn't show up when I view this topic.
There must be some kind of programming error.
Hurr
--
View this message in context:
http://r.789695.n4.nabble.com/Second
How can I:
1) make ticks shorter or longer
2) make ticks cross the axis line
3) make ticks project toward the plot
4) make grid lines
5) make perpendicular labels be
close to the axis near ticks
projecting away from the plot
--
View this message in context:
of the questions:
1) make ticks shorter or longer
3) make ticks project toward the plot
4) make grid lines
But my how do I?
5) set the small distance I want the perdendicular
labels to be from the axis and from the ticks.
Hurr
--
View this message in context:
http://r.789695.n4.nabble.com/Second-axis
I was able to put tck=-0.1 into either par() or
axis() and it made a tick difference I understood.
As I understand it, default for mgp is c(3,1,0).
When I put mgp=c(3,4,0) or mgp=c(3,7,0) into
either par() or axis() I see no difference.
Hurr
--
View this message in context:
http://r.789695
Thanks Jim, I see you are the author of staxlab.
In the second staxlab I have tried line=3.5 like in axis, and
top.line=3.5, separately, with no apparent effect.
We should have to select the second axis somehow.
Hurr
--
View this message in context:
http://r.789695.n4.nabble.com/Second-axis
)),padj=0)
staxlab(1,top.line=5,at=frqTicLocs,labels=frqLabels,srt=90)
title(xlab=Cycles/Yr,line=6)
Hurr
--
View this message in context:
http://r.789695.n4.nabble.com/Second-axis-on-bottom-of-graph-tp4690696p4690819.html
Sent from the R help mailing list archive at Nabble.com
to add something to the second staxlab to select second axis?
Hurr
--
View this message in context:
http://r.789695.n4.nabble.com/Second-axis-on-bottom-of-graph-tp4690696p4690803.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help
The first ten lines of code work OK temporariy.
The final line is for a second more-usual axis.
But if I say line=4 to prevent its overwriting the
first axis, it goes off the graph page.
How do I solve that prob;em?
install.packages('plotrix')
library(plotrix)
horAxisLims=c(0,7213)
Thankyou S Ellison,
The following code works preliminarily,
To start-with, how do I omit the axis label?
I tried xlab=NULL in the plot command
install.packages('plotrix')
library(plotrix)
horAxisLims=c(0,7213)
verData=c(1,365,809,1252,1753,2191,2922,3409,3896,4383,4819,5255,5691,6128,6564,7000)
Sorry I didn't catch-on to xlab= earlier.
The following code works preliminarily,
now I need to add an axis-title to the added axis.
I don't see axistitle in axis command selections.
install.packages('plotrix')
library(plotrix)
horAxisLims=c(0,7213)
Thank you David for title()
In the axis command I need line=3.5,
but it only works with whole numbers.
Better yet, it would be better to move
the horLabels upward almost to the axis.
I can't figure out how to do that either.
Please show me.
Hurr
--
View this message in context:
http://r
Full error message is there in my neat May 13, 2014; 9:54pm post.
For some reason your last post is a mess.
Hurr
--
View this message in context:
http://r.789695.n4.nabble.com/Put-short-string-labels-vertically-near-tick-marks-on-bottom-axis-tp4690452p4690492.html
Sent from the R help
in install.packages(plotrix) : object 'plotrix' not found
Thanks,
Hurr
--
View this message in context:
http://r.789695.n4.nabble.com/Put-short-string-labels-vertically-near-tick-marks-on-bottom-axis-tp4690452p4690514.html
Sent from the R help mailing list archive at Nabble.com
.
But R is hard for me.
Hurr
--
View this message in context:
http://r.789695.n4.nabble.com/Put-short-string-labels-vertically-near-tick-marks-on-bottom-axis-tp4690452p4690519.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r
) automatically in
the graphics of R?
Hurr
--
View this message in context:
http://r.789695.n4.nabble.com/Put-short-string-labels-vertically-near-tick-marks-on-bottom-axis-tp4690452p4690528.html
Sent from the R help mailing list archive at Nabble.com
(i.e. above) the Unit.
I could externally tell it where to put them, but the
location should be relative to the label size, not only to
the original scale of the horizontal axis.
It seems to me that there might be a
way in R to make this happen.
Hurr
--
View this message in context:
http://r
A month ago I was considering the forum topic
“Label axis tick marks with a simple function of axis value”
and haven’t had time to work much on it.
Since then I have written a little program that makes
period labels for the frequency axis, but I don’t know how to attach them.
I expected the
David,
The error I get is:
Error: unexpected input in horLabels=c(”
I don't get an error: Smart quotes
I use Notepad for editor.
Hurr
--
View this message in context:
http://r.789695.n4.nabble.com/Put-short-string-labels-vertically-near-tick-marks-on-bottom-axis-tp4690452p4690463.html
Sent
I get the error message:
Error in library(plotrix) : there is no package called ‘plotrix’
Hurr
--
View this message in context:
http://r.789695.n4.nabble.com/Put-short-string-labels-vertically-near-tick-marks-on-bottom-axis-tp4690452p4690464.html
Sent from the R help mailing list archive
I get:
install.packages(plotrix)
Error in install.packages(plotrix) : object 'plotrix' not found
Hurr
--
View this message in context:
http://r.789695.n4.nabble.com/Put-short-string-labels-vertically-near-tick-marks-on-bottom-axis-tp4690452p4690474.html
Sent from the R help mailing list
,at=horTicLocs,labels=horLabels)
The plotrix error is still there.
Hurr
--
View this message in context:
http://r.789695.n4.nabble.com/Put-short-string-labels-vertically-near-tick-marks-on-bottom-axis-tp4690452p4690478.html
Sent from the R help mailing list archive at Nabble.com
Yes, the initial question is answered and the code works.
I suppose that I should not have added more to it.
I should have posted a new topic.
Sorry that I am not at all an R user.
Just trying to determine if I want to use it.
I just read your link.
Sorry to be more stupid than you expect.
I did
Thanks Jim, Labels for the following are at 0,2,4,6,8,10,12, not data, good.
and omitted where lack of room.
h=c(1.2,2.4,3.1,4.7,5.3,6.2,7.6,8.8,9.7)
v=c(9,8,7,6,5,4,3,2,1)
plot(h,v,xaxt='n',xlim=c(-1,13))
x-c(1.6,2.6,6.6,9.6,12.9)
axis_labels-1/pretty(x)
axis(1,at=pretty(x),labels=axis_labels)
What we've covered so far is of great value.
For a neater plot,
the next step will be to learn how to put
numbers with units at each tick mark.
I suppose I can form the number-unit string myself in
separate code and put the tickmark in a place that
I calculate in separate code.
But I need to
Don suggested something like this:
h=c(1,2,3,4,5,6,7,8,9)
v=c(9,8,7,6,5,4,3,2,1)
plot(h,v,xaxt='n')
xat=pretty(h)
axis(1,at=xat,labels=1/xat)
But it puts the tick marks at the data-x-locations.
If the tick locations are not automatic or
automatically separate from the data locations, then
I want
This still puts tick marks at data points:
h=c(1,2,3,4,5,6,7,8,9)
v=c(9,8,7,6,5,4,3,2,1)
plot(h,v,xaxt='n')
x-c(1.6,2.6,6.6,9.6,12.9)
axis_labels-1/pretty(x)
axis(1,at=pretty(x),labels=axis_labels)
How do I get the axis to approx 13 ?
--
View this message in context:
How can I label existing axis tick marks with a
simple function of axis value like 1/AxisValue?
It seems like this should be an operation where
I just use the formula.
--
View this message in context:
Thanks Jim, maybe now I can start learning.
Next I want to use my choice of n digits or width instead of round.
--
View this message in context:
http://r.789695.n4.nabble.com/labeling-abscissa-using-a-function-of-the-plotted-scale-tp4678075p4678946.html
Sent from the R help mailing list
Thanks Jim, maybe now I can start learning.
Here is a run of my trying to learn:
xvalue-c(5.2,1.3,9.7,2.8,8.1,4.7,6.6,7.4)
yvalue-c(9,3,4,7,2,5,3,6)
plot(xvalue,yvalue)
axis(1,at=NULL,labels=1/xvalue,digits=5)
Error in axis(1, at = NULL, labels = 1/xvalue, digits = 5) :
'labels' is supplied
Thanks David, did I use incorrect english to call labels = 1/xvalue a
formula or function?
Seems to me an obvious first try would be to place the labels where
they would have been placed without the formula.
I haven't yet, but I will study from your suggestions.
--
View this message in
I studied the Add an Axis to a Plot document but
I can't figure out where the 1/trueScaleValue goes.
Would someone help me?
--
View this message in context:
http://r.789695.n4.nabble.com/labeling-abscissa-using-a-function-of-the-plotted-scale-tp4678075p4678917.html
Sent from the R help
Sorry, I wasn't aware that it was that difficult.
Here is the example scatter plot data:
xvalue,yvalue
1,9
2,3
3,4
4,7
5,2
6,5
7,3
8,6
Please show me how to label the x axis with 1/xvalue.
Hopefully, R plotter takes care of spacing, but maybe not.
Thanks
--
View this message in context:
I am surprised to not get a reply.
I suppose this means that extremely few, if any, use rJava.
rJava.pdf says this, but I am too stupid to interpret it:
Description
.jcall calls a Java method with the supplied arguments.
Usage
.jcall(obj, returnSig = V, method, ..., evalArray = TRUE,
evalString
Thanks so much for the reply.
I did the search for rJava examples and found the Scott
Hoover instructions which seemed like exactly what I needed.
I compiled the java code and copied myExchange.java and
myExchange.class to the directory where I started R where
I did and the calls suggested
What I was missing was that I had to put as.integer(-4) to make it an
integer.
--
View this message in context:
http://r.789695.n4.nabble.com/How-do-I-use-simple-calls-to-java-methods-tp4678753p4678844.html
Sent from the R help mailing list archive at Nabble.com.
May I send a .zip file attached to a post?
--
View this message in context:
http://r.789695.n4.nabble.com/May-I-send-a-zip-attachment-to-a-post-tp4678742.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing
I need to learn how to set up two methods (java functions) so I can call them
from R.
Currently I just copy and paste R code into the R console.
A little piece of the R code inside a loop is:
linTm - linTimOfCalStg(dta[i,timCol],tlev)
calCk - calStgOfLinTim(linTm,tlev)
No answers in the three days. Does anyone use rjava?
If no one uses it, then I am afraid to try.
Or is it extremely easy?
--
View this message in context:
http://r.789695.n4.nabble.com/rjava-be-carefuls-tp4678102p4678201.html
Sent from the R help mailing list archive at Nabble.com.
Is it easy or difficult to label the abscissa of a scatter graph as
1/trueScaleValue at that point?
--
View this message in context:
http://r.789695.n4.nabble.com/labeling-abscissa-using-a-function-of-the-plotted-scale-tp4678075.html
Sent from the R help mailing list archive at Nabble.com.
I have a java class with routines (and their tests) that I would like to
use in R so I don't have to have two copies of important subroutines.
I have looked at rjava, but can't grasp it all and don't know what are
the important items to observe first so I don't get into too much
trouble later. I
Thanks.
--
View this message in context:
http://r.789695.n4.nabble.com/labeling-abscissa-using-a-function-of-the-plotted-scale-tp4678075p4678103.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
readline(press return to continue)
worked as a pause until I used it in 4 places in a different program where
none of them wait.
What problem do I look for?
--
View this message in context:
http://r.789695.n4.nabble.com/pause-code-in-R-code-tp4523209p4539399.html
Sent from the R help mailing
Yes, that is the question.
So is it the readline() ?
--
View this message in context:
http://r.789695.n4.nabble.com/pause-code-in-R-code-tp4523209p4539615.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing
I believe I have made this posting simple enough to understand.
The sample time-series has only 10 times.
SimpleTS() is the R function to contain the call to do the plot.
SimpleTS - function() {
titleline - readLines(SimpleTS.dta, n=1)
print(titleline)
dta - read.table(SimpleTS.dta, skip
linearizeTime() is from the restof my own code and the rest if my code is not
small.
That is why I gave you the printout and the code line that produced it.
The printout at the end of SimpleTS() is this:
[1] `Simple Time Series
monoMn SBP DBP HRT
1 1057366710 117 53 54
2 1057369636 108
A friend of mine added plot code to the function SimpleTS() as follows
but it misses the single point between two missing points:
SimpleTS - function() {
fileStg - C:/ad/dta/TryRRead/Rcode/SHIYU/SimpleTS.dta
titleline - readLines(fileStg, n=1)
print(titleline)
dta -
Thanks again Michael,
I finally had a little time today to look ar the zoo documentation.
But I do not understand R and am incompetent to figure out how to
use zoo to get the quick plot of unequal interval time series
presented in the first posting (yes it's equal interval,
but pretend it is
Thanks much for the reply.
I did the ?ts and it seems to be for equal interval time series.
Our time series are hardly ever equal interval.
The time is in the first column used for the abscissa.
Probably need the easiest simplest tier plot.
When I say plot, it wants limits and stuff.
I guess it
I tried ?zoo, but it's not available.
Do I do something to make it available?
Thanks Sarah, it's incomprehensible to me too.
That's why I showed you the data and asked.
--
View this message in context:
Thanks Michael, sounds right, will try later today when I have time.
--
View this message in context:
http://r.789695.n4.nabble.com/How-do-I-get-a-rough-quick-utility-plot-of-a-time-series-tp4522709p4526310.html
Sent from the R help mailing list archive at Nabble.com.
How do I write something like pause() in R code like
in other programming languages so I can just press
something to let the program continue?
--
View this message in context:
http://r.789695.n4.nabble.com/pause-code-in-R-code-tp4523209p4523209.html
Sent from the R help mailing list archive
Sorry, I cannot find your answer in your reply.
--
View this message in context:
http://r.789695.n4.nabble.com/pause-code-in-R-code-tp4523209p4523348.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
Thanks to all.
I'm learning.
--
View this message in context:
http://r.789695.n4.nabble.com/pause-code-in-R-code-tp4523209p4523520.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
This must be a misdirected reply.
Personal or system error?
--
View this message in context:
http://r.789695.n4.nabble.com/pause-code-in-R-code-tp4523209p4523523.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org
So far I have figured out that the following line
reads our time series files into R OK.
dtLs$dta - read.table(C:/TryRRead/datFiles/JFeqfi4h.rta, header = TRUE,
sep = ,, colClasses = character)
But I have to remove a main-title line so
that the first line is the column titles line.
This leads
Thanks so much. The following are the actual lines I used for testing, and
they worked.
titleline - readLines(C:/ad/dta/TryRRead/pureCos2.dta, n=1)
print(titleline)
dta - read.table(C:/ad/dta/TryRRead/pureCos2.dta, skip = 1, header =
TRUE, sep = ,, colClasses = character)
linDta -
I got a quick answer on my pause question and on my read.table question.
But I didn't think this question should be that much harder.
I realize that there is likely a whole range of answers.
Please give me a simple two-function time series plot so
I can get started with time-series plots.
Column
The following is an R run showing that it has read a
2000 point time series having two values at each time.
What is the simplest way to plot the data?
It seems like the whatever plot routine should be able to
make a rough utility plot from just the TS matrix.
Note that I am already using
I solved some of my problems, but the one that remains is
that reading the two-dimensional arrays into R transposes the matrix.
The arrays I want to read are unequal interval time multi series with
the first column being the times which are converted in java from
calendar CnYrMoDaHrMnScDCMQ or
No response, and I still cannot do it or find out where to learn.
JAVA CLASS SOURCE FOR R:
public class Transf2R {
Transf2R transf2R;
public static void main(String[]args) {
Transf2R transf2R=new Transf2R(); transf2R.transf2R=transf2R;
transf2R.transf2R.main2();
}
public final
2012/3/23
Back again today at trying to learn R.
These are the results of a run I made.
I understand very little of this.
sapply() helps me get the array returned from a method.
Strings and doubles returned from a method don't seem to need sapply().
I want to learn how to fetch the constant
I haven't had time to try using R for over a year, but have a colleage who
wants to.
We work with time series and our current version of our calendar-time
subroutines in
java converts both directions between linear time and calendar.
We have used calendar time since year 1965 starting out then
Have you tried loading reshape2 after ggplot2 and all it's requirements?
Usually whatever is loaded last masks earlier loaded packages with
functions of the same name so if reshape2 is last then it should mask
reshape(1) and all of it's similarly named functions.
Brandon
On Thu, Nov 10, 2011 at
Is the value.name ignored as well?
Looks like it might have been left out of the function call?
reshape2::melt
function (data, ..., na.rm = FALSE, value.name = value)
{
UseMethod(melt, data)
}
environment: namespace:reshape2
Brandon
On Thu, Nov 10, 2011 at 08:45, Johannes Radinger
I suppose I wasn't clear enough.
For some purposes, I want to label the horizontal axis like the first
label-line below.
It separates the longer periods better even though it squashes the shorter
ones.
The real scale for the corresponding plotted data is the second label-line.
The same-range
Thank you both so very much.
--
View this message in context:
http://r.789695.n4.nabble.com/Graphics-Reciprocal-labeling-tp3949054p3950480.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
I need just a little more education.
I still haven't got back into attempting R programs,
but I have appreciated your information.
The linear-in-frequency horizontal-axis scale is
natural for frequency analysis, and so labeling in
period is applicable. Also applicable for better view
is an
Does R graphics have a way to easily label the horizontal axis by the
reciprocal
of the scaled value?
--
View this message in context:
http://r.789695.n4.nabble.com/Graphics-Reciprocal-labeling-tp3949054p3949054.html
Sent from the R help mailing list archive at Nabble.com.
Can I also label selected reciprocal numbers easily either
alongside or without the automatic ones, and have them
automatically in their correct spots.
Sorry, I really don't know R now.
--
View this message in context:
Using install packages pull-down, I chose a mirror and then package rJava.
Then it said that it cannot remove the rJava package already installed.
Then when I typed library(rJava) it said there was no rjava package.
Isn't that rather contradictory for R?
--
View this message in context:
I discovered that a row of a rectangular array returns, but a function
parameter is not sent to Java.
Appended bare test code: My simple Java test class source and R test code
follow:
public class RJavTest {
public static void main(String[]args) { RJavTest rJavTest=new RJavTest();
}
public
I am happy to report that the author and maintainer of rJava informed me
that the 2-dim array in java needs sapply and .jevalArray as follows:
conn2Arr- sapply(.jfield(rJavaTst,sig=[[D,con2Arr),.jevalArray)
conn2ArrRet -
sapply(.jcall(rJavaTst,returnSig=[[D,retCon2Arr),.jevalArray)
# I
Bare test code: My simple Java test class source and R test code follow:
public class RJavTest {
public static void main(String[]args) { RJavTest rJavTest=new RJavTest();
}
public final static String conStg=testString;
public final static double con0dbl=1001;
public final static
It was my understanding that R wasn't really the best thing for absolutely
huge datasets. 17.5 million points would probably fall under the category of
absolutely huge.
I'm on a little netbook right now (atom/R32) and it failed, but I'll try it
on my macbookPro/R64 later and see if it's able to
Upload it to GoogleDocs http://docs.google.com or
Dropboxhttp://dropbox.comand give us a public link to the dataset.
HTH,
Brandon
On Wed, Jun 23, 2010 at 21:57, Felipe Carrillo mazatlanmex...@yahoo.comwrote:
For some reason the shapefile can't get attached.
The shapefile is too large to put
89 matches
Mail list logo