R.Luminescence

Board for users of the R.Luminescence package

result files.

A place where you may post your own scripts and discuss them with other users

Moderator: skreutzer

result files.

Postby questio » Mon Oct 13, 2014 5:54 am

Good afternoon!
I have some issues getting the actual Mindose value and the 95% ci results in a file. I would like to access those to add those extra lines to a radial plot with the CA values. I can do that with Fmix, but with MinDose, despite the simplest results, I am stuck.
When asking for the results in a file, using this code in Fmix, I can access the results
Code: Select all
comp_AD13037_ED<-get_RLum.Results(FMIX,data.object="components")
write.table(comp_AD13037_ED, file="F:/UNI work/3. PROJECTS/R results/compAD13037_ED.csv", sep = ",", row.names = FALSE)

and all the data is in a table in the file I created and I can request the different components to plot together on a radial plot.
However when I use
Code: Select all
MinD<-get_RLum.Results(FMIX,data.object="results")
write.table(MinD, file="F:/UNI work/3. PROJECTS/R results/MinAD13037_ED.csv", sep = ",", row.names = FALSE)

I get the following error message
Error: unexpected symbol in:
"MinD <-get_Rlum_Results(MinDresults, data.object="results”)
write.table (MinD, file = "F"

I expected some syntax error about the data.table, but not about the unexpected symbol?
I am quite stuck as I cannot see where I have made a mistake.
I am sure the error is obvious, but I cannot pick it!
Thanks!
Danièle
questio
 
Posts: 29
Joined: Tue Mar 11, 2014 7:47 am

Re: result files.

Postby cburow » Thu Oct 23, 2014 7:12 am

Dear Danièle,

sorry for the late reply, I guess it is probably "too late" by now.

Nevertheless, I unfortunately was not able to reproduce this error, even though I copied the exact code you provided (I had to modify the file path, of course). And now matter how hard I look at it, I can't seem to spot a mistake either... this is really strange. Here is the code I used to try to reproduce the error, but which turned out to work perfectly fine. Maybe it's of some use for you:

Code: Select all
# load library
library(Luminescence)

# load data set
data<- data(ExampleData.DeValues, envir = environment())

# Case 1: Finite Mixture Model
FMIX<- calc_FiniteMixture(ExampleData.DeValues, sigmab = 0.05, n.components = 2)
comp_AD13037_ED<-get_RLum.Results(FMIX,data.object="components")
write.table(comp_AD13037_ED, file="C:/users/Burow/Desktop/compAD13037_ED.csv", sep = ",", row.names = FALSE)

# Case 2: Minimum Age Model
FMIX<- calc_MinDose3(ExampleData.DeValues, sigmab = 0.05)
MinD<-get_RLum.Results(FMIX,data.object="results")
write.table(MinD, file="C:/users/Burow/Desktop/MinAD13037_ED.csv", sep = ",", row.names = FALSE)


Best

Christoph
User avatar
cburow
 
Posts: 42
Joined: Thu May 16, 2013 1:39 pm
Location: Cologne

Re: result files.

Postby skreutzer » Mon Oct 27, 2014 8:07 am

Dear Danièle,

just in addition to Christoph's message: It looks like a 'hidden' character problem, meaning a character that is not displayed but affects your code and causes the error.
Try to 'produce' the path for your output file using the "TAB" key. This should prevent such effects.

Best,

Sebastian
--
Package Developer
skreutzer
 
Posts: 69
Joined: Tue May 14, 2013 4:19 pm

Re: result files.

Postby questio » Fri Oct 31, 2014 10:12 pm

Dear Christoph and Sebastian,

Thank you for your help. I have to add Christoph that it is never "too late" !

The problem is indeed very peculiar as I "copied" and "pasted" the code from one to the other changing the one word that had nothing to do with the folders. I have to repeat the steps now and try to remember whether I used notepad in between the copy and paste?

You are right Sebastian; R is indeed extremely sensitive to keystrokes, and the
"
is not the same as the
both produced by the same keystroke but appearing differently in notepad or word than in R.
I will try and use your insights and let you know what happened. In the meantime, I will use the code you sent me.
Thank you for that!
You email comforted me in that it was not the coding at fault which is a huge help.

Cheers,

Danièle
questio
 
Posts: 29
Joined: Tue Mar 11, 2014 7:47 am

Re: result files.

Postby skreutzer » Sun Nov 02, 2014 10:55 am

Dear Danièle,

just last add to this thread... as I forgot it previously.
Instead of the "TAB" key you can also try:

Code: Select all
input <- file.choose()
input


This opens a context menu and you can easily browse to your file system. Afterwards the result
will appear as "character" in the object "input".

Best,

Sebastian
--
Package Developer
skreutzer
 
Posts: 69
Joined: Tue May 14, 2013 4:19 pm

Re: result files.

Postby cburow » Tue Nov 04, 2014 6:51 pm

Dear Danièle,

I'm glad you found the "mistake", which is something that probably all of us have encountered at some point and which is definately hard to spot...

Out of curiosity I consulted google and found the following:
http://unicode.org/cldr/utility/confusables.jsp?a="&r=None

There is a total of 15 different characters in unicode associated to quotation marks. R accepts only the first one (unicode 0022) as double quotation mark, which is also the one that is generated by your keyboard (Alt+2). Any other quotation mark (except the single quotation mark) is not inpreted as intended, i.e. to assign a string and ultimately returns the error you received.

Cheers

Christoph
User avatar
cburow
 
Posts: 42
Joined: Thu May 16, 2013 1:39 pm
Location: Cologne


Return to User defined scripts

Who is online

Users browsing this forum: No registered users and 1 guest

cron