我有一个这样的数据框:
df = data.frame(dt = c('0101-01-01','0023-10-20'), comment = c('BC','AD'))
根据评论,第二个dt实际上是年-23。
如何让R识别第一个日期是BC并从这两个日期中获得时差?
答案 0 :(得分:1)
我们在更改为import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex);
import axios from 'axios';
const iri_ip = '192.168.1.199';
const iri_port = '14265';
const state = {
token: null,
loading: false,
nodeInfo: {}
};
const mutations = {
SET_NODE_INFO(state, info) {
state.nodeInfo = info;
}
};
const actions = {
fetchNodeInfo({commit}) {
axios(createIriRequest('getNodeInfo')).then(response => {
console.log(response.data);
commit('SET_NODE_INFO', response.data);
});
}
};
const getters = {
token: state => state.token,
loading: state => state.loading,
nodeInfo: state => state.nodeInfo
};
const loginModule = {
state,
mutations,
actions,
getters
};
function createIriRequest(command) {
return {
url: `http://${iri_ip}:${iri_port}`,
data: {'command': command},
method: 'post',
headers: {
'Content-Type': 'application/json',
'X-IOTA-API-Version': '1'
}
};
}
export default new Vuex.Store({
modules: {
loginModule
}
});
课程后转换为numeric
,将标记更改为yearmon
,以便在“评论”中将'BC'更改为<{p>}
-
如果我们想让'年'更接近
library(zoo)
v2 <- as.numeric(as.yearmon(df$dt))